Command Stack change and save action [message #754168] |
Tue, 01 November 2011 03:29  |
Eclipse User |
|
|
|
hello friends,
i have an gef based editor the changes in the model causes the isdirty state of the editor to become true and enables the save action .
i have an figure in an editpart for which i have added mouse listener , the mouse presssed event of the listener will causes the figure to resize . the resize is done using an class the executes the command class and i execute it from the editpart by calling the getcommandstack method of the editor instance .
inSpireDesignerEditor.getDomain().getCommandStack().execute( cmd );
i have two problems now .
1. the undo of the command that executed is not working
2. as the figure resizes using the mouse event , the editor save button is not getting enabled , but the is dirty property is true. how to manually eneble the save action from an editpart
[Updated on: Tue, 01 November 2011 03:29] by Moderator
|
|
|
|
|
Re: Command Stack change and save action [message #755563 is a reply to message #754174] |
Tue, 08 November 2011 14:50  |
Eclipse User |
|
|
|
Take a look into GraphicalEditor#init(IEditorSite, IEditorInput), where the editor gets registered as command stack listener, and within the GraphicalEditor#commandStackChanged(EventObject) method, which in turn gets called upon changes. It calls updateActions(List) to update all actions that depend on changes being made to the command stack.
|
|
|
Powered by
FUDForum. Page generated in 0.05950 seconds