Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaël Barbero2013-10-13 11:11:25 -0400
committerMikaël Barbero2013-10-18 13:47:52 -0400
commit5ce62c3f83a783c311c9df03362123cc1d1f39d6 (patch)
tree11ebda59968732fee354e7090486e34b1f24d09b /plugins/org.eclipse.emf.compare.ide.ui/src
parent6bb3738a89c001e0258e7f77ec90d0e458b9a099 (diff)
downloadorg.eclipse.emf.compare-5ce62c3f83a783c311c9df03362123cc1d1f39d6.tar.gz
org.eclipse.emf.compare-5ce62c3f83a783c311c9df03362123cc1d1f39d6.tar.xz
org.eclipse.emf.compare-5ce62c3f83a783c311c9df03362123cc1d1f39d6.zip
Factorize out the cache of the computation of required differences.
Diffstat (limited to 'plugins/org.eclipse.emf.compare.ide.ui/src')
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/AbstractStructuredViewerWrapper.java127
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/DependencyData.java160
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeRuler.java144
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeViewer.java114
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java78
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/IWrappableStructuredViewer.java701
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/Navigatable.java24
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/WrappableTreeViewer.java1070
8 files changed, 2040 insertions, 378 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/AbstractStructuredViewerWrapper.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/AbstractStructuredViewerWrapper.java
index 647c6a27d..b74e08fb4 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/AbstractStructuredViewerWrapper.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/AbstractStructuredViewerWrapper.java
@@ -24,7 +24,6 @@ import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.viewers.ViewerSorter;
@@ -32,7 +31,6 @@ import org.eclipse.swt.dnd.DragSourceListener;
import org.eclipse.swt.dnd.DropTargetListener;
import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.HelpEvent;
import org.eclipse.swt.events.HelpListener;
import org.eclipse.swt.widgets.Composite;
@@ -43,7 +41,7 @@ import org.eclipse.swt.widgets.Widget;
/**
* @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
*/
-public abstract class AbstractStructuredViewerWrapper<C extends Control, V extends StructuredViewer> extends StructuredViewer {
+public abstract class AbstractStructuredViewerWrapper<C extends Control, V extends IWrappableStructuredViewer> extends StructuredViewer {
/** The wrapped Viewer. */
private final V fViewer;
@@ -112,8 +110,8 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
fWrappedViewerPostSelectionChangedListener = new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
- fireSelectionChanged(new SelectionChangedEvent(AbstractStructuredViewerWrapper.this, event
- .getSelection()));
+ firePostSelectionChanged(new SelectionChangedEvent(AbstractStructuredViewerWrapper.this,
+ event.getSelection()));
}
};
fViewer.addPostSelectionChangedListener(fWrappedViewerPostSelectionChangedListener);
@@ -136,15 +134,6 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
return fConfiguration;
}
- @Override
- protected final void hookControl(Control control) {
- control.addDisposeListener(new DisposeListener() {
- public void widgetDisposed(DisposeEvent event) {
- handleDispose(event);
- }
- });
- }
-
/**
*
*/
@@ -172,36 +161,6 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
}
/**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.ContentViewer#getInput()
- */
- @Override
- public final Object getInput() {
- return super.getInput();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.StructuredViewer#getSelection()
- */
- @Override
- public final ISelection getSelection() {
- return fViewer.getSelection();
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.StructuredViewer#setSelection(ISelection, boolean)
- */
- @Override
- public final void setSelection(ISelection selection, boolean reveal) {
- fViewer.setSelection(selection, reveal);
- }
-
- /**
* Returns the {@link StructuredViewer} associated with this wrapper.
*
* @return a StructuredViewer.
@@ -267,22 +226,11 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
/**
* {@inheritDoc}
*
- * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(org.eclipse.jface.viewers.ViewerFilter)
- */
- @Override
- public final void addFilter(ViewerFilter filter) {
- fViewer.addFilter(filter);
- super.addFilter(filter);
- }
-
- /**
- * {@inheritDoc}
- *
* @see org.eclipse.jface.viewers.StructuredViewer#doFindInputItem(java.lang.Object)
*/
@Override
protected final Widget doFindInputItem(Object element) {
- throw new UnsupportedOperationException();
+ return fViewer.doFindInputItem(element);
}
/**
@@ -292,7 +240,7 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
*/
@Override
protected final Widget doFindItem(Object element) {
- throw new UnsupportedOperationException();
+ return fViewer.doFindInputItem(element);
}
/**
@@ -302,8 +250,8 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
* java.lang.Object, boolean)
*/
@Override
- protected void doUpdateItem(Widget item, Object element, boolean fullMap) {
- throw new UnsupportedOperationException();
+ protected final void doUpdateItem(Widget item, Object element, boolean fullMap) {
+ fViewer.doUpdateItem(item, element, fullMap);
}
/**
@@ -319,6 +267,17 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
/**
* {@inheritDoc}
*
+ * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(org.eclipse.jface.viewers.ViewerFilter)
+ */
+ @Override
+ public final void addFilter(ViewerFilter filter) {
+ fViewer.addFilter(filter);
+ super.addFilter(filter);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
* @see org.eclipse.jface.viewers.StructuredViewer#getFilters()
*/
@Override
@@ -365,7 +324,7 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
* @see org.eclipse.jface.viewers.StructuredViewer#reveal(java.lang.Object)
*/
@Override
- public void reveal(Object element) {
+ public final void reveal(Object element) {
fViewer.reveal(element);
}
@@ -376,8 +335,8 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
*/
@SuppressWarnings("rawtypes")
@Override
- protected List getSelectionFromWidget() {
- throw new UnsupportedOperationException();
+ protected final List getSelectionFromWidget() {
+ return fViewer.getSelectionFromWidget();
}
/**
@@ -407,16 +366,7 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
*/
@Override
protected final void setSelectionToWidget(List l, boolean reveal) {
-
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.StructuredViewer#updateSelection(org.eclipse.jface.viewers.ISelection)
- */
- @Override
- protected void updateSelection(ISelection selection) {
+ fViewer.setSelectionToWidget(l, reveal);
}
/**
@@ -426,8 +376,8 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
* org.eclipse.jface.viewers.ISelection)
*/
@Override
- protected void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) {
- throw new UnsupportedOperationException();
+ protected final void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) {
+ fViewer.handleInvalidSelection(invalidSelection, newSelection);
}
/**
@@ -468,33 +418,11 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
* @see org.eclipse.jface.viewers.StructuredViewer#setComparer(org.eclipse.jface.viewers.IElementComparer)
*/
@Override
- public void setComparer(IElementComparer comparer) {
+ public final void setComparer(IElementComparer comparer) {
fViewer.setComparer(comparer);
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.StructuredViewer#update(java.lang.Object[], java.lang.String[])
- */
- @Override
- public void update(Object[] elements, String[] properties) {
- fViewer.update(elements, properties);
- super.update(elements, properties);
- }
-
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.jface.viewers.StructuredViewer#update(java.lang.Object, java.lang.String[])
- */
- @Override
- public final void update(Object element, String[] properties) {
- fViewer.update(element, properties);
- super.update(element, properties);
- }
-
- public static final class ControlAndViewer<C extends Control, V extends Viewer> {
+ public static final class ControlAndViewer<C extends Control, V extends IWrappableStructuredViewer> {
private final C control;
private final V viewer;
@@ -518,7 +446,8 @@ public abstract class AbstractStructuredViewerWrapper<C extends Control, V exten
return viewer;
}
- public static <C extends Control, V extends Viewer> ControlAndViewer<C, V> create(C control, V viewer) {
+ public static <C extends Control, V extends IWrappableStructuredViewer> ControlAndViewer<C, V> create(
+ C control, V viewer) {
return new ControlAndViewer<C, V>(control, viewer);
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/DependencyData.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/DependencyData.java
new file mode 100644
index 000000000..7c62d5830
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/DependencyData.java
@@ -0,0 +1,160 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;
+
+import static com.google.common.base.Predicates.notNull;
+import static com.google.common.collect.Iterables.addAll;
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.transform;
+import static com.google.common.collect.Lists.newArrayList;
+import static com.google.common.collect.Sets.newHashSet;
+
+import com.google.common.collect.HashMultimap;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Multimap;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.internal.merge.MergeMode;
+import org.eclipse.emf.compare.internal.utils.DiffUtil;
+import org.eclipse.emf.compare.rcp.ui.internal.configuration.IEMFCompareConfiguration;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+public class DependencyData {
+
+ private final IEMFCompareConfiguration compareConfiguration;
+
+ private Set<Diff> requires;
+
+ private Set<Diff> unmergeables;
+
+ private WrappableTreeViewer treeViewer;
+
+ /** A map that links a diff with tree items. */
+ private Multimap<Diff, TreeItem> diffToItemsMappings;
+
+ public DependencyData(IEMFCompareConfiguration compareConfiguration) {
+ this.compareConfiguration = compareConfiguration;
+ requires = newHashSet();
+ unmergeables = newHashSet();
+ diffToItemsMappings = HashMultimap.create();
+ }
+
+ /**
+ * @param treeViewer
+ * the treeViewer to set
+ */
+ void setTreeViewer(WrappableTreeViewer treeViewer) {
+ this.treeViewer = treeViewer;
+ }
+
+ /**
+ * @param selection
+ */
+ public void updateDependencies(ISelection selection) {
+ Iterable<Diff> selectedDiffs = filter(getSelectedComparisonObjects(selection), Diff.class);
+
+ MergeMode mergePreviewMode = compareConfiguration.getMergePreviewMode();
+ boolean leftEditable = compareConfiguration.isLeftEditable();
+ boolean rightEditable = compareConfiguration.isRightEditable();
+ boolean leftToRigh = mergePreviewMode.isLeftToRight(leftEditable, rightEditable);
+
+ requires = newHashSet();
+ unmergeables = newHashSet();
+ for (Diff diff : selectedDiffs) {
+ addAll(requires, DiffUtil.getRequires(diff, leftToRigh));
+ addAll(unmergeables, DiffUtil.getUnmergeables(diff, leftToRigh));
+ }
+ }
+
+ public void updateTreeItemMappings() {
+ diffToItemsMappings = HashMultimap.create();
+
+ Tree tree = treeViewer.getTree();
+
+ TreeItem[] children = tree.getItems();
+ // item with non created children has a fake child item with null data.
+ if (children.length > 0 && children[0].getData() == null) {
+ treeViewer.createChildren(tree);
+ }
+
+ for (TreeItem item : tree.getItems()) {
+ associateTreeItem(item);
+ }
+ }
+
+ /**
+ * Maps, if necessary, the given tree item and all his children with the given list of diffs.
+ *
+ * @param item
+ * the given tree item.
+ * @param diffs
+ * the given list of diffs.
+ */
+ private void associateTreeItem(TreeItem item) {
+ Object itemData = item.getData();
+ EObject eObject = EMFCompareStructureMergeViewer.getDataOfTreeNodeOfAdapter(itemData);
+
+ if (eObject instanceof Diff) {
+ diffToItemsMappings.put((Diff)eObject, item);
+ }
+
+ TreeItem[] children = item.getItems();
+ // item with non created children has a fake child item with null data.
+ if (children.length > 0 && children[0].getData() == null) {
+ treeViewer.createChildren(item);
+ }
+
+ for (TreeItem child : item.getItems()) {
+ associateTreeItem(child);
+ }
+ }
+
+ private static List<EObject> getSelectedComparisonObjects(ISelection selection) {
+ List<EObject> ret = newArrayList();
+ if (selection instanceof IStructuredSelection) {
+ List<?> selectedObjects = ((IStructuredSelection)selection).toList();
+ Iterable<EObject> data = transform(selectedObjects,
+ EMFCompareStructureMergeViewer.ADAPTER__TARGET__DATA);
+ Iterable<EObject> notNullData = Iterables.filter(data, notNull());
+ addAll(ret, notNullData);
+ }
+ return ret;
+ }
+
+ /**
+ * @return the requires
+ */
+ public Set<Diff> getRequires() {
+ return requires;
+ }
+
+ /**
+ * @return the unmergeables
+ */
+ public Set<Diff> getUnmergeables() {
+ return unmergeables;
+ }
+
+ public Collection<TreeItem> getTreeItems(Diff diff) {
+ return diffToItemsMappings.get(diff);
+ }
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeRuler.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeRuler.java
index fe3466598..1cd845c08 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeRuler.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeRuler.java
@@ -10,36 +10,16 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;
-import static com.google.common.collect.Iterables.filter;
-
-import com.google.common.base.Predicate;
-import com.google.common.collect.HashMultimap;
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import com.google.common.collect.Multimap;
-import com.google.common.collect.Sets;
-import java.util.Collection;
import java.util.LinkedList;
-import java.util.List;
import java.util.Map;
-import java.util.Set;
import org.eclipse.core.runtime.Assert;
-import org.eclipse.emf.common.notify.Adapter;
-import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.compare.Diff;
-import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
-import org.eclipse.emf.compare.internal.merge.MergeMode;
-import org.eclipse.emf.compare.internal.utils.DiffUtil;
-import org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.filters.IDifferenceFilter;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.edit.tree.TreeNode;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.TreePath;
-import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.MouseEvent;
import org.eclipse.swt.events.MouseListener;
@@ -73,7 +53,7 @@ public class EMFCompareDiffTreeRuler extends Canvas {
private static final int ANNOTATION_HEIGHT = 5;
/** The TreeViewer associated with this Treeruler. */
- private final TreeViewer fTreeViewer;
+ private final WrappableTreeViewer fTreeViewer;
/** The color a required diff. */
private final Color requiredDiffFillColor;
@@ -90,15 +70,6 @@ public class EMFCompareDiffTreeRuler extends Canvas {
/** The width of this tree ruler. */
private final int fWidth;
- /** The list of required Diff that need to be shown in the TreeRuler. */
- private Set<Diff> requires;
-
- /** The list of unmergeables Diff that need to be shown in the TreeRuler. */
- private Set<Diff> unmergeables;
-
- /** A map that links a diff with tree items. */
- private Multimap<Diff, TreeItem> diffItems;
-
/** A map that links a rectangle with a tree item. */
private Map<Rectangle, TreeItem> annotationsData;
@@ -117,7 +88,7 @@ public class EMFCompareDiffTreeRuler extends Canvas {
/** The last cursor used. */
private Cursor lastCursor;
- private final EMFCompareConfiguration compareConfiguration;
+ private final DependencyData dependencyData;
/**
* Constructor.
@@ -133,12 +104,12 @@ public class EMFCompareDiffTreeRuler extends Canvas {
* @param config
* the configuration for this control.
*/
- EMFCompareDiffTreeRuler(Composite parent, int style, int width, TreeViewer treeViewer,
- EMFCompareConfiguration config) {
+ EMFCompareDiffTreeRuler(Composite parent, int style, int width, WrappableTreeViewer treeViewer,
+ DependencyData dependencyData) {
super(parent, style);
fWidth = width;
fTreeViewer = treeViewer;
- this.compareConfiguration = config;
+ this.dependencyData = dependencyData;
requiredDiffFillColor = JFaceResources.getColorRegistry().get(
EMFCompareDiffTreeViewer.REQUIRED_DIFF_COLOR);
@@ -149,9 +120,6 @@ public class EMFCompareDiffTreeRuler extends Canvas {
unmergeableDiffBorderColor = JFaceResources.getColorRegistry().get(
EMFCompareDiffTreeViewer.UNMERGEABLE_DIFF_BORDER_COLOR);
- requires = Sets.newHashSet();
- unmergeables = Sets.newHashSet();
- diffItems = HashMultimap.create();
annotationsData = Maps.newHashMap();
paintListener = new PaintListener() {
@@ -203,72 +171,6 @@ public class EMFCompareDiffTreeRuler extends Canvas {
}
/**
- * Compute consequences (required and unmergeable differences).
- */
- public void computeConsequences(Object object) {
- clearAllData();
- if (object instanceof Diff) {
- Diff diff = (Diff)object;
- MergeMode mergePreviewMode = compareConfiguration.getMergePreviewMode();
- boolean leftToRigh = mergePreviewMode.isLeftToRight(compareConfiguration.isLeftEditable(),
- compareConfiguration.isRightEditable());
- requires = DiffUtil.getRequires(diff, leftToRigh);
- unmergeables = DiffUtil.getUnmergeables(diff, leftToRigh);
- associateTreeItems(Lists.newLinkedList(Iterables.concat(requires, unmergeables)));
- }
- }
-
- /**
- * Maps tree items with the given list of diffs.
- *
- * @param diffs
- * the given list of diffs.
- */
- private void associateTreeItems(List<Diff> diffs) {
- Tree tree = fTreeViewer.getTree();
- if (fTreeViewer instanceof EMFCompareDiffTreeViewer) {
- // ((EMFCompareDiffTreeViewer)fTreeViewer).createChildrenSilently(tree);
- }
- for (TreeItem item : tree.getItems()) {
- associateTreeItem(item, diffs);
- }
- }
-
- /**
- * Maps, if necessary, the given tree item and all his children with the given list of diffs.
- *
- * @param item
- * the given tree item.
- * @param diffs
- * the given list of diffs.
- */
- private void associateTreeItem(TreeItem item, List<Diff> diffs) {
- Object data = item.getData();
- if (data instanceof Adapter) {
- Notifier target = ((Adapter)data).getTarget();
- if (target instanceof TreeNode) {
- EObject treeNodeData = ((TreeNode)target).getData();
- if (diffs.contains(treeNodeData)) {
- diffItems.put((Diff)treeNodeData, item);
- }
- }
- }
- for (TreeItem child : item.getItems()) {
- associateTreeItem(child, diffs);
- }
- }
-
- /**
- * Clear all data.
- */
- private void clearAllData() {
- requires.clear();
- unmergeables.clear();
- diffItems.clear();
- annotationsData.clear();
- }
-
- /**
* Handles the dispose event on this control.
*/
public void handleDispose() {
@@ -286,17 +188,13 @@ public class EMFCompareDiffTreeRuler extends Canvas {
*/
private void handlePaintEvent(PaintEvent e) {
annotationsData.clear();
- Predicate<? super EObject> predicate = compareConfiguration.getStructureMergeViewerFilter()
- .getAggregatedPredicate();
- Collection<? extends Diff> filteredRequires = filteredDiffs(requires, predicate);
- Collection<? extends Diff> filteredUnmergeables = filteredDiffs(unmergeables, predicate);
- for (Diff diff : filteredRequires) {
- for (TreeItem item : diffItems.get(diff)) {
+ for (Diff diff : dependencyData.getRequires()) {
+ for (TreeItem item : dependencyData.getTreeItems(diff)) {
createAnnotation(e, diff, item, requiredDiffFillColor, requiredDiffBorderColor);
}
}
- for (Diff diff : filteredUnmergeables) {
- for (TreeItem item : diffItems.get(diff)) {
+ for (Diff diff : dependencyData.getUnmergeables()) {
+ for (TreeItem item : dependencyData.getTreeItems(diff)) {
createAnnotation(e, diff, item, unmergeableDiffFillColor, unmergeableDiffBorderColor);
}
}
@@ -386,7 +284,11 @@ public class EMFCompareDiffTreeRuler extends Canvas {
int yMin = Math.abs(item.getParent().getItems()[0].getBounds().y);
int yMax = getLastVisibleItem().getBounds().y;
int realYMax = yMax + yMin;
- y = (y + yMin) * yRuler / realYMax;
+ if (realYMax > 0) {
+ y = (y + yMin) * yRuler / realYMax;
+ } else {
+ y = (y + yMin) * yRuler;
+ }
if (y + Y_OFFSET + ANNOTATION_HEIGHT > yRuler) {
y = yRuler - Y_OFFSET - ANNOTATION_HEIGHT;
}
@@ -578,22 +480,4 @@ public class EMFCompareDiffTreeRuler extends Canvas {
}
return lastVisibleItem;
}
-
- /**
- * From a list of {@link Diff}s, returns the diffs which are not filtered by a filter of the given list of
- * {@link IDifferenceFilter}.
- *
- * @param unfilteredDiffs
- * the given list of unfiltered diffs.
- * @param filters
- * the given list of IDifferenceFilter.
- * @return A filtered list of diffs.
- */
- protected Collection<? extends Diff> filteredDiffs(Collection<? extends Diff> unfilteredDiffs,
- Predicate<? super EObject> filters) {
- if (filters != null) {
- return ImmutableList.copyOf(filter(unfilteredDiffs, filters));
- }
- return ImmutableList.of();
- }
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeViewer.java
index 8c0d9e6d0..c493f78d4 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareDiffTreeViewer.java
@@ -10,28 +10,19 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;
-import com.google.common.base.Predicate;
-
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Set;
-import org.eclipse.compare.structuremergeviewer.DiffTreeViewer;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.compare.Conflict;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceSource;
-import org.eclipse.emf.compare.ide.ui.internal.configuration.EMFCompareConfiguration;
-import org.eclipse.emf.compare.internal.merge.MergeMode;
-import org.eclipse.emf.compare.internal.utils.DiffUtil;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.tree.TreeNode;
import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.graphics.Color;
@@ -43,12 +34,11 @@ import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.swt.widgets.Widget;
/**
* @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
*/
-public class EMFCompareDiffTreeViewer extends DiffTreeViewer {
+public class EMFCompareDiffTreeViewer extends WrappableTreeViewer {
public static final String REQUIRED_DIFF_COLOR = "RequiredDiffColor"; //$NON-NLS-1$
@@ -62,15 +52,18 @@ public class EMFCompareDiffTreeViewer extends DiffTreeViewer {
private final Color unmergeableDiffColor;
- private Listener fEraseItemListener;
+ private final Listener fEraseItemListener;
+
+ private final DependencyData dependencyData;
/**
* @param parent
* @param adapterFactory
* @param configuration
*/
- public EMFCompareDiffTreeViewer(Composite parent, EMFCompareConfiguration configuration) {
- super(parent, configuration);
+ public EMFCompareDiffTreeViewer(Composite parent, DependencyData dependencyData) {
+ super(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
+ this.dependencyData = dependencyData;
fEraseItemListener = new Listener() {
public void handleEvent(Event event) {
@@ -91,47 +84,9 @@ public class EMFCompareDiffTreeViewer extends DiffTreeViewer {
}
/**
- * A predicate that checks if the given input is a TreeNode that contains a diff.
- *
- * @return true, if the given input is a TreeNode that contains a diff, false otherwise.
- */
- static Predicate<EObject> IS_DIFF_TREE_NODE = new Predicate<EObject>() {
- public boolean apply(EObject t) {
- return t instanceof TreeNode && ((TreeNode)t).getData() instanceof Diff;
- }
- };
-
- /**
* {@inheritDoc}
*
- * @see org.eclipse.jface.viewers.StructuredViewer#getComparator()
- */
- @Override
- public ViewerComparator getComparator() {
- return null;
- }
-
- public void createChildrenSilently() {
- createChildrenSilently(getTree());
- }
-
- private void createChildrenSilently(Object o) {
- if (o instanceof Tree) {
- createChildren((Widget)o);
- for (TreeItem item : ((Tree)o).getItems()) {
- createChildrenSilently(item);
- }
- } else if (o instanceof TreeItem) {
- createChildren((Widget)o);
- for (TreeItem item : ((TreeItem)o).getItems()) {
- createChildrenSilently(item);
- }
- }
- }
-
- /*
- * (non-Javadoc)
- * @see org.eclipse.jface.viewers.AbstractTreeViewer#isExpandable(java.lang.Object)
+ * @see org.eclipse.jface.viewers.TreeViewer#isExpandable(java.lang.Object)
*/
@Override
public boolean isExpandable(Object parent) {
@@ -148,7 +103,7 @@ public class EMFCompareDiffTreeViewer extends DiffTreeViewer {
* @see org.eclipse.compare.structuremergeviewer.DiffTreeViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
*/
@Override
- protected void handleDispose(DisposeEvent event) {
+ public void handleDispose(DisposeEvent event) {
getControl().removeListener(SWT.EraseItem, fEraseItemListener);
super.handleDispose(event);
}
@@ -159,7 +114,7 @@ public class EMFCompareDiffTreeViewer extends DiffTreeViewer {
* @see org.eclipse.jface.viewers.AbstractTreeViewer#getSortedChildren(java.lang.Object)
*/
@Override
- protected Object[] getSortedChildren(Object parentElementOrTreePath) {
+ public Object[] getSortedChildren(Object parentElementOrTreePath) {
Object[] result = super.getSortedChildren(parentElementOrTreePath);
if (parentElementOrTreePath instanceof Adapter) {
Notifier target = ((Adapter)parentElementOrTreePath).getTarget();
@@ -204,36 +159,16 @@ public class EMFCompareDiffTreeViewer extends DiffTreeViewer {
* the erase item event.
*/
protected void handleEraseItemEvent(Event event) {
- ISelection selection = getSelection();
- Object firstElement = ((IStructuredSelection)selection).getFirstElement();
- if (firstElement instanceof Adapter) {
- Notifier target = ((Adapter)firstElement).getTarget();
- if (target instanceof TreeNode) {
- EObject selectionData = ((TreeNode)target).getData();
- if (selectionData instanceof Diff) {
- TreeItem item = (TreeItem)event.item;
- Object dataTreeItem = item.getData();
- if (dataTreeItem instanceof Adapter) {
- Notifier targetItem = ((Adapter)dataTreeItem).getTarget();
- if (targetItem instanceof TreeNode) {
- EObject dataItem = ((TreeNode)targetItem).getData();
- MergeMode mergePreviewMode = getCompareConfiguration().getMergePreviewMode();
- boolean leftEditable = getCompareConfiguration().isLeftEditable();
- boolean rightEditable = getCompareConfiguration().isRightEditable();
- Diff selectedDiff = (Diff)selectionData;
- boolean leftToRight = mergePreviewMode.isLeftToRight(leftEditable, rightEditable);
- final Set<Diff> requires = DiffUtil.getRequires(selectedDiff, leftToRight);
- final Set<Diff> unmergeables = DiffUtil
- .getUnmergeables(selectedDiff, leftToRight);
- final GC g = event.gc;
- if (requires.contains(dataItem)) {
- paintItemBackground(g, item, requiredDiffColor);
- } else if (unmergeables.contains(dataItem)) {
- paintItemBackground(g, item, unmergeableDiffColor);
- }
- }
- }
- }
+ TreeItem item = (TreeItem)event.item;
+ EObject dataItem = EMFCompareStructureMergeViewer.getDataOfTreeNodeOfAdapter(item.getData());
+ if (dataItem != null) {
+ final Set<Diff> requires = dependencyData.getRequires();
+ final Set<Diff> unmergeables = dependencyData.getUnmergeables();
+ final GC g = event.gc;
+ if (requires.contains(dataItem)) {
+ paintItemBackground(g, item, requiredDiffColor);
+ } else if (unmergeables.contains(dataItem)) {
+ paintItemBackground(g, item, unmergeableDiffColor);
}
}
}
@@ -257,13 +192,4 @@ public class EMFCompareDiffTreeViewer extends DiffTreeViewer {
g.fillRectangle(areaBounds.x, itemBounds.y, areaBounds.width, itemBounds.height);
}
- /**
- * {@inheritDoc}
- *
- * @see org.eclipse.compare.structuremergeviewer.DiffTreeViewer#getCompareConfiguration()
- */
- @Override
- public EMFCompareConfiguration getCompareConfiguration() {
- return (EMFCompareConfiguration)super.getCompareConfiguration();
- }
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
index a0e6a6ce2..193f0d4b9 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java
@@ -10,21 +10,15 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;
-import static com.google.common.base.Predicates.notNull;
-import static com.google.common.collect.Iterables.addAll;
import static com.google.common.collect.Iterables.getFirst;
-import static com.google.common.collect.Iterables.transform;
-import static com.google.common.collect.Lists.newArrayList;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
-import com.google.common.collect.Iterables;
import com.google.common.eventbus.Subscribe;
import java.util.Collection;
import java.util.EventObject;
import java.util.Iterator;
-import java.util.List;
import org.eclipse.compare.CompareUI;
import org.eclipse.compare.CompareViewerPane;
@@ -82,14 +76,11 @@ import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory
import org.eclipse.emf.edit.tree.TreeFactory;
import org.eclipse.emf.edit.tree.TreeNode;
import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.ITreeViewerListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeExpansionEvent;
-import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.layout.GridData;
@@ -103,7 +94,7 @@ import org.eclipse.ui.actions.ActionFactory;
*
* @author <a href="mailto:axel.richard@obeo.fr">Axel Richard</a>
*/
-public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrapper<Composite, TreeViewer> implements CommandStackListener {
+public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrapper<Composite, WrappableTreeViewer> implements CommandStackListener {
/** The width of the tree ruler. */
private static final int TREE_RULER_WIDTH = 17;
@@ -136,6 +127,8 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
*/
private boolean resourcesShouldBeUnload;
+ private DependencyData dependencyData;
+
private ISelectionChangedListener selectionChangeListener;
private final Job inputChangedTask = new Job("Compute Model Differences") {
@@ -183,11 +176,11 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
fHandlerService = CompareHandlerService.createFor(getCompareConfiguration().getContainer(),
getControl().getShell());
+ setContentProvider(new EMFCompareStructureMergeViewerContentProvider(getCompareConfiguration()
+ .getAdapterFactory()));
setLabelProvider(new DelegatingStyledCellLabelProvider(
new EMFCompareStructureMergeViewerLabelProvider(
getCompareConfiguration().getAdapterFactory(), this)));
- setContentProvider(new EMFCompareStructureMergeViewerContentProvider(getCompareConfiguration()
- .getAdapterFactory()));
undoAction = new UndoAction(null);
redoAction = new RedoAction(null);
@@ -203,7 +196,6 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
*/
@Override
protected void preHookCreateControlAndViewer() {
- super.preHookCreateControlAndViewer();
fAdapterFactory = new ComposedAdapterFactory(EMFCompareRCPPlugin.getDefault()
.getAdapterFactoryRegistry());
@@ -212,6 +204,8 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
fAdapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
getCompareConfiguration().setAdapterFactory(fAdapterFactory);
+
+ dependencyData = new DependencyData(getCompareConfiguration());
}
/**
@@ -222,7 +216,7 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
* CompareConfiguration)
*/
@Override
- protected ControlAndViewer<Composite, TreeViewer> createControlAndViewer(Composite parent) {
+ protected ControlAndViewer<Composite, WrappableTreeViewer> createControlAndViewer(Composite parent) {
Composite control = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
@@ -233,7 +227,8 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
GridData data = new GridData(SWT.FILL, SWT.FILL, true, true);
control.setLayout(layout);
control.setLayoutData(data);
- final TreeViewer treeViewer = new EMFCompareDiffTreeViewer(control, getCompareConfiguration());
+ final WrappableTreeViewer treeViewer = new EMFCompareDiffTreeViewer(control, dependencyData);
+ dependencyData.setTreeViewer(treeViewer);
INavigatable nav = new Navigatable(fAdapterFactory, treeViewer);
control.setData(INavigatable.NAVIGATOR_PROPERTY, nav);
control.setData(CompareUI.COMPARE_VIEWER_TITLE, "Model differences");
@@ -242,7 +237,7 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
layoutData.widthHint = TREE_RULER_WIDTH;
layoutData.minimumWidth = TREE_RULER_WIDTH;
treeRuler = new EMFCompareDiffTreeRuler(control, SWT.NONE, layoutData.widthHint, treeViewer,
- getCompareConfiguration());
+ dependencyData);
treeRuler.setLayoutData(layoutData);
fCompareInputChangeListener = new ICompareInputChangeListener() {
@@ -310,7 +305,7 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
}
};
- private static EObject getDataOfTreeNodeOfAdapter(Object object) {
+ static EObject getDataOfTreeNodeOfAdapter(Object object) {
EObject data = null;
if (object instanceof Adapter) {
Notifier target = ((Adapter)object).getTarget();
@@ -321,7 +316,7 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
return data;
}
- private static final Function<Object, EObject> ADAPTER__TARGET__DATA = new Function<Object, EObject>() {
+ static final Function<Object, EObject> ADAPTER__TARGET__DATA = new Function<Object, EObject>() {
public EObject apply(Object object) {
return getDataOfTreeNodeOfAdapter(object);
}
@@ -329,7 +324,8 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
@Subscribe
public void mergePreviewModeChange(IMergePreviewModeChange event) {
- redrawFromSelection(getSelection());
+ dependencyData.updateDependencies(getSelection());
+ getControl().redraw();
}
@Subscribe
@@ -492,10 +488,10 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
public void run() {
// the tree has now a proper group provider and its input, so we can create the child
// silently.
- ((EMFCompareDiffTreeViewer)getViewer()).createChildrenSilently();
+ // ((EMFCompareDiffTreeViewer)getViewer()).createChildrenSilently();
- // title is not initialized as the comparison was set after the refresh caused by the
- // initialization of the viewer filters and the groupe providers.
+ // title is not initialized as the comparison was set in the configuration after the
+ // refresh caused by the initialization of the viewer filters and the groupe providers.
refreshTitle();
// XXX: fixme!!
@@ -651,37 +647,19 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
*/
@Override
protected void internalRefresh(Object element) {
- SWTUtil.safeSyncExec(new Runnable() {
- public void run() {
- getViewer().refresh();
- refreshTitle();
-
- ((EMFCompareDiffTreeViewer)getViewer()).createChildrenSilently();
- redrawFromSelection(getSelection());
- }
- });
+ getViewer().refresh();
+
+ dependencyData.updateTreeItemMappings();
+ dependencyData.updateDependencies(getSelection());
+
+ getControl().redraw();
+
+ refreshTitle();
}
private void handleSelectionChangedEvent(SelectionChangedEvent event) {
- redrawFromSelection(event.getSelection());
+ dependencyData.updateDependencies(event.getSelection());
+ getControl().redraw();
}
- protected void redrawFromSelection(ISelection selection) {
- EObject eObject = getFirst(getSelectedComparisonObject(selection), null);
- if (eObject != null) {
- treeRuler.computeConsequences(eObject);
- getControl().redraw();
- }
- }
-
- private static List<EObject> getSelectedComparisonObject(ISelection selection) {
- List<EObject> ret = newArrayList();
- if (selection instanceof IStructuredSelection) {
- List<?> selectedObjects = ((IStructuredSelection)selection).toList();
- Iterable<EObject> data = transform(selectedObjects, ADAPTER__TARGET__DATA);
- Iterable<EObject> notNullData = Iterables.filter(data, notNull());
- addAll(ret, notNullData);
- }
- return ret;
- }
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/IWrappableStructuredViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/IWrappableStructuredViewer.java
new file mode 100644
index 000000000..937e15e1d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/IWrappableStructuredViewer.java
@@ -0,0 +1,701 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;
+
+import java.util.List;
+
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.IElementComparer;
+import org.eclipse.jface.viewers.IOpenListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.ViewerComparator;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.jface.viewers.ViewerLabel;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DropTargetListener;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.HelpEvent;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+interface IWrappableStructuredViewer {
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#addDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener)
+ */
+ void addDoubleClickListener(IDoubleClickListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#addOpenListener(org.eclipse.jface.viewers.IOpenListener)
+ */
+ void addOpenListener(IOpenListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#addPostSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+ */
+ void addPostSelectionChangedListener(ISelectionChangedListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#addDragSupport(int, org.eclipse.swt.dnd.Transfer[],
+ * org.eclipse.swt.dnd.DragSourceListener)
+ */
+ void addDragSupport(int operations, Transfer[] transferTypes, DragSourceListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#addDropSupport(int, org.eclipse.swt.dnd.Transfer[],
+ * org.eclipse.swt.dnd.DropTargetListener)
+ */
+ void addDropSupport(int operations, Transfer[] transferTypes, DropTargetListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#addFilter(org.eclipse.jface.viewers.ViewerFilter)
+ */
+ void addFilter(ViewerFilter filter);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#assertElementsNotNull(java.lang.Object[])
+ */
+ void assertElementsNotNull(Object[] elements);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#associate(java.lang.Object,
+ * org.eclipse.swt.widgets.Item)
+ */
+ void associate(Object element, Item item);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#disassociate(org.eclipse.swt.widgets.Item)
+ */
+ void disassociate(Item item);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#doFindInputItem(java.lang.Object)
+ */
+ Widget doFindInputItem(Object element);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#doFindItem(java.lang.Object)
+ */
+ Widget doFindItem(Object element);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#doUpdateItem(org.eclipse.swt.widgets.Widget,
+ * java.lang.Object, boolean)
+ */
+ void doUpdateItem(Widget item, Object element, boolean fullMap);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#equals(java.lang.Object, java.lang.Object)
+ */
+ boolean equals(Object elementA, Object elementB);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#filter(java.lang.Object[])
+ */
+ Object[] filter(Object[] elements);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#fireDoubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
+ */
+ void fireDoubleClick(DoubleClickEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#fireOpen(org.eclipse.jface.viewers.OpenEvent)
+ */
+ void fireOpen(OpenEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#firePostSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ void firePostSelectionChanged(SelectionChangedEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getComparer()
+ */
+ IElementComparer getComparer();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getFilteredChildren(java.lang.Object)
+ */
+ Object[] getFilteredChildren(Object parent);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getFilters()
+ */
+ ViewerFilter[] getFilters();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getItem(int, int)
+ */
+ Item getItem(int x, int y);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getRawChildren(java.lang.Object)
+ */
+ Object[] getRawChildren(Object parent);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getRoot()
+ */
+ Object getRoot();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getSelection()
+ */
+ ISelection getSelection();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getSelectionFromWidget()
+ */
+ List getSelectionFromWidget();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getSortedChildren(java.lang.Object)
+ */
+ Object[] getSortedChildren(Object parent);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getSorter()
+ */
+ ViewerSorter getSorter();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getComparator()
+ */
+ ViewerComparator getComparator();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleDoubleSelect(org.eclipse.swt.events.SelectionEvent)
+ */
+ void handleDoubleSelect(SelectionEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleOpen(org.eclipse.swt.events.SelectionEvent)
+ */
+ void handleOpen(SelectionEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleInvalidSelection(org.eclipse.jface.viewers.ISelection,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleLabelProviderChanged(org.eclipse.jface.viewers.LabelProviderChangedEvent)
+ */
+ void handleLabelProviderChanged(LabelProviderChangedEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleSelect(org.eclipse.swt.events.SelectionEvent)
+ */
+ void handleSelect(SelectionEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handlePostSelect(org.eclipse.swt.events.SelectionEvent)
+ */
+ void handlePostSelect(SelectionEvent e);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#hookControl(org.eclipse.swt.widgets.Control)
+ */
+ void hookControl(Control control);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#hasFilters()
+ */
+ boolean hasFilters();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#internalRefresh(java.lang.Object)
+ */
+ void internalRefresh(Object element);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#internalRefresh(java.lang.Object, boolean)
+ */
+ void internalRefresh(Object element, boolean updateLabels);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#mapElement(java.lang.Object,
+ * org.eclipse.swt.widgets.Widget)
+ */
+ void mapElement(Object element, Widget item);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#needsRefilter(java.lang.Object, java.lang.String)
+ */
+ boolean needsRefilter(Object element, String property);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#preservingSelection(java.lang.Runnable)
+ */
+ void preservingSelection(Runnable updateCode);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#refresh()
+ */
+ void refresh();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#refresh(boolean)
+ */
+ void refresh(boolean updateLabels);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#refresh(java.lang.Object)
+ */
+ void refresh(Object element);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#refresh(java.lang.Object, boolean)
+ */
+ void refresh(Object element, boolean updateLabels);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#removeOpenListener(org.eclipse.jface.viewers.IOpenListener)
+ */
+ void removeOpenListener(IOpenListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#removePostSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+ */
+ void removePostSelectionChangedListener(ISelectionChangedListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#removeDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener)
+ */
+ void removeDoubleClickListener(IDoubleClickListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#removeFilter(org.eclipse.jface.viewers.ViewerFilter)
+ */
+ void removeFilter(ViewerFilter filter);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setFilters(org.eclipse.jface.viewers.ViewerFilter[])
+ */
+ void setFilters(ViewerFilter[] filters);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#resetFilters()
+ */
+ void resetFilters();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#reveal(java.lang.Object)
+ */
+ void reveal(Object element);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setContentProvider(org.eclipse.jface.viewers.IContentProvider)
+ */
+ void setContentProvider(IContentProvider provider);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#assertContentProviderType(org.eclipse.jface.viewers.IContentProvider)
+ */
+ void assertContentProviderType(IContentProvider provider);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setSelection(org.eclipse.jface.viewers.ISelection,
+ * boolean)
+ */
+ void setSelection(ISelection selection, boolean reveal);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(java.util.List, boolean)
+ */
+ void setSelectionToWidget(List l, boolean reveal);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setSelectionToWidget(org.eclipse.jface.viewers.ISelection,
+ * boolean)
+ */
+ void setSelectionToWidget(ISelection selection, boolean reveal);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setSorter(org.eclipse.jface.viewers.ViewerSorter)
+ */
+ void setSorter(ViewerSorter sorter);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setComparator(org.eclipse.jface.viewers.ViewerComparator)
+ */
+ void setComparator(ViewerComparator comparator);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setUseHashlookup(boolean)
+ */
+ void setUseHashlookup(boolean enable);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setComparer(org.eclipse.jface.viewers.IElementComparer)
+ */
+ void setComparer(IElementComparer comparer);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#testFindItem(java.lang.Object)
+ */
+ Widget testFindItem(Object element);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#testFindItems(java.lang.Object)
+ */
+ Widget[] testFindItems(Object element);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#unmapAllElements()
+ */
+ void unmapAllElements();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#unmapElement(java.lang.Object)
+ */
+ void unmapElement(Object element);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#unmapElement(java.lang.Object,
+ * org.eclipse.swt.widgets.Widget)
+ */
+ void unmapElement(Object element, Widget item);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#update(java.lang.Object[], java.lang.String[])
+ */
+ void update(Object[] elements, String[] properties);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#update(java.lang.Object, java.lang.String[])
+ */
+ void update(Object element, String[] properties);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#internalUpdate(org.eclipse.swt.widgets.Widget,
+ * java.lang.Object, java.lang.String[])
+ */
+ void internalUpdate(Widget widget, Object element, String[] properties);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#updateSelection(org.eclipse.jface.viewers.ISelection)
+ */
+ void updateSelection(ISelection selection);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#usingElementMap()
+ */
+ boolean usingElementMap();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#setLabelProvider(org.eclipse.jface.viewers.IBaseLabelProvider)
+ */
+ void setLabelProvider(IBaseLabelProvider labelProvider);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#buildLabel(org.eclipse.jface.viewers.ViewerLabel,
+ * java.lang.Object)
+ */
+ void buildLabel(ViewerLabel updateLabel, Object element);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
+ */
+ void handleDispose(DisposeEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ContentViewer#getContentProvider()
+ */
+ IContentProvider getContentProvider();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ContentViewer#getInput()
+ */
+ Object getInput();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ContentViewer#getLabelProvider()
+ */
+ IBaseLabelProvider getLabelProvider();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ContentViewer#labelProviderChanged()
+ */
+ void labelProviderChanged();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#addHelpListener(org.eclipse.swt.events.HelpListener)
+ */
+ void addHelpListener(HelpListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#addSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+ */
+ void addSelectionChangedListener(ISelectionChangedListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#fireHelpRequested(org.eclipse.swt.events.HelpEvent)
+ */
+ void fireHelpRequested(HelpEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#fireSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ void fireSelectionChanged(SelectionChangedEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#getControl()
+ */
+ Control getControl();
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#getData(java.lang.String)
+ */
+ Object getData(String key);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#handleHelpRequest(org.eclipse.swt.events.HelpEvent)
+ */
+ void handleHelpRequest(HelpEvent event);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#inputChanged(java.lang.Object, java.lang.Object)
+ */
+ void inputChanged(Object input, Object oldInput);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#removeHelpListener(org.eclipse.swt.events.HelpListener)
+ */
+ void removeHelpListener(HelpListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#removeSelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener)
+ */
+ void removeSelectionChangedListener(ISelectionChangedListener listener);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#scrollDown(int, int)
+ */
+ Item scrollDown(int x, int y);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#scrollUp(int, int)
+ */
+ Item scrollUp(int x, int y);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#setData(java.lang.String, java.lang.Object)
+ */
+ void setData(String key, Object value);
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers.ISelection)
+ */
+ void setSelection(ISelection selection);
+
+}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/Navigatable.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/Navigatable.java
index b00f5c618..28bc3af13 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/Navigatable.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/Navigatable.java
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;
+import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterators;
import com.google.common.collect.Lists;
@@ -23,6 +24,7 @@ import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.ide.ui.internal.contentmergeviewer.util.DynamicObject;
import org.eclipse.emf.compare.ide.ui.internal.util.JFaceUtil;
import org.eclipse.emf.ecore.EObject;
@@ -36,9 +38,18 @@ import org.eclipse.jface.viewers.StructuredViewer;
* @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
*/
public class Navigatable implements INavigatable {
+
/**
+ * A predicate that checks if the given input is a TreeNode that contains a diff.
*
+ * @return true, if the given input is a TreeNode that contains a diff, false otherwise.
*/
+ private static final Predicate<EObject> IS_DIFF_TREE_NODE = new Predicate<EObject>() {
+ public boolean apply(EObject t) {
+ return isDiffTreeNode(t);
+ }
+ };
+
private final AdapterFactory adapterFactory;
private final StructuredViewer viewer;
@@ -110,7 +121,7 @@ public class Navigatable implements INavigatable {
adapterFactory.adapt(parentNode, ICompareInput.class)).reverse();
int indexOfTreeNode = children.indexOf(treeNode);
if (indexOfTreeNode == children.size() - 1) {
- if (EMFCompareDiffTreeViewer.IS_DIFF_TREE_NODE.apply(parentNode)) {
+ if (isDiffTreeNode(parentNode)) {
previousNode = parentNode;
} else {
previousNode = getPrevDiffNode(parentNode);
@@ -123,7 +134,7 @@ public class Navigatable implements INavigatable {
previousNode = getLastChildDiffNode(prevSibling);
if (previousNode != null) {
stop = true;
- } else if (EMFCompareDiffTreeViewer.IS_DIFF_TREE_NODE.apply(prevSibling)) {
+ } else if (isDiffTreeNode(prevSibling)) {
previousNode = prevSibling;
stop = true;
}
@@ -180,7 +191,7 @@ public class Navigatable implements INavigatable {
while (!stop) {
if (children.size() > indexOfTreeNode + 1) {
TreeNode nextSibling = children.get(indexOfTreeNode + 1);
- if (EMFCompareDiffTreeViewer.IS_DIFF_TREE_NODE.apply(nextSibling)) {
+ if (isDiffTreeNode(nextSibling)) {
next = nextSibling;
} else {
next = getFirstChildDiffNode(nextSibling);
@@ -206,7 +217,7 @@ public class Navigatable implements INavigatable {
*/
private TreeNode getFirstChildDiffNode(TreeNode treeNode) {
UnmodifiableIterator<EObject> diffChildren = Iterators.filter(treeNode.eAllContents(),
- EMFCompareDiffTreeViewer.IS_DIFF_TREE_NODE);
+ IS_DIFF_TREE_NODE);
while (diffChildren.hasNext()) {
TreeNode next = (TreeNode)diffChildren.next();
if (!JFaceUtil.isFiltered(viewer, adapterFactory.adapt(next, ICompareInput.class), adapterFactory
@@ -226,7 +237,7 @@ public class Navigatable implements INavigatable {
*/
private TreeNode getLastChildDiffNode(TreeNode treeNode) {
UnmodifiableIterator<EObject> diffChildren = Iterators.filter(treeNode.eAllContents(),
- EMFCompareDiffTreeViewer.IS_DIFF_TREE_NODE);
+ IS_DIFF_TREE_NODE);
List<EObject> l = Lists.newArrayList(diffChildren);
ListIterator<EObject> li = l.listIterator(l.size());
while (li.hasPrevious()) {
@@ -260,6 +271,9 @@ public class Navigatable implements INavigatable {
}
}
return ImmutableList.copyOf(treeNodeChildren);
+ }
+ private static boolean isDiffTreeNode(EObject t) {
+ return t instanceof TreeNode && ((TreeNode)t).getData() instanceof Diff;
}
}
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/WrappableTreeViewer.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/WrappableTreeViewer.java
new file mode 100644
index 000000000..61453875c
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/WrappableTreeViewer.java
@@ -0,0 +1,1070 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Obeo.
+ * 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:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer;
+
+import java.util.List;
+
+import org.eclipse.jface.viewers.ColumnViewerEditor;
+import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IContentProvider;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.LabelProviderChangedEvent;
+import org.eclipse.jface.viewers.OpenEvent;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeExpansionEvent;
+import org.eclipse.jface.viewers.TreePath;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.ViewerLabel;
+import org.eclipse.jface.viewers.ViewerRow;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.HelpEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TreeEvent;
+import org.eclipse.swt.events.TreeListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.Widget;
+
+/**
+ * @author <a href="mailto:mikael.barbero@obeo.fr">Mikael Barbero</a>
+ */
+class WrappableTreeViewer extends TreeViewer implements IWrappableStructuredViewer {
+
+ /**
+ * @param parent
+ * @param style
+ */
+ public WrappableTreeViewer(Composite parent, int style) {
+ super(parent, style);
+ }
+
+ /**
+ * @param parent
+ */
+ public WrappableTreeViewer(Composite parent) {
+ super(parent);
+ }
+
+ /**
+ * @param tree
+ */
+ public WrappableTreeViewer(Tree tree) {
+ super(tree);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#addTreeListener(org.eclipse.swt.widgets.Control,
+ * org.eclipse.swt.events.TreeListener)
+ */
+ @Override
+ public void addTreeListener(Control c, TreeListener listener) {
+ super.addTreeListener(c, listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getColumnViewerOwner(int)
+ */
+ @Override
+ public Widget getColumnViewerOwner(int columnIndex) {
+ return super.getColumnViewerOwner(columnIndex);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getChildren(org.eclipse.swt.widgets.Widget)
+ */
+ @Override
+ public Item[] getChildren(Widget o) {
+ return super.getChildren(o);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getExpanded(org.eclipse.swt.widgets.Item)
+ */
+ @Override
+ public boolean getExpanded(Item item) {
+ return super.getExpanded(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getItemAt(org.eclipse.swt.graphics.Point)
+ */
+ @Override
+ public Item getItemAt(Point p) {
+ return super.getItemAt(p);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getItemCount(org.eclipse.swt.widgets.Control)
+ */
+ @Override
+ public int getItemCount(Control widget) {
+ return super.getItemCount(widget);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getItemCount(org.eclipse.swt.widgets.Item)
+ */
+ @Override
+ public int getItemCount(Item item) {
+ return super.getItemCount(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getItems(org.eclipse.swt.widgets.Item)
+ */
+ @Override
+ public Item[] getItems(Item item) {
+ return super.getItems(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getParentItem(org.eclipse.swt.widgets.Item)
+ */
+ @Override
+ public Item getParentItem(Item item) {
+ return super.getParentItem(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getSelection(org.eclipse.swt.widgets.Control)
+ */
+ @Override
+ public Item[] getSelection(Control widget) {
+ return super.getSelection(widget);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#hookControl(org.eclipse.swt.widgets.Control)
+ */
+ @Override
+ public void hookControl(Control control) {
+ super.hookControl(control);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#createViewerEditor()
+ */
+ @Override
+ public ColumnViewerEditor createViewerEditor() {
+ return super.createViewerEditor();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#newItem(org.eclipse.swt.widgets.Widget, int, int)
+ */
+ @Override
+ public Item newItem(Widget parent, int flags, int ix) {
+ return super.newItem(parent, flags, ix);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#removeAll(org.eclipse.swt.widgets.Control)
+ */
+ @Override
+ public void removeAll(Control widget) {
+ super.removeAll(widget);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#setExpanded(org.eclipse.swt.widgets.Item, boolean)
+ */
+ @Override
+ public void setExpanded(Item node, boolean expand) {
+ super.setExpanded(node, expand);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#setSelection(java.util.List)
+ */
+ @Override
+ public void setSelection(List items) {
+ super.setSelection(items);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#showItem(org.eclipse.swt.widgets.Item)
+ */
+ @Override
+ public void showItem(Item item) {
+ super.showItem(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getChild(org.eclipse.swt.widgets.Widget, int)
+ */
+ @Override
+ public Item getChild(Widget widget, int index) {
+ return super.getChild(widget, index);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#assertContentProviderType(org.eclipse.jface.viewers.IContentProvider)
+ */
+ @Override
+ public void assertContentProviderType(IContentProvider provider) {
+ super.assertContentProviderType(provider);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getRawChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getRawChildren(Object parent) {
+ return super.getRawChildren(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getParentElement(java.lang.Object)
+ */
+ @Override
+ public Object getParentElement(Object element) {
+ return super.getParentElement(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#internalAdd(org.eclipse.swt.widgets.Widget, java.lang.Object,
+ * java.lang.Object[])
+ */
+ @Override
+ public void internalAdd(Widget widget, Object parentElement, Object[] childElements) {
+ super.internalAdd(widget, parentElement, childElements);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#internalRefreshStruct(org.eclipse.swt.widgets.Widget,
+ * java.lang.Object, boolean)
+ */
+ @Override
+ public void internalRefreshStruct(Widget widget, Object element, boolean updateLabels) {
+ super.internalRefreshStruct(widget, element, updateLabels);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#mapElement(java.lang.Object, org.eclipse.swt.widgets.Widget)
+ */
+ @Override
+ public void mapElement(Object element, Widget item) {
+ super.mapElement(element, item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#getViewerRowFromItem(org.eclipse.swt.widgets.Widget)
+ */
+ @Override
+ public ViewerRow getViewerRowFromItem(Widget item) {
+ return super.getViewerRowFromItem(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#internalInitializeTree(org.eclipse.swt.widgets.Control)
+ */
+ @Override
+ public void internalInitializeTree(Control widget) {
+ super.internalInitializeTree(widget);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#updatePlus(org.eclipse.swt.widgets.Item, java.lang.Object)
+ */
+ @Override
+ public void updatePlus(Item item, Object element) {
+ super.updatePlus(item, element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#handleTreeExpand(org.eclipse.swt.events.TreeEvent)
+ */
+ @Override
+ public void handleTreeExpand(TreeEvent event) {
+ super.handleTreeExpand(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#handleTreeCollapse(org.eclipse.swt.events.TreeEvent)
+ */
+ @Override
+ public void handleTreeCollapse(TreeEvent event) {
+ super.handleTreeCollapse(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#disassociate(org.eclipse.swt.widgets.Item)
+ */
+ @Override
+ public void disassociate(Item item) {
+ super.disassociate(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.TreeViewer#doGetColumnCount()
+ */
+ @Override
+ public int doGetColumnCount() {
+ return super.doGetColumnCount();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#indexForElement(org.eclipse.swt.widgets.Widget,
+ * java.lang.Object)
+ */
+ @Override
+ public int indexForElement(Widget parent, Object element) {
+ return super.indexForElement(parent, element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#getSortedChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getSortedChildren(Object parentElementOrTreePath) {
+ return super.getSortedChildren(parentElementOrTreePath);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#addSelectionListener(org.eclipse.swt.widgets.Control,
+ * org.eclipse.swt.events.SelectionListener)
+ * @deprecated
+ */
+ @Deprecated
+ @Override
+ public void addSelectionListener(Control control, SelectionListener listener) {
+ super.addSelectionListener(control, listener);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#associate(java.lang.Object,
+ * org.eclipse.swt.widgets.Item)
+ */
+ @Override
+ public void associate(Object element, Item item) {
+ super.associate(element, item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#createChildren(org.eclipse.swt.widgets.Widget)
+ */
+ @Override
+ public void createChildren(Widget widget) {
+ super.createChildren(widget);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#createTreeItem(org.eclipse.swt.widgets.Widget,
+ * java.lang.Object, int)
+ */
+ @Override
+ public void createTreeItem(Widget parent, Object element, int index) {
+ super.createTreeItem(parent, element, index);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#doFindInputItem(java.lang.Object)
+ */
+ @Override
+ public Widget doFindInputItem(Object element) {
+ return super.doFindInputItem(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#doFindItem(java.lang.Object)
+ */
+ @Override
+ public Widget doFindItem(Object element) {
+ return super.doFindItem(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#doUpdateItem(org.eclipse.swt.widgets.Item,
+ * java.lang.Object)
+ */
+ @Override
+ public void doUpdateItem(Item item, Object element) {
+ super.doUpdateItem(item, element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#isSameSelection(java.util.List,
+ * org.eclipse.swt.widgets.Item[])
+ */
+ @Override
+ public boolean isSameSelection(List items, Item[] current) {
+ return super.isSameSelection(items, current);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#doUpdateItem(org.eclipse.swt.widgets.Widget,
+ * java.lang.Object, boolean)
+ */
+ @Override
+ public void doUpdateItem(Widget widget, Object element, boolean fullMap) {
+ super.doUpdateItem(widget, element, fullMap);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#fireTreeCollapsed(org.eclipse.jface.viewers.TreeExpansionEvent)
+ */
+ @Override
+ public void fireTreeCollapsed(TreeExpansionEvent event) {
+ super.fireTreeCollapsed(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#fireTreeExpanded(org.eclipse.jface.viewers.TreeExpansionEvent)
+ */
+ @Override
+ public void fireTreeExpanded(TreeExpansionEvent event) {
+ super.fireTreeExpanded(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#getNextItem(org.eclipse.swt.widgets.Item, boolean)
+ */
+ @Override
+ public Item getNextItem(Item item, boolean includeChildren) {
+ return super.getNextItem(item, includeChildren);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#getPreviousItem(org.eclipse.swt.widgets.Item)
+ */
+ @Override
+ public Item getPreviousItem(Item item) {
+ return super.getPreviousItem(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#getSelectionFromWidget()
+ */
+ @Override
+ public List getSelectionFromWidget() {
+ return super.getSelectionFromWidget();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#handleDoubleSelect(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void handleDoubleSelect(SelectionEvent event) {
+ super.handleDoubleSelect(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#inputChanged(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public void inputChanged(Object input, Object oldInput) {
+ super.inputChanged(input, oldInput);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalCollapseToLevel(org.eclipse.swt.widgets.Widget,
+ * int)
+ */
+ @Override
+ public void internalCollapseToLevel(Widget widget, int level) {
+ super.internalCollapseToLevel(widget, level);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalExpand(java.lang.Object, boolean)
+ */
+ @Override
+ public Widget internalExpand(Object elementOrPath, boolean expand) {
+ return super.internalExpand(elementOrPath, expand);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalGetWidgetToSelect(java.lang.Object)
+ */
+ @Override
+ public Widget internalGetWidgetToSelect(Object elementOrTreePath) {
+ return super.internalGetWidgetToSelect(elementOrTreePath);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalExpandToLevel(org.eclipse.swt.widgets.Widget,
+ * int)
+ */
+ @Override
+ public void internalExpandToLevel(Widget widget, int level) {
+ super.internalExpandToLevel(widget, level);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalRefresh(java.lang.Object)
+ */
+ @Override
+ public void internalRefresh(Object element) {
+ super.internalRefresh(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalRefresh(java.lang.Object, boolean)
+ */
+ @Override
+ public void internalRefresh(Object element, boolean updateLabels) {
+ super.internalRefresh(element, updateLabels);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalRefresh(org.eclipse.swt.widgets.Widget,
+ * java.lang.Object, boolean, boolean)
+ */
+ @Override
+ public void internalRefresh(Widget widget, Object element, boolean doStruct, boolean updateLabels) {
+ super.internalRefresh(widget, element, doStruct, updateLabels);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalRemove(java.lang.Object[])
+ */
+ @Override
+ public void internalRemove(Object[] elementsOrPaths) {
+ super.internalRemove(elementsOrPaths);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#internalRemove(java.lang.Object, java.lang.Object[])
+ */
+ @Override
+ public void internalRemove(Object parent, Object[] elements) {
+ super.internalRemove(parent, elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#labelProviderChanged()
+ */
+ @Override
+ public void labelProviderChanged() {
+ super.labelProviderChanged();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#setSelectionToWidget(java.util.List, boolean)
+ */
+ @Override
+ public void setSelectionToWidget(List v, boolean reveal) {
+ super.setSelectionToWidget(v, reveal);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#updateChildren(org.eclipse.swt.widgets.Widget,
+ * java.lang.Object, java.lang.Object[])
+ * @deprecated
+ */
+ @Override
+ @Deprecated
+ public void updateChildren(Widget widget, Object parent, Object[] elementChildren) {
+ super.updateChildren(widget, parent, elementChildren);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#getTreePathFromItem(org.eclipse.swt.widgets.Item)
+ */
+ @Override
+ public TreePath getTreePathFromItem(Item item) {
+ return super.getTreePathFromItem(item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#setSelectionToWidget(org.eclipse.jface.viewers.ISelection,
+ * boolean)
+ */
+ @Override
+ public void setSelectionToWidget(ISelection selection, boolean reveal) {
+ super.setSelectionToWidget(selection, reveal);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.AbstractTreeViewer#buildLabel(org.eclipse.jface.viewers.ViewerLabel,
+ * java.lang.Object)
+ */
+ @Override
+ public void buildLabel(ViewerLabel updateLabel, Object elementOrPath) {
+ super.buildLabel(updateLabel, elementOrPath);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnViewer#hookEditingSupport(org.eclipse.swt.widgets.Control)
+ */
+ @Override
+ public void hookEditingSupport(Control control) {
+ super.hookEditingSupport(control);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnViewer#getViewerRow(org.eclipse.swt.graphics.Point)
+ */
+ @Override
+ public ViewerRow getViewerRow(Point point) {
+ return super.getViewerRow(point);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnViewer#getItem(int, int)
+ */
+ @Override
+ public Item getItem(int x, int y) {
+ return super.getItem(x, y);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnViewer#applyEditorValue()
+ */
+ @Override
+ public void applyEditorValue() {
+ super.applyEditorValue();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnViewer#handleDispose(org.eclipse.swt.events.DisposeEvent)
+ */
+ @Override
+ public void handleDispose(DisposeEvent event) {
+ super.handleDispose(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnViewer#triggerEditorActivationEvent(org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent)
+ */
+ @Override
+ public void triggerEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
+ super.triggerEditorActivationEvent(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnViewer#checkBusy()
+ */
+ @Override
+ public boolean checkBusy() {
+ return super.checkBusy();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.ColumnViewer#setBusy(boolean)
+ */
+ @Override
+ public void setBusy(boolean busy) {
+ super.setBusy(busy);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#assertElementsNotNull(java.lang.Object[])
+ */
+ @Override
+ public void assertElementsNotNull(Object[] elements) {
+ super.assertElementsNotNull(elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#equals(java.lang.Object, java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object elementA, Object elementB) {
+ return super.equals(elementA, elementB);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#filter(java.lang.Object[])
+ */
+ @Override
+ public Object[] filter(Object[] elements) {
+ return super.filter(elements);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#fireDoubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
+ */
+ @Override
+ public void fireDoubleClick(DoubleClickEvent event) {
+ super.fireDoubleClick(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#fireOpen(org.eclipse.jface.viewers.OpenEvent)
+ */
+ @Override
+ public void fireOpen(OpenEvent event) {
+ super.fireOpen(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#firePostSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ @Override
+ public void firePostSelectionChanged(SelectionChangedEvent event) {
+ super.firePostSelectionChanged(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getFilteredChildren(java.lang.Object)
+ */
+ @Override
+ public Object[] getFilteredChildren(Object parent) {
+ return super.getFilteredChildren(parent);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getRoot()
+ */
+ @Override
+ public Object getRoot() {
+ return super.getRoot();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleOpen(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void handleOpen(SelectionEvent event) {
+ super.handleOpen(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleInvalidSelection(org.eclipse.jface.viewers.ISelection,
+ * org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public void handleInvalidSelection(ISelection invalidSelection, ISelection newSelection) {
+ super.handleInvalidSelection(invalidSelection, newSelection);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleLabelProviderChanged(org.eclipse.jface.viewers.LabelProviderChangedEvent)
+ */
+ @Override
+ public void handleLabelProviderChanged(LabelProviderChangedEvent event) {
+ super.handleLabelProviderChanged(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handleSelect(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void handleSelect(SelectionEvent event) {
+ super.handleSelect(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#handlePostSelect(org.eclipse.swt.events.SelectionEvent)
+ */
+ @Override
+ public void handlePostSelect(SelectionEvent e) {
+ super.handlePostSelect(e);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#hasFilters()
+ */
+ @Override
+ public boolean hasFilters() {
+ return super.hasFilters();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#needsRefilter(java.lang.Object, java.lang.String)
+ */
+ @Override
+ public boolean needsRefilter(Object element, String property) {
+ return super.needsRefilter(element, property);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#preservingSelection(java.lang.Runnable)
+ */
+ @Override
+ public void preservingSelection(Runnable updateCode) {
+ super.preservingSelection(updateCode);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#unmapAllElements()
+ */
+ @Override
+ public void unmapAllElements() {
+ super.unmapAllElements();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#unmapElement(java.lang.Object)
+ */
+ @Override
+ public void unmapElement(Object element) {
+ super.unmapElement(element);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#unmapElement(java.lang.Object,
+ * org.eclipse.swt.widgets.Widget)
+ */
+ @Override
+ public void unmapElement(Object element, Widget item) {
+ super.unmapElement(element, item);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#internalUpdate(org.eclipse.swt.widgets.Widget,
+ * java.lang.Object, java.lang.String[])
+ */
+ @Override
+ public void internalUpdate(Widget widget, Object element, String[] properties) {
+ super.internalUpdate(widget, element, properties);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#updateSelection(org.eclipse.jface.viewers.ISelection)
+ */
+ @Override
+ public void updateSelection(ISelection selection) {
+ super.updateSelection(selection);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#usingElementMap()
+ */
+ @Override
+ public boolean usingElementMap() {
+ return super.usingElementMap();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.StructuredViewer#getColorAndFontCollector()
+ */
+ @Override
+ public ColorAndFontCollector getColorAndFontCollector() {
+ return super.getColorAndFontCollector();
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#fireHelpRequested(org.eclipse.swt.events.HelpEvent)
+ */
+ @Override
+ public void fireHelpRequested(HelpEvent event) {
+ super.fireHelpRequested(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#fireSelectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ @Override
+ public void fireSelectionChanged(SelectionChangedEvent event) {
+ super.fireSelectionChanged(event);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.jface.viewers.Viewer#handleHelpRequest(org.eclipse.swt.events.HelpEvent)
+ */
+ @Override
+ public void handleHelpRequest(HelpEvent event) {
+ super.handleHelpRequest(event);
+ }
+}

Back to the top