Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » EMF.Edit Updating Lists(Is there a convinient way of updarting a list using the EMF Edit Commands)
EMF.Edit Updating Lists [message #714663] Thu, 11 August 2011 08:18 Go to next message
Philipp M. Fischer is currently offline Philipp M. FischerFriend
Messages: 67
Registered: November 2010
Location: Germany
Member
HI All,

I need to update a list on an EMF object using the EMF.Edit command framework.

So there is an object A that contains a list of objects B. The order of the objects of B are important for me.

So in case the order of the objects B is changed in my GUI it needs to be set in the datamodel as well. Unfortunately tehre are just commands to remove or add items from a collection, but not to just update the collection.

Removing the old results and just add the new ones does not work as well. Since it needs to be done in one go, i have to use a compound command which realizes that i am adding the same objects i just removed and it stops execution.

Does anyone have a good idea?

Cheers

Phil
Re: EMF.Edit Updating Lists [message #714811 is a reply to message #714663] Thu, 11 August 2011 14:30 Go to previous message
Eclipse UserFriend
Originally posted by:

org.eclipse.emf.edit.command.MoveCommand

The move command logically acts upon an owner object that has a
collection-based feature containing an object that is to be moved to a
new position within the collection. The static create method delegates
command creation to EditingDomain.createCommand, which may or may not
result in the actual creation of an instance of this class. Like all the
low level commands in this package, the move command is undoable.

The implementation of this class is low-level and EMF specific; it
allows an object to be moved to a new position within a many-valued
feature of an owner, i.e., it is equivalent of the call


((EList)((EObject)owner).eGet((EStructuralFeature)feature)).move(index,
object);

On 11.08.11 10.18, Phil M. Fischer wrote:
> HI All,
>
> I need to update a list on an EMF object using the EMF.Edit command
> framework.
>
> So there is an object A that contains a list of objects B. The order of
> the objects of B are important for me.
> So in case the order of the objects B is changed in my GUI it needs to
> be set in the datamodel as well. Unfortunately tehre are just commands
> to remove or add items from a collection, but not to just update the
> collection.
>
> Removing the old results and just add the new ones does not work as
> well. Since it needs to be done in one go, i have to use a compound
> command which realizes that i am adding the same objects i just removed
> and it stops execution.
>
> Does anyone have a good idea?
>
> Cheers
>
> Phil
Previous Topic:Is the EMF search project still active?
Next Topic:XML comments missed
Goto Forum:
  


Current Time: Thu Apr 25 22:17:37 GMT 2024

Powered by FUDForum. Page generated in 0.02456 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top