Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlgoubet2019-05-29 03:58:32 -0400
committerlgoubet2019-05-29 03:58:32 -0400
commit23df29bcb7866598f4e249e3da98a52142f62d9b (patch)
tree285a3cb1b505eef9d58e98354140e41e8e53a150
parent7f0ed79430efeb4e0755a5ebdf0f91b013d2b170 (diff)
downloadorg.eclipse.emf.compare-23df29bcb7866598f4e249e3da98a52142f62d9b.tar.gz
org.eclipse.emf.compare-23df29bcb7866598f4e249e3da98a52142f62d9b.tar.xz
org.eclipse.emf.compare-23df29bcb7866598f4e249e3da98a52142f62d9b.zip
Enable users to merge all conflicts at once through right-click action3.3.7RC13.3.7
-rw-r--r--plugins/org.eclipse.emf.compare.ide.ui/src/org/eclipse/emf/compare/ide/ui/internal/structuremergeviewer/EMFCompareStructureMergeViewer.java19
1 files changed, 17 insertions, 2 deletions
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 ac6653aff..79adb63f6 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
@@ -132,6 +132,7 @@ import org.eclipse.emf.compare.rcp.ui.internal.mergeviewer.IColorChangeEvent;
import org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.filters.StructureMergeViewerFilter;
import org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.filters.impl.CascadingDifferencesFilter;
import org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.groups.StructureMergeViewerGrouper;
+import org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.groups.provider.GroupItemProviderAdapter;
import org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.groups.provider.TreeItemProviderAdapterFactorySpec;
import org.eclipse.emf.compare.rcp.ui.internal.structuremergeviewer.match.MatchOfContainmentReferenceChangeProcessor;
import org.eclipse.emf.compare.rcp.ui.internal.util.SWTUtil;
@@ -580,7 +581,7 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
IMerger.Registry mergerRegistry = EMFCompareRCPPlugin.getDefault().getMergerRegistry();
if (singleDiffSelected) {
addSingleDiffMergeActions(manager, modes, mergerRegistry);
- } else if (isOneMatchOrResourceMatchSelected()) {
+ } else if (isOneMatchOrResourceMatchSelected() || isOneGroupSelected()) {
addMergeNonConflictingActions(manager, modes, mergerRegistry);
manager.add(new Separator());
addMergeConflictingActions(manager, modes, mergerRegistry);
@@ -710,7 +711,7 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
* @return true if the item selected is mergeable, false otherwise.
*/
private boolean isOneMergeableItemSelected() {
- return isOneDiffSelected() || isOneMatchOrResourceMatchSelected();
+ return isOneDiffSelected() || isOneMatchOrResourceMatchSelected() || isOneGroupSelected();
}
/**
@@ -760,6 +761,20 @@ public class EMFCompareStructureMergeViewer extends AbstractStructuredViewerWrap
}
/**
+ * Checks if there is currently a single selected item in the viewer, and that item is a group.
+ *
+ * @return <code>true</code> if the single selected item in this viewer is a group.
+ */
+ private boolean isOneGroupSelected() {
+ ISelection selection = getSelection();
+ if (selection instanceof IStructuredSelection && ((IStructuredSelection)selection).size() == 1) {
+ Object element = ((IStructuredSelection)selection).getFirstElement();
+ return element instanceof GroupItemProviderAdapter;
+ }
+ return false;
+ }
+
+ /**
* {@inheritDoc}
*
* @see org.eclipse.emf.compare.ide.ui.internal.structuremergeviewer.AbstractViewerWrapper#preHookCreateControlAndViewer()

Back to the top