Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcbrun2015-09-11 12:03:13 +0000
committercbrun2015-09-11 12:06:46 +0000
commit1e267698fd2cb82a88734dbd6e8261c8fe13892e (patch)
tree779814a61bb21cefec05fc5c702e49842b8021e1 /plugins
parent9e005ef8b3318b16ddee5121346b53288eaf6b1a (diff)
downloadorg.eclipse.emf.compare-3.1.1RC4.tar.gz
org.eclipse.emf.compare-3.1.1RC4.tar.xz
org.eclipse.emf.compare-3.1.1RC4.zip
[477181] Init MergeAction cascading enablement when the UI gets created3.1.1RC43.1.1
CompareToolbar and EMFCompareStructureMergeViewer should init their state on creation as an IDifferenceFilterChange event might not be fired or could be fired before they are listening on the eventbus. Bug: 477181 Change-Id: I3c26475df15c9279288720026ba771073890b668 Signed-off-by: Cedric Brun <cedric.brun@obeo.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/CompareToolBar.java8
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java5
2 files changed, 13 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/CompareToolBar.java b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/CompareToolBar.java
index eb95e21e5..3f7e658a7 100644
--- a/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/CompareToolBar.java
+++ b/plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/CompareToolBar.java
@@ -153,6 +153,10 @@ public class CompareToolBar implements ISelectionChangedListener {
toolbarManager.update(true);
+ final boolean enabled = any(this.compareConfiguration.getStructureMergeViewerFilter()
+ .getSelectedDifferenceFilters(), instanceOf(CascadingDifferencesFilter.class));
+ updateMergeActions(enabled);
+
this.doOnce = true;
}
}
@@ -209,6 +213,10 @@ public class CompareToolBar implements ISelectionChangedListener {
public void selectedDifferenceFiltersChange(IDifferenceFilterChange event) {
final boolean enabled = any(event.getSelectedDifferenceFilters(),
instanceOf(CascadingDifferencesFilter.class));
+ updateMergeActions(enabled);
+ }
+
+ private void updateMergeActions(final boolean enabled) {
for (MergeAction mergeAction : mergeActions) {
mergeAction.setCascadingDifferencesFilterEnabled(enabled);
}
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 69c4ab155..b5d3d5cdc 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
@@ -359,6 +359,10 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
inputChangedTask.setPriority(Job.LONG);
config.getEventBus().register(this);
+
+ final boolean enabled = any(config.getStructureMergeViewerFilter().getSelectedDifferenceFilters(),
+ instanceOf(CascadingDifferencesFilter.class));
+ setCascadingDifferencesFilterEnabled(enabled);
}
/**
@@ -426,6 +430,7 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
MergeAction mergeAction = new MergeAction(getCompareConfiguration().getEditingDomain(),
mergerRegistry, mode, leftEditable, rightEditable, navigatable,
(IStructuredSelection)getSelection());
+ mergeAction.setCascadingDifferencesFilterEnabled(getCascadingDifferencesFilterEnabled());
manager.add(mergeAction);
}
}

Back to the top