Skip to main content
summaryrefslogtreecommitdiffstats
blob: f7b31ed4c54822fef73cb4eae2fb75d2303f39e9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*******************************************************************************
 * Copyright (c) 2000, 2013 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.team.ui.synchronize;

import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.compare.structuremergeviewer.IDiffContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.team.internal.ui.TeamUIPlugin;

/**
 * These are elements created to display synchronization state to the user. These elements are found in
 * the generated diff tree viewer created by a {@link SubscriberParticipant}. Since it implements
 * {@link ITypedElement} and {@link ICompareInput} they can be used as input to compare components.
  * <p>
 * Clients typically use this interface as is, but may implement it if required.
 * </p>
 * @since 3.0
 */
public interface ISynchronizeModelElement extends IDiffContainer, ITypedElement, ICompareInput {

	/**
	 * Property constant indicating that the element is currently being worked on by an operation.
	 */
	public static final String BUSY_PROPERTY = TeamUIPlugin.ID + ".busy"; //$NON-NLS-1$
	
	/**
	 * Property constant indicating that the element has children that are conflicting.
	 */
	public static final String PROPAGATED_CONFLICT_PROPERTY = TeamUIPlugin.ID + ".conflict"; //$NON-NLS-1$
	
	/**
	 * Property constant identifying that this element or one of its children has an error marker.
	 */
	public static final String PROPAGATED_ERROR_MARKER_PROPERTY = TeamUIPlugin.ID + ".error"; //$NON-NLS-1$
	
	/**
	 * Property constant indicating that this element or one of its children has a warning marker.
	 */
	public static final String PROPAGATED_WARNING_MARKER_PROPERTY = TeamUIPlugin.ID + ".warning"; //$NON-NLS-1$

	/**
	 * Adds a listener for changes to properties of this synchronize element. Has no effect if an identical 
	 * listener is already registered.
	 * 
	 * @param listener the listener to register
	 */
	public abstract void addPropertyChangeListener(IPropertyChangeListener listener);

	/**
	 * Removes the given property change listener from this model element. Has no effect if
	 * the listener is not registered.
	 * 
	 * @param listener the listener to remove
	 */
	public abstract void removePropertyChangeListener(IPropertyChangeListener listener);

	/**
	 * Assigns the given property to this element and all it's parents.
	 * 
	 * @param propertyName the property name to set
	 * @param value the value of the property
	 */
	public void setPropertyToRoot(String propertyName, boolean value);
	
	/**
	 * Assigns the given property to this element.
	 * 
	 * @param propertyName the property name
	 * @param value the value of the property.
	 */
	public void setProperty(String propertyName, boolean value);
	
	/**
	 * Return whether this element has the given property assigned.
	 * 
	 * @param propertyName the property to test for
	 * @return <code>true</code> if the property is set and <code>false</code>
	 * otherwise.
	 */
	public abstract boolean getProperty(String propertyName);

	/**
	 * The image descriptor describing the given element.
	 * 
	 * @param element the model element for which to return an image.
	 * @return the image descriptor for the given element.
	 */
	public abstract ImageDescriptor getImageDescriptor(Object element);

	/**
	 * Returns the resource this element is showing synchronization information for or <code>null</code>
	 * if the element does not have an associated local resource.
	 * 
	 * @return the resource this element is showing synchronization information for or <code>null</code>
	 * if the element does not have an associated local resource.
	 */
	public abstract IResource getResource();
}

Back to the top