Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc) » using WorkspaceCommandStack of EMFT Transaction
using WorkspaceCommandStack of EMFT Transaction [message #36018] |
Mon, 05 June 2006 08:27 |
Eclipse User |
|
|
|
Originally posted by: hocnt.cybersoft-vn.com
Hi ALL,
I'm using EMFT Transaction. Actually I have an issue with the Undo/Redo
feature: the Undo menu is still enabled after all actions have been
undone. In other word, after executing a command, the Undo menu becomes
enabled and enabled forever. I don't know what's wrong with this. Does
anyone have an idea about that?
Thanks,
Hoc
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #36086 is a reply to message #36018] |
Mon, 05 June 2006 11:34 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Hoc,
The title of your posting includes the word "WorkspaceCommandStack". Are
you using a WorkspaceCommandStack to execute Commands, or are you using the
IOperationHistory to execute IUndoableOperations? In either case, you
should be using the operation history API's UndoActionHandler and
RedoActionHandler in the Edit menu. The EMF UndoAction and RedoAction
won't work so well with a WorkspaceCommandStack.
See the org.eclipse.emf.workspace.examples.library.editor example for undo
and redo actions that extend EMF's implementation and delegate to the
operation history API's handlers.
HTH,
Christian
Hoc Nguyen wrote:
> Hi ALL,
>
> I'm using EMFT Transaction. Actually I have an issue with the Undo/Redo
> feature: the Undo menu is still enabled after all actions have been
> undone. In other word, after executing a command, the Undo menu becomes
> enabled and enabled forever. I don't know what's wrong with this. Does
> anyone have an idea about that?
>
> Thanks,
> Hoc
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #36188 is a reply to message #36086] |
Tue, 06 June 2006 05:25 |
Eclipse User |
|
|
|
Originally posted by: hocnt.cybersoft-vn.com
Thank you very much for your support, Christian.
With the overriding UndoActionWrapper and RedoActionWrapper classes, the
Undo/Redo feature now works nicely. However, another issue is raises:
the Save icon of the standard toolbar does not update its
disabled/enabled status accordingly with the Undo/Redo menu. For example:
* The Undo menu is disabled
* Change the name of an model object
* the Undo menu is enabled: OK
* the Save icon is enabled: OK
* the editor is dirty: OK
* Undo the 'change name' action
* the Undo menu is disabled: OK
* the Redo menu is enabled: OK
* the save icon is still enabled: KO -> need to fix
* the editor is still dirty: KO -> need to fix
I need to dig into your example more.
Regards,
Hoc
Christian W. Damus wrote:
> Hi, Hoc,
>
> The title of your posting includes the word "WorkspaceCommandStack". Are
> you using a WorkspaceCommandStack to execute Commands, or are you using the
> IOperationHistory to execute IUndoableOperations? In either case, you
> should be using the operation history API's UndoActionHandler and
> RedoActionHandler in the Edit menu. The EMF UndoAction and RedoAction
> won't work so well with a WorkspaceCommandStack.
>
> See the org.eclipse.emf.workspace.examples.library.editor example for undo
> and redo actions that extend EMF's implementation and delegate to the
> operation history API's handlers.
>
> HTH,
>
> Christian
>
>
> Hoc Nguyen wrote:
>
>
>>Hi ALL,
>>
>>I'm using EMFT Transaction. Actually I have an issue with the Undo/Redo
>>feature: the Undo menu is still enabled after all actions have been
>>undone. In other word, after executing a command, the Undo menu becomes
>>enabled and enabled forever. I don't know what's wrong with this. Does
>>anyone have an idea about that?
>>
>>Thanks,
>>Hoc
>
>
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #36255 is a reply to message #36188] |
Tue, 06 June 2006 05:29 |
Eclipse User |
|
|
|
Originally posted by: hocnt.cybersoft-vn.com
Sorry, I mean the new issue in my application, not in the example
application of EMF.
Hoc
Hoc Nguyen wrote:
> Thank you very much for your support, Christian.
>
> With the overriding UndoActionWrapper and RedoActionWrapper classes, the
> Undo/Redo feature now works nicely. However, another issue is raises:
> the Save icon of the standard toolbar does not update its
> disabled/enabled status accordingly with the Undo/Redo menu. For example:
>
> * The Undo menu is disabled
> * Change the name of an model object
> * the Undo menu is enabled: OK
> * the Save icon is enabled: OK
> * the editor is dirty: OK
> * Undo the 'change name' action
> * the Undo menu is disabled: OK
> * the Redo menu is enabled: OK
> * the save icon is still enabled: KO -> need to fix
> * the editor is still dirty: KO -> need to fix
>
> I need to dig into your example more.
>
> Regards,
> Hoc
>
> Christian W. Damus wrote:
>
>> Hi, Hoc,
>>
>> The title of your posting includes the word "WorkspaceCommandStack". Are
>> you using a WorkspaceCommandStack to execute Commands, or are you
>> using the
>> IOperationHistory to execute IUndoableOperations? In either case, you
>> should be using the operation history API's UndoActionHandler and
>> RedoActionHandler in the Edit menu. The EMF UndoAction and RedoAction
>> won't work so well with a WorkspaceCommandStack.
>>
>> See the org.eclipse.emf.workspace.examples.library.editor example for
>> undo
>> and redo actions that extend EMF's implementation and delegate to the
>> operation history API's handlers.
>>
>> HTH,
>>
>> Christian
>>
>>
>> Hoc Nguyen wrote:
>>
>>
>>> Hi ALL,
>>>
>>> I'm using EMFT Transaction. Actually I have an issue with the Undo/Redo
>>> feature: the Undo menu is still enabled after all actions have been
>>> undone. In other word, after executing a command, the Undo menu becomes
>>> enabled and enabled forever. I don't know what's wrong with this. Does
>>> anyone have an idea about that?
>>>
>>> Thanks,
>>> Hoc
>>
>>
>>
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #36289 is a reply to message #36086] |
Tue, 06 June 2006 06:26 |
Eclipse User |
|
|
|
Originally posted by: hocnt.cybersoft-vn.com
Hi Christian,
I'm sorry for posting many replies here, but when I run the
org.eclipse.emf.workspace.examples.extlibrary.presentation.E XTLibraryEditor
, the Undo/Redo feature works fine but something wrong with the status
of the 'Save' icon of the standard action bar. For example:
* The Undo menu is disabled
* Change the name of an model object
* the Undo menu is enabled: OK
* the Save icon is enabled: OK
* the editor is dirty: OK
* Undo the 'change name' action
* the Undo menu is disabled: OK
* the Redo menu is enabled: OK
* the save icon is still enabled: KO -> need to fix
* the editor is still dirty: KO -> need to fix
Do you have any idea about how to fix that?
Thanks,
Hoc
Christian W. Damus wrote:
> Hi, Hoc,
>
> The title of your posting includes the word "WorkspaceCommandStack". Are
> you using a WorkspaceCommandStack to execute Commands, or are you using the
> IOperationHistory to execute IUndoableOperations? In either case, you
> should be using the operation history API's UndoActionHandler and
> RedoActionHandler in the Edit menu. The EMF UndoAction and RedoAction
> won't work so well with a WorkspaceCommandStack.
>
> See the org.eclipse.emf.workspace.examples.library.editor example for undo
> and redo actions that extend EMF's implementation and delegate to the
> operation history API's handlers.
>
> HTH,
>
> Christian
>
>
> Hoc Nguyen wrote:
>
>
>>Hi ALL,
>>
>>I'm using EMFT Transaction. Actually I have an issue with the Undo/Redo
>>feature: the Undo menu is still enabled after all actions have been
>>undone. In other word, after executing a command, the Undo menu becomes
>>enabled and enabled forever. I don't know what's wrong with this. Does
>>anyone have an idea about that?
>>
>>Thanks,
>>Hoc
>
>
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #36384 is a reply to message #36289] |
Tue, 06 June 2006 12:51 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Hoc,
The WorkspaceCommandStackImpl keeps track of the IUndoableOperation that was
at the top of its "stack" (as defined by the default undo context) when the
last save occurred. This mechanism relies on the editor simply using the
command stack as an EMF CommandStack that passes Commands through to the
IOperationHistory.
The reason why this doesn't work in the example editor is that it actually
doesn't use the stack's default undo context. In fact, it deliberately
removes the default context and replaces it with its own editor context (in
the historyListener's callback method). If the example didn't do this,
then the editor's dirty state would probably be alright because the stack's
isSaveNeeded() method would return the right answer.
However, the example editor cannot use the stack's default context because
that would enforce a single linear undo stack across all instances of the
editor, because they share a single editing domain. This editor's purpose
is to demonstrate the independence of undo/redo in different editors on
different resources in the same editing domain.
If you want your editor to work in the same way, then your editor will
probably have to tag operations with a save context in similar fashion for
itself. Have a look at the WorkspaceCommandStackImpl's saveIsDone() and
isSaveNeeded() methods.
Cheers,
Christian
Hoc Nguyen wrote:
> Hi Christian,
> I'm sorry for posting many replies here, but when I run the
>
org.eclipse.emf.workspace.examples.extlibrary.presentation.E XTLibraryEditor
> , the Undo/Redo feature works fine but something wrong with the status
> of the 'Save' icon of the standard action bar. For example:
>
> * The Undo menu is disabled
> * Change the name of an model object
> * the Undo menu is enabled: OK
> * the Save icon is enabled: OK
> * the editor is dirty: OK
> * Undo the 'change name' action
> * the Undo menu is disabled: OK
> * the Redo menu is enabled: OK
> * the save icon is still enabled: KO -> need to fix
> * the editor is still dirty: KO -> need to fix
>
> Do you have any idea about how to fix that?
> Thanks,
> Hoc
>
<snip>
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #579676 is a reply to message #36018] |
Mon, 05 June 2006 11:34 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Hoc,
The title of your posting includes the word "WorkspaceCommandStack". Are
you using a WorkspaceCommandStack to execute Commands, or are you using the
IOperationHistory to execute IUndoableOperations? In either case, you
should be using the operation history API's UndoActionHandler and
RedoActionHandler in the Edit menu. The EMF UndoAction and RedoAction
won't work so well with a WorkspaceCommandStack.
See the org.eclipse.emf.workspace.examples.library.editor example for undo
and redo actions that extend EMF's implementation and delegate to the
operation history API's handlers.
HTH,
Christian
Hoc Nguyen wrote:
> Hi ALL,
>
> I'm using EMFT Transaction. Actually I have an issue with the Undo/Redo
> feature: the Undo menu is still enabled after all actions have been
> undone. In other word, after executing a command, the Undo menu becomes
> enabled and enabled forever. I don't know what's wrong with this. Does
> anyone have an idea about that?
>
> Thanks,
> Hoc
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #579799 is a reply to message #36086] |
Tue, 06 June 2006 05:25 |
Eclipse User |
|
|
|
Originally posted by: hocnt.cybersoft-vn.com
Thank you very much for your support, Christian.
With the overriding UndoActionWrapper and RedoActionWrapper classes, the
Undo/Redo feature now works nicely. However, another issue is raises:
the Save icon of the standard toolbar does not update its
disabled/enabled status accordingly with the Undo/Redo menu. For example:
* The Undo menu is disabled
* Change the name of an model object
* the Undo menu is enabled: OK
* the Save icon is enabled: OK
* the editor is dirty: OK
* Undo the 'change name' action
* the Undo menu is disabled: OK
* the Redo menu is enabled: OK
* the save icon is still enabled: KO -> need to fix
* the editor is still dirty: KO -> need to fix
I need to dig into your example more.
Regards,
Hoc
Christian W. Damus wrote:
> Hi, Hoc,
>
> The title of your posting includes the word "WorkspaceCommandStack". Are
> you using a WorkspaceCommandStack to execute Commands, or are you using the
> IOperationHistory to execute IUndoableOperations? In either case, you
> should be using the operation history API's UndoActionHandler and
> RedoActionHandler in the Edit menu. The EMF UndoAction and RedoAction
> won't work so well with a WorkspaceCommandStack.
>
> See the org.eclipse.emf.workspace.examples.library.editor example for undo
> and redo actions that extend EMF's implementation and delegate to the
> operation history API's handlers.
>
> HTH,
>
> Christian
>
>
> Hoc Nguyen wrote:
>
>
>>Hi ALL,
>>
>>I'm using EMFT Transaction. Actually I have an issue with the Undo/Redo
>>feature: the Undo menu is still enabled after all actions have been
>>undone. In other word, after executing a command, the Undo menu becomes
>>enabled and enabled forever. I don't know what's wrong with this. Does
>>anyone have an idea about that?
>>
>>Thanks,
>>Hoc
>
>
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #579843 is a reply to message #36188] |
Tue, 06 June 2006 05:29 |
Eclipse User |
|
|
|
Originally posted by: hocnt.cybersoft-vn.com
Sorry, I mean the new issue in my application, not in the example
application of EMF.
Hoc
Hoc Nguyen wrote:
> Thank you very much for your support, Christian.
>
> With the overriding UndoActionWrapper and RedoActionWrapper classes, the
> Undo/Redo feature now works nicely. However, another issue is raises:
> the Save icon of the standard toolbar does not update its
> disabled/enabled status accordingly with the Undo/Redo menu. For example:
>
> * The Undo menu is disabled
> * Change the name of an model object
> * the Undo menu is enabled: OK
> * the Save icon is enabled: OK
> * the editor is dirty: OK
> * Undo the 'change name' action
> * the Undo menu is disabled: OK
> * the Redo menu is enabled: OK
> * the save icon is still enabled: KO -> need to fix
> * the editor is still dirty: KO -> need to fix
>
> I need to dig into your example more.
>
> Regards,
> Hoc
>
> Christian W. Damus wrote:
>
>> Hi, Hoc,
>>
>> The title of your posting includes the word "WorkspaceCommandStack". Are
>> you using a WorkspaceCommandStack to execute Commands, or are you
>> using the
>> IOperationHistory to execute IUndoableOperations? In either case, you
>> should be using the operation history API's UndoActionHandler and
>> RedoActionHandler in the Edit menu. The EMF UndoAction and RedoAction
>> won't work so well with a WorkspaceCommandStack.
>>
>> See the org.eclipse.emf.workspace.examples.library.editor example for
>> undo
>> and redo actions that extend EMF's implementation and delegate to the
>> operation history API's handlers.
>>
>> HTH,
>>
>> Christian
>>
>>
>> Hoc Nguyen wrote:
>>
>>
>>> Hi ALL,
>>>
>>> I'm using EMFT Transaction. Actually I have an issue with the Undo/Redo
>>> feature: the Undo menu is still enabled after all actions have been
>>> undone. In other word, after executing a command, the Undo menu becomes
>>> enabled and enabled forever. I don't know what's wrong with this. Does
>>> anyone have an idea about that?
>>>
>>> Thanks,
>>> Hoc
>>
>>
>>
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #579872 is a reply to message #36086] |
Tue, 06 June 2006 06:26 |
Eclipse User |
|
|
|
Originally posted by: hocnt.cybersoft-vn.com
Hi Christian,
I'm sorry for posting many replies here, but when I run the
org.eclipse.emf.workspace.examples.extlibrary.presentation.E XTLibraryEditor
, the Undo/Redo feature works fine but something wrong with the status
of the 'Save' icon of the standard action bar. For example:
* The Undo menu is disabled
* Change the name of an model object
* the Undo menu is enabled: OK
* the Save icon is enabled: OK
* the editor is dirty: OK
* Undo the 'change name' action
* the Undo menu is disabled: OK
* the Redo menu is enabled: OK
* the save icon is still enabled: KO -> need to fix
* the editor is still dirty: KO -> need to fix
Do you have any idea about how to fix that?
Thanks,
Hoc
Christian W. Damus wrote:
> Hi, Hoc,
>
> The title of your posting includes the word "WorkspaceCommandStack". Are
> you using a WorkspaceCommandStack to execute Commands, or are you using the
> IOperationHistory to execute IUndoableOperations? In either case, you
> should be using the operation history API's UndoActionHandler and
> RedoActionHandler in the Edit menu. The EMF UndoAction and RedoAction
> won't work so well with a WorkspaceCommandStack.
>
> See the org.eclipse.emf.workspace.examples.library.editor example for undo
> and redo actions that extend EMF's implementation and delegate to the
> operation history API's handlers.
>
> HTH,
>
> Christian
>
>
> Hoc Nguyen wrote:
>
>
>>Hi ALL,
>>
>>I'm using EMFT Transaction. Actually I have an issue with the Undo/Redo
>>feature: the Undo menu is still enabled after all actions have been
>>undone. In other word, after executing a command, the Undo menu becomes
>>enabled and enabled forever. I don't know what's wrong with this. Does
>>anyone have an idea about that?
>>
>>Thanks,
>>Hoc
>
>
|
|
|
Re: using WorkspaceCommandStack of EMFT Transaction [message #579934 is a reply to message #36289] |
Tue, 06 June 2006 12:51 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Hoc,
The WorkspaceCommandStackImpl keeps track of the IUndoableOperation that was
at the top of its "stack" (as defined by the default undo context) when the
last save occurred. This mechanism relies on the editor simply using the
command stack as an EMF CommandStack that passes Commands through to the
IOperationHistory.
The reason why this doesn't work in the example editor is that it actually
doesn't use the stack's default undo context. In fact, it deliberately
removes the default context and replaces it with its own editor context (in
the historyListener's callback method). If the example didn't do this,
then the editor's dirty state would probably be alright because the stack's
isSaveNeeded() method would return the right answer.
However, the example editor cannot use the stack's default context because
that would enforce a single linear undo stack across all instances of the
editor, because they share a single editing domain. This editor's purpose
is to demonstrate the independence of undo/redo in different editors on
different resources in the same editing domain.
If you want your editor to work in the same way, then your editor will
probably have to tag operations with a save context in similar fashion for
itself. Have a look at the WorkspaceCommandStackImpl's saveIsDone() and
isSaveNeeded() methods.
Cheers,
Christian
Hoc Nguyen wrote:
> Hi Christian,
> I'm sorry for posting many replies here, but when I run the
>
org.eclipse.emf.workspace.examples.extlibrary.presentation.E XTLibraryEditor
> , the Undo/Redo feature works fine but something wrong with the status
> of the 'Save' icon of the standard action bar. For example:
>
> * The Undo menu is disabled
> * Change the name of an model object
> * the Undo menu is enabled: OK
> * the Save icon is enabled: OK
> * the editor is dirty: OK
> * Undo the 'change name' action
> * the Undo menu is disabled: OK
> * the Redo menu is enabled: OK
> * the save icon is still enabled: KO -> need to fix
> * the editor is still dirty: KO -> need to fix
>
> Do you have any idea about how to fix that?
> Thanks,
> Hoc
>
<snip>
|
|
|
Goto Forum:
Current Time: Sat Nov 09 00:54:02 GMT 2024
Powered by FUDForum. Page generated in 0.04346 seconds
|