|Command Stack change and save action [message #754168]
||Tue, 01 November 2011 07:29
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 07:29]
Report message to a moderator
|Re: Command Stack change and save action [message #754174 is a reply to message #754171]
||Tue, 01 November 2011 08:06
hi thanks ,|
i have overriden the canundo method and returned true like this
* @see org.eclipse.gef.commands.Command#canUndo()
public boolean canUndo()
// TODO Auto-generated method stub
still its not working .
my class extends abstractgraphicaleditpart and not graphicaleditor. so you told If you are not inheriting from GraphicalEditor, you will have to update the action from within a command stack listener yourself.
how to update the actions . could you please post in the code?
Powered by FUDForum
. Page generated in 0.11096 seconds