Class AbstractDifferenceGroupProvider
- java.lang.Object
-
- org.eclipse.emf.common.notify.impl.AdapterImpl
-
- org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.AbstractDifferenceGroupProvider
-
- All Implemented Interfaces:
Adapter,Adapter.Internal,IDifferenceGroupProvider,IDifferenceGroupProvider2
- Direct Known Subclasses:
ByResourceGroupProvider,DefaultGroupProvider,EmptyDifferenceGroupProvider,KindGroupProvider,ThreeWayComparisonGroupProvider
public abstract class AbstractDifferenceGroupProvider extends AdapterImpl implements IDifferenceGroupProvider2
Abstract implementation ofIDifferenceGroupProvider.- Since:
- 4.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.Adapter
Adapter.Internal
-
Nested classes/interfaces inherited from interface org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider
IDifferenceGroupProvider.ComparisonType, IDifferenceGroupProvider.Descriptor
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanactiveByDefaultThe initial activation state of the group provider.protected StringlabelA human-readable label for this group provider.-
Fields inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
target
-
-
Constructor Summary
Constructors Constructor Description AbstractDifferenceGroupProvider()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<? extends IDifferenceGroup>buildGroups(Comparison aComparison)Builds the groups for this comparison.booleandefaultSelected()voiddispose()Dispose this difference group provider.protected ComparisongetComparison()protected ECrossReferenceAdaptergetCrossReferenceAdapter()Returns the cross reference adapter used by this difference group provider.Collection<? extends IDifferenceGroup>getGroups(Comparison aComparison)This will be called internally by the grouping actions in order to determine how the differences should be grouped in the structural view.StringgetLabel()List<TreeNode>getTreeNodes(EObject eObject)Returns allTreeNodes that are wrapping the giveneObject.booleangroupsAreBuilt()Tells if the groups of this provider have been already built for a comparison.booleanisAdapterForType(Object type)booleanisEnabled(IComparisonScope scope, Comparison comparison)Returns the activation condition based on the scope and comparison objects.voidsetDefaultSelected(boolean active)voidsetLabel(String label)-
Methods inherited from class org.eclipse.emf.common.notify.impl.AdapterImpl
getTarget, notifyChanged, setTarget, unsetTarget
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.emf.common.notify.Adapter
getTarget, notifyChanged, setTarget
-
-
-
-
Field Detail
-
label
protected String label
A human-readable label for this group provider. This will be displayed in the EMF Compare UI.- Since:
- 4.1
-
activeByDefault
protected boolean activeByDefault
The initial activation state of the group provider.- Since:
- 4.1
-
-
Method Detail
-
getLabel
public String getLabel()
- Since:
- 4.1
- See Also:
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#getLabel()
-
setLabel
public void setLabel(String label)
- Since:
- 4.1
- See Also:
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#setLabel(java.lang.String)
-
defaultSelected
public boolean defaultSelected()
- Since:
- 4.1
- See Also:
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#defaultSelected()
-
setDefaultSelected
public void setDefaultSelected(boolean active)
- Since:
- 4.1
- See Also:
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#setDefaultSelected(boolean)
-
isEnabled
public boolean isEnabled(IComparisonScope scope, Comparison comparison)
Returns the activation condition based on the scope and comparison objects.- Specified by:
isEnabledin interfaceIDifferenceGroupProvider- Parameters:
scope- The scope on which the group provider will be applied.comparison- The comparison which is to be displayed in the structural view.- Returns:
- The activation condition based on the scope and comparison objects.
- Since:
- 4.1
- See Also:
IDifferenceGroupProvider.isEnabled(org .eclipse.emf.compare.scope.IComparisonScope, org.eclipse.emf.compare.Comparison)
-
getCrossReferenceAdapter
protected final ECrossReferenceAdapter getCrossReferenceAdapter()
Returns the cross reference adapter used by this difference group provider.- Returns:
- the crossReferenceAdapter the cross reference adapter used by this difference group provider.
-
getTreeNodes
public List<TreeNode> getTreeNodes(EObject eObject)
Returns allTreeNodes that are wrapping the giveneObject. It internally use a cross reference adapter.- Specified by:
getTreeNodesin interfaceIDifferenceGroupProvider- Parameters:
eObject- the object from which we want inverse reference.- Returns:
- all
TreeNodes targeting the giveneObjectthroughTreePackage.Literals.TREE_NODE__DATA. - See Also:
org.eclipse.emf.compare.rcp.ui.structuremergeviewer.groups.IDifferenceGroupProvider#getTreeNodes(java.lang.Object)
-
isAdapterForType
public boolean isAdapterForType(Object type)
- Specified by:
isAdapterForTypein interfaceAdapter- Overrides:
isAdapterForTypein classAdapterImpl- See Also:
AdapterImpl.isAdapterForType(java.lang.Object)
-
getGroups
public Collection<? extends IDifferenceGroup> getGroups(Comparison aComparison)
This will be called internally by the grouping actions in order to determine how the differences should be grouped in the structural view.- Specified by:
getGroupsin interfaceIDifferenceGroupProvider- Parameters:
aComparison- The comparison which is to be displayed in the structural view. By default, its containment tree will be displayed.- Returns:
- The collection of difference groups that are to be displayed in the structural viewer. An empty
group will not be displayed at all. If
null, we'll fall back to the default behavior. - Since:
- 4.1
- See Also:
IDifferenceGroupProvider.getGroups(org.eclipse.emf.compare.Comparison)
-
buildGroups
protected Collection<? extends IDifferenceGroup> buildGroups(Comparison aComparison)
Builds the groups for this comparison. The framework expects that all groups are fully initialized ( their sub tree should be built). ExtendingIDifferenceGroupProvider2needs to override this method to provid groups.- Parameters:
aComparison- comparison against which the groups will be built.- Returns:
- Newly built collections of
IDifferenceGroup. - Since:
- 4.1
-
groupsAreBuilt
public boolean groupsAreBuilt()
Tells if the groups of this provider have been already built for a comparison.- Specified by:
groupsAreBuiltin interfaceIDifferenceGroupProvider2- Returns:
trueif the groups has been built for this comparison orfalseotherwise.- Since:
- 4.1
- See Also:
IDifferenceGroupProvider2.groupsAreBuilt()
-
getComparison
protected Comparison getComparison()
- Returns:
- comparison against which the groups has been built.
- Since:
- 4.1
-
dispose
public void dispose()
Dispose this difference group provider.- Specified by:
disposein interfaceIDifferenceGroupProvider- Since:
- 4.1
- See Also:
IDifferenceGroupProvider.dispose()
-
-