diff options
author | Christian W. Damus | 2014-02-05 18:41:18 +0000 |
---|---|---|
committer | Christian W. Damus | 2014-02-07 23:55:45 +0000 |
commit | 65af346c9b891ea496ff9e69f8b7c4bf702dff7b (patch) | |
tree | 9d960ee737174f47b872f37e41e8e91ff77b5334 /extraplugins | |
parent | 09f0c73e06c20481ec3b8b58c3e83798ac7c85b9 (diff) | |
download | org.eclipse.papyrus-65af346c9b891ea496ff9e69f8b7c4bf702dff7b.tar.gz org.eclipse.papyrus-65af346c9b891ea496ff9e69f8b7c4bf702dff7b.tar.xz org.eclipse.papyrus-65af346c9b891ea496ff9e69f8b7c4bf702dff7b.zip |
402525: [Widgets / Transactions] Papyrus dialogs should be transactional
https://bugs.eclipse.org/bugs/show_bug.cgi?id=402525
Update CDO integration to use the self-nesting command stack.
Diffstat (limited to 'extraplugins')
-rw-r--r-- | extraplugins/cdo/org.eclipse.papyrus.cdo.core/src/org/eclipse/papyrus/cdo/core/resource/CDOAwareCommandStack.java | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/extraplugins/cdo/org.eclipse.papyrus.cdo.core/src/org/eclipse/papyrus/cdo/core/resource/CDOAwareCommandStack.java b/extraplugins/cdo/org.eclipse.papyrus.cdo.core/src/org/eclipse/papyrus/cdo/core/resource/CDOAwareCommandStack.java index e57e64cadac..a94616e64a5 100644 --- a/extraplugins/cdo/org.eclipse.papyrus.cdo.core/src/org/eclipse/papyrus/cdo/core/resource/CDOAwareCommandStack.java +++ b/extraplugins/cdo/org.eclipse.papyrus.cdo.core/src/org/eclipse/papyrus/cdo/core/resource/CDOAwareCommandStack.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2013 CEA LIST. + * Copyright (c) 2013, 2014 CEA LIST and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -8,6 +8,7 @@ * * Contributors: * CEA LIST - Initial API and implementation + * Christian W. Damus (CEA) - bug 402525 *****************************************************************************/ package org.eclipse.papyrus.cdo.core.resource; @@ -19,7 +20,7 @@ import org.eclipse.emf.cdo.eresource.EresourcePackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.transaction.ResourceSetChangeEvent; -import org.eclipse.papyrus.commands.NotifyingWorkspaceCommandStack; +import org.eclipse.papyrus.commands.NestingNotifyingWorkspaceCommandStack; import com.google.common.collect.Sets; @@ -28,12 +29,21 @@ import com.google.common.collect.Sets; * A CDO-specific command-stack that attaches undo contexts describing object-level * details of the scope of a change. */ -public class CDOAwareCommandStack extends NotifyingWorkspaceCommandStack { +public class CDOAwareCommandStack extends NestingNotifyingWorkspaceCommandStack { public CDOAwareCommandStack(IOperationHistory history) { super(history); } + protected CDOAwareCommandStack(boolean nested, IOperationHistory history) { + super(nested, history); + } + + @Override + protected NestingNotifyingWorkspaceCommandStack createNestedCommandStack(IOperationHistory history) { + return new CDOAwareCommandStack(true, history); + } + @Override protected void hookUndoContexts(IUndoableOperation operation, ResourceSetChangeEvent event) { super.hookUndoContexts(operation, event); |