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.
 
Adapter.Internal| Modifier and Type | Field and Description | 
|---|---|
| protected List<TreeNode> | childrenThe list of children of this group. | 
| protected static com.google.common.base.Function<EObject,Iterator<EObject>> | E_ALL_CONTENTSFunction that returns all contents of the given EObject. | 
| protected com.google.common.base.Predicate<? super Diff> | filterThe filter we'll use in order to filter the differences that are part of this group. | 
| protected org.eclipse.swt.graphics.Image | imageThe icon that the EMF Compare UI will display for this group. | 
| protected String | nameThe name that the EMF Compare UI will display for this group. | 
targetTREE_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,
                        org.eclipse.swt.graphics.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 | 
|---|---|
| protected void | addDiffNode(MatchNode matchNode,
           Diff diff)Add the diff in the given match. | 
| protected List<TreeNode> | buildMatchResourceTrees() | 
| protected List<TreeNode> | buildMatchTrees()Compute a subTree for each root match of the comparison. | 
| void | buildSubTree()Builds the sub tree for this group. | 
| protected MatchResourceNode | buildSubTree(MatchResource matchResource,
            Set<ResourceAttachmentChange> attachmentChanges)Build the sub tree of the given  MatchResource. | 
| protected MatchNode | buildTree(Match match)Compute a tree for the given match. | 
| protected List<TreeNode> | createChildren()This creates the root-level children of the group. | 
| protected ConflictNode | createConflictNode(Conflict conflict)Create a conflict node. | 
| protected DiffNode | createDiffNode(Diff diff)Create a diff node. | 
| protected MatchNode | createMatchNode(Match match)Create a match node. | 
| protected MatchResourceNode | createMatchResourceNode(MatchResource matchResource)Create a matchResource node. | 
| protected void | customize(List<? extends TreeNode> nodes)Walk the given trees and customize each node in the tree, starting by the deeper nodes all the way up
 to the root nodes. | 
| protected void | customize(TreeNode treeNode)Allow extenders to customize a TreeNode. | 
| void | dispose()Dispose this group provider. | 
| protected void | doBuildSubTrees()Perform the creation of the sub-trees of the group. | 
| List<? extends TreeNode> | getChildren()The list of TreeNode containded in this group. | 
| protected Comparison | getComparison()Returns the comparison object. | 
| org.eclipse.swt.graphics.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. | 
| protected Match | getTargetMatch(Diff diff)Provide the Match that should directly contain the given diff. | 
| protected void | handleRefiningDiffs(DiffNode diffNode)Handle the diffs that refine the given diff. | 
| boolean | isAdapterForType(Object type) | 
| protected boolean | isContainmentRefChange(Diff diff)Is it a containment reference change? | 
| protected boolean | mustDisplayAsDirectChildOfMatch(Diff diff)Does the given difference have to be displayed as direct child of a Match? | 
| protected void | populateMatchNode(MatchNode matchNode)Build the subtree for the given match. | 
| 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. | 
getTarget, notifyChanged, setTarget, unsetTargetclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetTarget, notifyChanged, setTargetprotected 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 org.eclipse.swt.graphics.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, org.eclipse.swt.graphics.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 AdapterisAdapterForType in class AdapterImplAdapterImpl.isAdapterForType(java.lang.Object)public String getName()
getName in interface IDifferenceGroupIDifferenceGroup.getName()public IStyledString.IComposedStyledString getStyledName()
getStyledName in interface IDifferenceGroupIDifferenceGroup.getStyledName()public org.eclipse.swt.graphics.Image getImage()
getImage in interface IDifferenceGroupnull, a default image will
         be used instead.IDifferenceGroup.getImage()public List<? extends TreeNode> getChildren()
getChildren in interface IDifferenceGroupIDifferenceGroup.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.public void dispose()
dispose in interface IDifferenceGroupIDifferenceGroup.dispose()public void buildSubTree()
protected void doBuildSubTrees()
protected List<TreeNode> createChildren()
protected List<TreeNode> buildMatchTrees()
protected MatchNode buildTree(Match match)
match - The given matchnullprotected void populateMatchNode(MatchNode matchNode)
matchNode - The root matchNodeprotected Match getTargetMatch(Diff diff)
null. For a given strategy, a diff should only be
 displayed in the same Match (i.e. the DiffNodes that represent the diff should always be
 children of the MatchNodes that represent the returned Match.diff - The differencenull.protected boolean mustDisplayAsDirectChildOfMatch(Diff diff)
diff - The difftrue if the diff's node should be a child of a MatchNode.protected boolean isContainmentRefChange(Diff diff)
diff - The difftrue if the diff is a ReferenceChange whose EReference is a
         containment reference.protected MatchResourceNode buildSubTree(MatchResource matchResource, Set<ResourceAttachmentChange> attachmentChanges)
MatchResource.matchResource - the given MatchResource.protected void addDiffNode(MatchNode matchNode, Diff diff)
matchNode - The given match nodediff - The diff to addprotected DiffNode createDiffNode(Diff diff)
diff - The given diffprotected MatchNode createMatchNode(Match match)
match - The given matchprotected ConflictNode createConflictNode(Conflict conflict)
conflict - The given conflictprotected MatchResourceNode createMatchResourceNode(MatchResource matchResource)
matchResource - The given matchResourceprotected void customize(List<? extends TreeNode> nodes)
nodes - The list of nodes to customize.protected void customize(TreeNode treeNode)
treeNode - the TreeNode to customize.protected void handleRefiningDiffs(DiffNode diffNode)
diffNode - The diff node to handle, which is not necessarily a child of a MatchNode since this method
            is called recursively.
Copyright (c) 2006, 2015 Obeo and others. All rights reserved.