Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-09-11 09:22:49 +0000
committerEike Stepper2015-09-11 09:22:49 +0000
commitac65e976777121e250d8eda56449d7253e93930e (patch)
tree2649603a18a7ce72e4dc33af534d5045f864d77c /plugins/org.eclipse.emf.cdo.explorer.ui
parentdb7b3a60979e9c945e1ef6e61187ecc6eb3a063b (diff)
downloadcdo-ac65e976777121e250d8eda56449d7253e93930e.tar.gz
cdo-ac65e976777121e250d8eda56449d7253e93930e.tar.xz
cdo-ac65e976777121e250d8eda56449d7253e93930e.zip
477128: Support interactive merging in CDOWorkspace.update()
Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=477128
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.explorer.ui')
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceUpdateHandler.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceUpdateHandler.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceUpdateHandler.java
index dcba37c9ad..d48152802e 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceUpdateHandler.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceUpdateHandler.java
@@ -11,6 +11,7 @@
package org.eclipse.emf.cdo.explorer.ui.handlers;
import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.explorer.ui.bundle.OM;
import org.eclipse.emf.cdo.internal.explorer.checkouts.OfflineCDOCheckout;
import org.eclipse.emf.cdo.transaction.CDOCommitContext;
import org.eclipse.emf.cdo.transaction.CDODefaultTransactionHandler2;
@@ -24,6 +25,7 @@ import org.eclipse.emf.cdo.util.ConcurrentAccessException;
import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.emf.cdo.workspace.CDOWorkspace;
+import org.eclipse.net4j.util.registry.IRegistry;
import org.eclipse.net4j.util.ui.UIUtil;
import org.eclipse.net4j.util.ui.handlers.AbstractBaseHandler;
@@ -47,9 +49,9 @@ public class WorkspaceUpdateHandler extends AbstractBaseHandler<OfflineCDOChecko
@Override
protected void doExecute(ExecutionEvent event, IProgressMonitor monitor) throws Exception
{
- final OfflineCDOCheckout checkout = elements.get(0);
+ OfflineCDOCheckout checkout = elements.get(0);
- final CDOWorkspace workspace = checkout.getWorkspace();
+ CDOWorkspace workspace = checkout.getWorkspace();
if (workspace != null)
{
try
@@ -82,8 +84,13 @@ public class WorkspaceUpdateHandler extends AbstractBaseHandler<OfflineCDOChecko
public void merge(CDOTransaction localTransaction, CDOView remoteView, Set<CDOID> affectedIDs)
throws ConflictException
{
- remoteView.properties().put(CDOCompareEditorUtil.PROP_COMPARISON_LABEL, "From remote");
- localTransaction.properties().put(CDOCompareEditorUtil.PROP_COMPARISON_LABEL, "To local");
+ IRegistry<String, Object> remoteProperties = remoteView.properties();
+ remoteProperties.put(CDOCompareEditorUtil.PROP_COMPARISON_IMAGE, OM.getImage("icons/repository.gif"));
+ remoteProperties.put(CDOCompareEditorUtil.PROP_COMPARISON_LABEL, "From remote");
+
+ IRegistry<String, Object> localProperties = localTransaction.properties();
+ localProperties.put(CDOCompareEditorUtil.PROP_COMPARISON_IMAGE, OM.getImage("icons/checkout.gif"));
+ localProperties.put(CDOCompareEditorUtil.PROP_COMPARISON_LABEL, "To local");
super.merge(localTransaction, remoteView, affectedIDs);
}
@@ -119,7 +126,7 @@ public class WorkspaceUpdateHandler extends AbstractBaseHandler<OfflineCDOChecko
});
}
- private void mergeDefault(final OfflineCDOCheckout checkout, final CDOWorkspace workspace, IProgressMonitor monitor)
+ private void mergeDefault(OfflineCDOCheckout checkout, CDOWorkspace workspace, IProgressMonitor monitor)
throws ConcurrentAccessException, CommitException
{
CDOTransaction transaction = workspace.update(new DefaultCDOMerger.PerFeature.ManyValued());

Back to the top