KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > team > ui > synchronize > ISynchronizeModelElement


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.team.ui.synchronize;
12
13 import org.eclipse.compare.ITypedElement;
14 import org.eclipse.compare.structuremergeviewer.ICompareInput;
15 import org.eclipse.compare.structuremergeviewer.IDiffContainer;
16 import org.eclipse.core.resources.IResource;
17 import org.eclipse.jface.resource.ImageDescriptor;
18 import org.eclipse.jface.util.IPropertyChangeListener;
19 import org.eclipse.team.internal.ui.TeamUIPlugin;
20
21 /**
22  * These are elements created to display synchronization state to the user. These elements are found in
23  * the generated diff tree viewer created by a {@link SubscriberParticipant}. Since it implements
24  * {@link org.eclipse.compare.ITypedElement} and {@link org.eclipse.compare.structuremergeviewer.ICompareInput}
25  * they can be used as input to compare components.
26   * <p>
27  * Clients typically use this class as is, but may subclass if required.
28  * </p>
29  * @since 3.0
30  */

31 public interface ISynchronizeModelElement extends IDiffContainer, ITypedElement, ICompareInput {
32
33     /**
34      * Property constant indicating that the element is currently being worked on by an operation.
35      */

36     public static final String JavaDoc BUSY_PROPERTY = TeamUIPlugin.ID + ".busy"; //$NON-NLS-1$
37

38     /**
39      * Property constant indicating that the element has children that are conflicting.
40      */

41     public static final String JavaDoc PROPAGATED_CONFLICT_PROPERTY = TeamUIPlugin.ID + ".conflict"; //$NON-NLS-1$
42

43     /**
44      * Property constant identifying that this element or one of its children has an error marker.
45      */

46     public static final String JavaDoc PROPAGATED_ERROR_MARKER_PROPERTY = TeamUIPlugin.ID + ".error"; //$NON-NLS-1$
47

48     /**
49      * Property constant indicating that this element or one of its children has a warning marker.
50      */

51     public static final String JavaDoc PROPAGATED_WARNING_MARKER_PROPERTY = TeamUIPlugin.ID + ".warning"; //$NON-NLS-1$
52

53     /**
54      * Adds a listener for changes to properties of this synchronize element. Has no effect if an identical
55      * listener is already registered.
56      *
57      * @param listener the listener to register
58      */

59     public abstract void addPropertyChangeListener(IPropertyChangeListener listener);
60
61     /**
62      * Removes the given property change listener from this model element. Has no effect if
63      * the listener is not registered.
64      *
65      * @param listener the listener to remove
66      */

67     public abstract void removePropertyChangeListener(IPropertyChangeListener listener);
68
69     /**
70      * Assigns the given property to this element and all it's parents.
71      *
72      * @param propertyName the property name to set
73      * @param value the value of the property
74      */

75     public void setPropertyToRoot(String JavaDoc propertyName, boolean value);
76     
77     /**
78      * Assigns the given property to this element.
79      *
80      * @param propertyName the property name
81      * @param value the value of the property.
82      */

83     public void setProperty(String JavaDoc propertyName, boolean value);
84     
85     /**
86      * Return whether this element has the given property assigned.
87      *
88      * @param propertyName the property to test for
89      * @return <code>true</code> if the property is set and <code>false</code>
90      * otherwise.
91      */

92     public abstract boolean getProperty(String JavaDoc propertyName);
93
94     /**
95      * The image descriptor describing the given element.
96      *
97      * @param element the model element for which to return an image.
98      * @return the image descriptor for the given element.
99      */

100     public abstract ImageDescriptor getImageDescriptor(Object JavaDoc element);
101
102     /**
103      * Returns the resource this element is showing synchronization information for or <code>null</code>
104      * if the element does not have an associated local resource.
105      *
106      * @return the resource this element is showing synchronization information for or <code>null</code>
107      * if the element does not have an associated local resource.
108      */

109     public abstract IResource getResource();
110 }
111
Popular Tags