Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351053

Summary: Check the need for WorkspaceCommandStackImpl
Product: [Modeling] Graphiti Reporter: Michael Wenz <michael.wenz>
Component: CoreAssignee: Michael Wenz <michael.wenz>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 Flags: michael.wenz: indigo+
michael.wenz: juno+
Version: 0.8.0   
Target Milestone: 0.8.0   
Hardware: All   
OS: All   
Whiteboard: Juno M1 theme_bugs Indigo SR1

Description Michael Wenz CLA 2011-07-04 03:48:08 EDT
By default Graphiti uses a WorkspaceCommandStackImpl as EMF command stack in the TransactionalEditingDomain. This is automatically set while creating the domain using Graphiti's service method.
On the other hand the specific stack seems not to be necessary except for passing the execution info object to the inner command execution. Check if this could be done using the standard command stack of the TransactionalEditingDomain.
Currently when using the standard command stack a CCE is thrown:
java.lang.ClassCastException: org.eclipse.emf.workspace.impl.WorkspaceCommandStackImpl cannot be cast to org.eclipse.graphiti.ui.internal.editor.GFWorkspaceCommandStackImpl
                at org.eclipse.graphiti.ui.internal.editor.GFCommandStack.<init>(GFCommandStack.java:67)
                at org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.setConfigurationProvider(DiagramEditorInternal.java:1591)
                at org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.setInput(DiagramEditorInternal.java:618)
                at org.eclipse.gef.ui.parts.GraphicalEditor.init(GraphicalEditor.java:346)
                at org.eclipse.graphiti.ui.internal.editor.DiagramEditorInternal.init(DiagramEditorInternal.java:1093)
Comment 1 Michael Wenz CLA 2011-07-19 04:15:23 EDT
Would like to target for Juno
Comment 2 Michael Wenz CLA 2011-07-25 04:31:18 EDT
Graphiti only requires a TransactionalCommandStack, the cast was only needed to be able to pass the execution info object into the execution of a feature command. I changed this to use the standard options used by EMF transactions.

Now there is only the need to pass a TransactionalCommandStack which is required anyway (and is also created when a standard TransactionalEditingDomain is created).

Also created a test for this in:
org.eclipse.graphiti.ui.tests.CommandStackTest#testCanUsePlainTransactionalCommandStack
Comment 3 Michael Wenz CLA 2011-07-25 04:31:41 EDT
Check if this should go to Indigo SR1 as well
Comment 4 Michael Wenz CLA 2011-08-19 04:29:04 EDT
Checked in to Indigo SR1 RC2:
commit d3ec81b8dbbbdc9615dd837f299ad4158a5506ee
Author: mwenz <mwenz> 2011-07-25 10:23:32
Committer: Michael Wenz <michael.wenz@sap.com> 2011-08-19 09:59:04
Parent: 247ecca1b77b0acb651b9ba49b81547b2e4ab5a2 (Bug 351053 - Remove the need for WorkspaceCommandStackImpl)
Branches: origin/b0_8_x, b0_8_x

Bug 351053 - Remove the need for WorkspaceCommandStackImpl
Comment 5 Michael Wenz CLA 2012-06-28 10:37:27 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)