multiple CommandStack with an unique EditingDomain [message #46662] |
Tue, 12 September 2006 15:14 |
Eclipse User |
|
|
|
Originally posted by: marguu.libero.it
In my own GMF editor I use an unique EditingDomain in order to use only =
a =
semantic model for more notation diagrams. In this manner I have the sid=
e =
effect to use also a unique CommandStack. For example:
a) I create the diagram A and the diagram B
b) I add the element 1 in the diagram A
c) I add the element 2 in the diagram B
d) I switch again in the diagram A
e) I undo the last change
In this manner I delete the element 2 in the diagram B, not the element =
1 =
in the diagram A as I aspect
How can I workaround this problem?
Thanks in advance
Angelo Marguglio
-- =
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
|
|
|
Re: multiple CommandStack with an unique EditingDomain [message #47579 is a reply to message #46662] |
Thu, 14 September 2006 00:30 |
Eclipse User |
|
|
|
Originally posted by: cdamus.ca.ibm.com
Hi, Angelo,
The IWorkspaceCommandStack that GMF uses with its editing domain
implementation supports exactly this requirement. What you need is to
have:
- your semantic model in one resource
- your diagrams in one or more other resources
Then, you need to add an IOperationHistoryListener to the command stack's
IOperationHistory (to which it delegates the stack management) to add an
IUndoContext to IUndoableOperations when they are executed on the history.
Define an IUndoContext for each diagram editor (a ResourceUndoContext is
convenient, representing the diagram resource in the editor) and attach it
to any IUndoableOperation (on the semantic model) that affects the
corresponding diagram. Associate the Undo and Redo menu for each editor
with its corresponding IUndoContext, and you should have independent
undo/redo for the actions done in each editor (except where the same action
affects multiple diagrams).
To see how this might work, follow the execution of operations in the EMFT
Transaction API's workspace integration example editor. Every instance of
this editor loads its resource in the same editing domain, and resolution
of cross-resource proxies (that causes additional resources to load) loads
resources in separate editors. To install the example in your workspace,
select the "File -> New -> Example..." action and choose the "EMFT
Transaction/Workspace Integration Example". The EMFT Workspace Integration
Developer Guide in the on-line help has a blurb describing what this
example does, and a tutorial explaining how it works.
HTH,
Christian
Angelo Marguglio wrote:
> In my own GMF editor I use an unique EditingDomain in order to use only a
> semantic model for more notation diagrams. In this manner I have the side
> effect to use also a unique CommandStack. For example:
>
> a) I create the diagram A and the diagram B
> b) I add the element 1 in the diagram A
> c) I add the element 2 in the diagram B
> d) I switch again in the diagram A
> e) I undo the last change
>
> In this manner I delete the element 2 in the diagram B, not the element 1
> in the diagram A as I aspect
>
> How can I workaround this problem?
>
> Thanks in advance
> Angelo Marguglio
>
|
|
|
Re: multiple CommandStack with an unique EditingDomain [message #49557 is a reply to message #47579] |
Mon, 18 September 2006 07:34 |
Eclipse User |
|
|
|
Originally posted by: marguu.libero.it
Hi! I'd like to see another example. Can someone suggest me that?
Thanks in advance
In data Thu, 14 Sep 2006 02:30:54 +0200, Christian W. Damus
<cdamus@ca.ibm.com> ha scritto:
>
> Hi, Angelo,
>
> The IWorkspaceCommandStack that GMF uses with its editing domain
> implementation supports exactly this requirement. What you need is to
> have:
>
> - your semantic model in one resource
> - your diagrams in one or more other resources
>
> Then, you need to add an IOperationHistoryListener to the command stack's
> IOperationHistory (to which it delegates the stack management) to add an
> IUndoContext to IUndoableOperations when they are executed on the
> history.
> Define an IUndoContext for each diagram editor (a ResourceUndoContext is
> convenient, representing the diagram resource in the editor) and attach
> it
> to any IUndoableOperation (on the semantic model) that affects the
> corresponding diagram. Associate the Undo and Redo menu for each editor
> with its corresponding IUndoContext, and you should have independent
> undo/redo for the actions done in each editor (except where the same
> action
> affects multiple diagrams).
>
> To see how this might work, follow the execution of operations in the
> EMFT
> Transaction API's workspace integration example editor. Every instance
> of
> this editor loads its resource in the same editing domain, and resolution
> of cross-resource proxies (that causes additional resources to load)
> loads
> resources in separate editors. To install the example in your workspace,
> select the "File -> New -> Example..." action and choose the "EMFT
> Transaction/Workspace Integration Example". The EMFT Workspace
> Integration
> Developer Guide in the on-line help has a blurb describing what this
> example does, and a tutorial explaining how it works.
>
> HTH,
>
> Christian
>
>
> Angelo Marguglio wrote:
>
>> In my own GMF editor I use an unique EditingDomain in order to use only
>> a
>> semantic model for more notation diagrams. In this manner I have the
>> side
>> effect to use also a unique CommandStack. For example:
>>
>> a) I create the diagram A and the diagram B
>> b) I add the element 1 in the diagram A
>> c) I add the element 2 in the diagram B
>> d) I switch again in the diagram A
>> e) I undo the last change
>>
>> In this manner I delete the element 2 in the diagram B, not the element
>> 1
>> in the diagram A as I aspect
>>
>> How can I workaround this problem?
>>
>> Thanks in advance
>> Angelo Marguglio
>>
>
--
Creato con il rivoluzionario client e-mail di Opera:
http://www.opera.com/mail/
|
|
|
Powered by
FUDForum. Page generated in 0.03609 seconds