| How can I combine nested feature calls in one command [message #972030] |
Mon, 05 November 2012 04:49  |
Raghava Rao Messages: 62 Registered: July 2009 |
Member |
|
|
Hello All,
I am executing nested feature calls in one feature.
In command stack those will be different commands. On Undo and Redo every feature call will appear as separate command.
I want to combine all in one command.Is there any way to do this?
I want to avoid update command in commandstack, i want to combine update command with previous executed command.Can I do this in Graphiti?
Advance thanks for your reply.
Thanks,
Raghav
|
|
|
|
|
|
|
| Re: How can I combine nested feature calls in one command [message #986195 is a reply to message #985799] |
Mon, 19 November 2012 07:18   |
Raghava Rao Messages: 62 Registered: July 2009 |
Member |
|
|
Hello Michael,
Thanks for your reply.
you reply answered my question.I am directly calling respective features execute methods with in a the feature.Now I am able to see the command stack with main feature.
But this undo/redo is not working properly.
Looks like Undo/ redo operations are also getting executed in the Command Stack.
If I create three shapes E, C ,F in order.
On First Undo it should remove F
On Second Undo It should remove C
On Third Undo It should remove E
I think this should be behaviour for undo.But last undo operation also exected in Command stack.
Is this a bug in graphiti?
One more question regarding Update command..
if Editor and Properties view are using same transcational editing domain.so all the command will be executed in one command stack.
Any Model change will lead to update command in Editor.
So In command stack last command will be Update command.On undo shape will not have updated model data,so red font will be displayed to respective Shape.
How can I avoid this? How can avoid adding Update command to command stack.
please suggest me.
Thanks,
Raghav
[Updated on: Mon, 19 November 2012 07:18] Report message to a moderator
|
|
|
|
|
| Re: How can I combine nested feature calls in one command [message #986950 is a reply to message #986864] |
Thu, 22 November 2012 08:51  |
Aljoscha Hark Messages: 22 Registered: March 2012 |
Junior Member |
|
|
Hello,
regarding to the independence of the property sheet page:
When you are implementing the properties as tabbed properties and its sections are implemented in a similar way as described in the Graphiti tutorial (extending GFPropertySection), you would have the ability to access the active IDiagramEditor, IDiagramTypeProvider and therefore the IFeatureProvider to do a updateIfPossibleAndNeeded(IUpdateContext) after the model change.
To be more concrete:
- we have a simple class representation (a white rectangle with a black border and a text showing the name).
- we change the name of a selected class in the (tabbed) property sheet.
- the UpdateFeature for that element will update the visible name.
during/after the change in the properties, the GFPropertySection (say, ClassNameSection) executes an IFeature on the IDiagramEditor with an appropriate IContext. The IFeature wraps the model change [EObject.eSet(EStructuralFeature)] and calls IFeatureProvider.updateIfPossibleAndNeeded(IUpdateContext) with appropriate data.
I think (hope!) this would wrap all changes to the model and the visual representation (including the update) into one command. I did not try that by myself right now...
When it works it would be glad when you report back. I think the 'wrapping way' would be helpful in some of my cases, too.
Greetings,
Aljoscha
|
|
|
Powered by
FUDForum. Page generated in 0.04072 seconds