public class BasicDifferenceGroupImpl extends AdapterImpl implements IDifferenceGroup
IDifferenceGroup
uses a predicate to filter the whole list of differences.
This can be subclasses or used directly instead of IDifferenceGroup
.
Modifier and Type | Class and Description |
---|---|
protected static class |
BasicDifferenceGroupImpl.ChildrenSide
An enum that represents, for a given diff, the accepted side(s) for its children and provides utilty
methods to manage sides.
|
Adapter.Internal
Modifier and Type | Field and Description |
---|---|
protected List<TreeNode> |
children
The list of children of this group.
|
protected static com.google.common.base.Function<EObject,Iterator<EObject>> |
E_ALL_CONTENTS
Function that returns all contents of the given EObject.
|
protected Set<Diff> |
extensionDiffProcessed
The list of already processed refined diffs.
|
protected com.google.common.base.Predicate<? super Diff> |
filter
The filter we'll use in order to filter the differences that are part of this group.
|
protected Image |
image
The icon that the EMF Compare UI will display for this group.
|
protected String |
name
The name that the EMF Compare UI will display for this group.
|
target
TREE_NODE_DATA
Constructor and Description |
---|
BasicDifferenceGroupImpl(Comparison comparison,
com.google.common.base.Predicate<? super Diff> filter,
ECrossReferenceAdapter crossReferenceAdapter)
Instantiates this group given the comparison and filter that should be used in order to determine its
list of differences.
|
BasicDifferenceGroupImpl(Comparison comparison,
com.google.common.base.Predicate<? super Diff> filter,
String name,
ECrossReferenceAdapter crossReferenceAdapter)
Instantiates this group given the comparison and filter that should be used in order to determine its
list of differences.
|
BasicDifferenceGroupImpl(Comparison comparison,
com.google.common.base.Predicate<? super Diff> filter,
String name,
Image image,
ECrossReferenceAdapter crossReferenceAdapter)
Instantiates this group given the comparison and filter that should be used in order to determine its
list of differences.
|
Modifier and Type | Method and Description |
---|---|
List<TreeNode> |
buildContainmentSubTree(Match match) |
protected List<TreeNode> |
buildMatchResourceSubTrees() |
protected List<TreeNode> |
buildMatchSubTrees() |
void |
buildSubTree()
Builds the sub tree for this group.
|
protected List<TreeNode> |
buildSubTree(Match match,
boolean containment,
BasicDifferenceGroupImpl.ChildrenSide side)
Build the sub tree of the given
Match . |
List<TreeNode> |
buildSubTree(Match parentMatch,
Match match)
Build the sub tree of the given
Match . |
protected TreeNode |
buildSubTree(MatchResource matchResource,
Set<ResourceAttachmentChange> attachmentChanges)
Build the sub tree of the given
MatchResource . |
void |
dispose()
Dispose this group provider.
|
List<? extends TreeNode> |
getChildren()
The list of TreeNode containded in this group.
|
protected Comparison |
getComparison()
Returns the comparison object.
|
Image |
getImage()
The icon that is to be used for this group in the compare UI.
|
String |
getName()
A human-readable label for this group.
|
IStyledString.IComposedStyledString |
getStyledName()
The styled label for the this group.
|
boolean |
isAdapterForType(Object type) |
protected void |
registerCrossReferenceAdapter(List<? extends Notifier> notifiers)
Registers the CrossReferenceAdapter to all given notifiers.
|
protected void |
unregisterCrossReferenceAdapter(List<? extends Notifier> notifiers)
Unregisters the CrossReferenceAdapter from all given notifiers.
|
protected TreeNode |
wrap(EObject data)
Creates a TreeNode form the given EObject.
|
getTarget, notifyChanged, setTarget, unsetTarget
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getTarget, notifyChanged, setTarget
protected static final com.google.common.base.Function<EObject,Iterator<EObject>> E_ALL_CONTENTS
protected final com.google.common.base.Predicate<? super Diff> filter
protected final String name
protected final Image image
public BasicDifferenceGroupImpl(Comparison comparison, com.google.common.base.Predicate<? super Diff> filter, ECrossReferenceAdapter crossReferenceAdapter)
This will use the default name and icon for the group.
comparison
- The comparison that is the parent of this group.filter
- The filter we'll use in order to filter the differences that are part of this group.crossReferenceAdapter
- The cross reference adapter that will be added to this group's children.public BasicDifferenceGroupImpl(Comparison comparison, com.google.common.base.Predicate<? super Diff> filter, String name, ECrossReferenceAdapter crossReferenceAdapter)
comparison
- The comparison that is the parent of this group.filter
- The filter we'll use in order to filter the differences that are part of this group.name
- The name that the EMF Compare UI will display for this group.crossReferenceAdapter
- The cross reference adapter that will be added to this group's children.public BasicDifferenceGroupImpl(Comparison comparison, com.google.common.base.Predicate<? super Diff> filter, String name, Image image, ECrossReferenceAdapter crossReferenceAdapter)
comparison
- The comparison that is the parent of this group.filter
- The filter we'll use in order to filter the differences that are part of this group.name
- The name that the EMF Compare UI will display for this group.image
- The icon that the EMF Compare UI will display for this group.crossReferenceAdapter
- Updated upstream The cross reference adapter that will be added to this group's children.protected final Comparison getComparison()
public boolean isAdapterForType(Object type)
isAdapterForType
in interface Adapter
isAdapterForType
in class AdapterImpl
AdapterImpl.isAdapterForType(java.lang.Object)
public String getName()
getName
in interface IDifferenceGroup
IDifferenceGroup.getName()
public IStyledString.IComposedStyledString getStyledName()
getStyledName
in interface IDifferenceGroup
IDifferenceGroup.getStyledName()
public Image getImage()
getImage
in interface IDifferenceGroup
null
, a default image will
be used instead.IDifferenceGroup.getImage()
public List<? extends TreeNode> getChildren()
getChildren
in interface IDifferenceGroup
IDifferenceGroup.getChildren()
protected final void registerCrossReferenceAdapter(List<? extends Notifier> notifiers)
notifiers
- the list of notifiers.protected final void unregisterCrossReferenceAdapter(List<? extends Notifier> notifiers)
notifiers
- the list of notifiers.protected TreeNode buildSubTree(MatchResource matchResource, Set<ResourceAttachmentChange> attachmentChanges)
MatchResource
.matchResource
- the given MatchResource.public List<TreeNode> buildSubTree(Match parentMatch, Match match)
Match
.parentMatch
- the parent of the given Match.match
- the given Match.protected List<TreeNode> buildSubTree(Match match, boolean containment, BasicDifferenceGroupImpl.ChildrenSide side)
Match
.match
- the given Match.containment
- true if the current level represents a containment diff, false otherwise.side
- the accepted side(s) for children of current level.protected TreeNode wrap(EObject data)
data
- the given EObject.public void dispose()
dispose
in interface IDifferenceGroup
IDifferenceGroup.dispose()
public void buildSubTree()
Copyright (c) 2006, 2014 Obeo and others. All rights reserved.