summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-10-07 05:22:08 (EDT)
committerEike Stepper2007-10-07 05:22:08 (EDT)
commit081a7fd16ce0b9ecaa2d96c0c7fce28c1f52aa93 (patch)
tree8ee0d09d1a79666e4e474491acdea36baf0b86da
parent6e4295e5e10bb0f0bb73e94d7c990f82cbbe4ed2 (diff)
downloadcdo-081a7fd16ce0b9ecaa2d96c0c7fce28c1f52aa93.zip
cdo-081a7fd16ce0b9ecaa2d96c0c7fce28c1f52aa93.tar.gz
cdo-081a7fd16ce0b9ecaa2d96c0c7fce28c1f52aa93.tar.bz2
[205651] Implement transaction rollback
https://bugs.eclipse.org/bugs/show_bug.cgi?id=205651
-rw-r--r--plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java
index 5838277..a148b61 100644
--- a/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java
+++ b/plugins/org.eclipse.emf.cdo.ui/src/org/eclipse/emf/cdo/internal/ui/actions/RollbackTransactionAction.java
@@ -1,9 +1,13 @@
package org.eclipse.emf.cdo.internal.ui.actions;
+import org.eclipse.emf.cdo.CDOTransaction;
import org.eclipse.emf.cdo.CDOView;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ui.IWorkbenchPage;
+import java.text.MessageFormat;
+
/**
* @author Eike Stepper
*/
@@ -20,6 +24,19 @@ public final class RollbackTransactionAction extends ViewAction
}
@Override
+ protected void preRun() throws Exception
+ {
+ CDOTransaction transaction = (CDOTransaction)getView();
+ String msg = MessageFormat.format("This transaction contains:\n" + "{0} new resources\n" + "{1} new objects\n"
+ + "{2} dirty objects\n\n" + "Are you sure to rollback this transaction", transaction.getNewResources().size(),
+ transaction.getNewObjects().size(), transaction.getDirtyObjects().size());
+ if (!MessageDialog.openQuestion(getShell(), TITLE, msg))
+ {
+ cancel();
+ }
+ }
+
+ @Override
protected void doRun() throws Exception
{
getTransaction().rollback();