Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikaël Barbero2013-10-09 08:18:41 -0400
committerMikaël Barbero2013-10-11 10:22:33 -0400
commitdb61ff75d411fa26a6e5faae238b9b032a235bfc (patch)
treedb030f35cba30e67c786f56b8753da5d8e68061d /plugins/org.eclipse.emf.compare.ide.ui/src
parent60404a38e2841f3db703566e5284ae5b5b70117e (diff)
downloadorg.eclipse.emf.compare-db61ff75d411fa26a6e5faae238b9b032a235bfc.tar.gz
org.eclipse.emf.compare-db61ff75d411fa26a6e5faae238b9b032a235bfc.tar.xz
org.eclipse.emf.compare-db61ff75d411fa26a6e5faae238b9b032a235bfc.zip
Add ComparisonScope to IEMFCompareConfiguration
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/configuration/EMFCompareConfiguration.java31
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java1
2 files changed, 32 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java
index 8de0ae5d5..b9a7e2f31 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/configuration/EMFCompareConfiguration.java
@@ -31,6 +31,7 @@ import org.eclipse.emf.compare.rcp.ui.internal.configuration.IEMFCompareConfigur
import org.eclipse.emf.compare.rcp.ui.internal.configuration.IEMFCompareConfigurationChangeListener;
import org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.filters.IDifferenceFilter;
import org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.groups.IDifferenceGroupProvider;
+import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
@@ -66,6 +67,8 @@ public class EMFCompareConfiguration extends ForwardingCompareConfiguration impl
private static final String PREVIEW_MERGE_MODE = EMFCompareIDEUIPlugin.PLUGIN_ID + ".PREVIEW_MERGE_MODE"; //$NON-NLS-1$
+ private static final String COMPARISON_SCOPE = EMFCompareIDEUIPlugin.PLUGIN_ID + ".COMPARISON_SCOPE"; //$NON-NLS-1$;
+
private final List<IEMFCompareConfigurationChangeListener> listeners;
private final PropertyChangeListener propertyChangeListener;
@@ -223,6 +226,24 @@ public class EMFCompareConfiguration extends ForwardingCompareConfiguration impl
return ret;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.internal.configuration.IEMFCompareConfiguration#getComparisonScope()
+ */
+ public IComparisonScope getComparisonScope() {
+ return (IComparisonScope)getProperty(COMPARISON_SCOPE);
+ }
+
+ /**
+ * {@inheritDoc}
+ *
+ * @see org.eclipse.emf.compare.rcp.ui.internal.configuration.IEMFCompareConfiguration#setComparisonScope(org.eclipse.emf.compare.scope.IComparisonScope)
+ */
+ public void setComparisonScope(IComparisonScope comparisonScope) {
+ setProperty(COMPARISON_SCOPE, comparisonScope);
+ }
+
private class PropertyChangeListener implements IPropertyChangeListener {
/**
@@ -248,6 +269,8 @@ public class EMFCompareConfiguration extends ForwardingCompareConfiguration impl
handleComparatorChange(event);
} else if (PREVIEW_MERGE_MODE.equals(property)) {
handlePreviewMergeModeChange(event);
+ } else if (COMPARISON_SCOPE.equals(property)) {
+ handleComparisonScopeChange(event);
}
}
@@ -316,6 +339,14 @@ public class EMFCompareConfiguration extends ForwardingCompareConfiguration impl
listener.mergePreviewModeChange(oldValue, newValue);
}
}
+
+ protected void handleComparisonScopeChange(PropertyChangeEvent event) {
+ IComparisonScope oldValue = (IComparisonScope)event.getOldValue();
+ IComparisonScope newValue = (IComparisonScope)event.getNewValue();
+ for (IEMFCompareConfigurationChangeListener listener : listeners) {
+ listener.comparisonScopeChange(oldValue, newValue);
+ }
+ }
}
}
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 2b75690e8..90d4cc117 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
@@ -411,6 +411,7 @@ public class EMFCompareStructureMergeViewer extends AbstractViewerWrapper implem
diffTreeViewer.setRoot(fAdapterFactory.adapt(treeNode, ICompareInput.class));
getCompareConfiguration().setComparison(comparison);
+ getCompareConfiguration().setComparisonScope(scope);
SWTUtil.safeAsyncExec(new Runnable() {
public void run() {

Back to the top