Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-09-13 06:44:59 +0000
committerEike Stepper2015-09-13 06:44:59 +0000
commit73969d5eb69779c1ca2a13fa36a9e9d2fa0b9630 (patch)
tree28091363f4045c1619aecd99d67e8d5a62396ddd /plugins/org.eclipse.emf.cdo.explorer.ui
parent9e6ed1e96a0cb9036c0290a9f7c3ae4f9b7c0331 (diff)
downloadcdo-73969d5eb69779c1ca2a13fa36a9e9d2fa0b9630.tar.gz
cdo-73969d5eb69779c1ca2a13fa36a9e9d2fa0b9630.tar.xz
cdo-73969d5eb69779c1ca2a13fa36a9e9d2fa0b9630.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/checkouts/actions/MergeFromActionProvider.java8
-rw-r--r--plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/handlers/WorkspaceUpdateHandler.java19
2 files changed, 6 insertions, 21 deletions
diff --git a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/MergeFromActionProvider.java b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/MergeFromActionProvider.java
index 9dd4b8cf4c..bfd6ef76fa 100644
--- a/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/MergeFromActionProvider.java
+++ b/plugins/org.eclipse.emf.cdo.explorer.ui/src/org/eclipse/emf/cdo/explorer/ui/checkouts/actions/MergeFromActionProvider.java
@@ -13,8 +13,10 @@ package org.eclipse.emf.cdo.explorer.ui.checkouts.actions;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
import org.eclipse.emf.cdo.explorer.checkouts.CDOCheckout;
import org.eclipse.emf.cdo.explorer.repositories.CDORepository;
+import org.eclipse.emf.cdo.transaction.CDOTransactionOpener;
import org.eclipse.emf.cdo.ui.Support;
import org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil;
+import org.eclipse.emf.cdo.ui.compare.CDOCompareEditorUtil.TransactionOpenerAndEditorCloser;
/**
* @author Eike Stepper
@@ -68,10 +70,12 @@ public class MergeFromActionProvider extends AbstractBranchPointActionProvider
{
if (Support.COMPARE.isAvailable())
{
- CDORepository repository = checkout.getRepository();
+ final CDORepository repository = checkout.getRepository();
CDOBranchPoint left = branchPoint;
CDOBranchPoint right = checkout.getBranchPoint();
- CDOCompareEditorUtil.openEditor(repository, repository, left, right, null, true);
+
+ CDOTransactionOpener transactionOpener = new TransactionOpenerAndEditorCloser(repository, true);
+ CDOCompareEditorUtil.openEditor(repository, transactionOpener, left, right, null, true);
}
}
}
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 d48152802e..acdda31adc 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
@@ -26,7 +26,6 @@ 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;
import org.eclipse.emf.spi.cdo.DefaultCDOMerger;
@@ -99,27 +98,9 @@ public class WorkspaceUpdateHandler extends AbstractBaseHandler<OfflineCDOChecko
transaction.addTransactionHandler(new CDODefaultTransactionHandler2()
{
@Override
- public void rolledBackTransaction(CDOTransaction transaction)
- {
- closeTransaction(transaction);
- }
-
- @Override
public void committedTransaction(CDOTransaction transaction, CDOCommitContext commitContext)
{
checkout.refresh();
- closeTransaction(transaction);
- }
-
- private void closeTransaction(final CDOTransaction transaction)
- {
- UIUtil.getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- transaction.close();
- }
- });
}
});
}

Back to the top