Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » How to create a hierarchy of objects in one command?
How to create a hierarchy of objects in one command? [message #391936] Tue, 22 March 2005 08:54 Go to next message
Jaap Reitsma is currently offline Jaap Reitsma
Messages: 69
Registered: July 2009
Member
Hi,

I want to create an object and all necessary ancestors in a single command
for undo support, like in XPath notation:

Segment/CreationInformation/Creation/Abstract/FreeTextAnnota tion

I want to add/modify the FreeTextAnnotation, but its ancestors up to Segment
(my selection) might not yet exist.

I suppose I should use the CompoundCommand. But how? What is the pattern?
Should I use the ItemProviders?

Kind regards,

Jaap Reitsma
Re: How to create a hierarchy of objects in one command? [message #391937 is a reply to message #391936] Tue, 22 March 2005 09:07 Go to previous message
Ed Merks is currently offline Ed Merks
Messages: 24550
Registered: July 2009
Senior Member
Jaap,

Only the attachment of the new object, or the change to the existing
FreeTextAnnotation needs to be done with a command. The object you add
can be prepopulated and that does not need to be done with commands
because it does not need to be undone. If you do need to compose
commands, then you need to use a CompoundCommand. Look at examples of
where it is used in the framework, e.g., SetCommand.


Jaap Reitsma wrote:

>Hi,
>
>I want to create an object and all necessary ancestors in a single command
>for undo support, like in XPath notation:
>
> Segment/CreationInformation/Creation/Abstract/FreeTextAnnota tion
>
>I want to add/modify the FreeTextAnnotation, but its ancestors up to Segment
>(my selection) might not yet exist.
>
>I suppose I should use the CompoundCommand. But how? What is the pattern?
>Should I use the ItemProviders?
>
>Kind regards,
>
>Jaap Reitsma
>
>
>
>
>
Previous Topic:Accessing ItemProviderAdapter
Next Topic:DanglingHREFException
Goto Forum:
  


Current Time: Wed May 22 17:25:02 EDT 2013

Powered by FUDForum. Page generated in 0.01634 seconds