Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » EMF, GEF and GMF commands
EMF, GEF and GMF commands [message #180181] Tue, 01 April 2008 15:08 Go to next message
Manfred Hahn is currently offline Manfred HahnFriend
Messages: 64
Registered: July 2009
Member
Hi,

I am completely confused about the usage of commands in respect to the gef
edit policies and the emf model.

I have to change my model when a connection is deleted. So I'm going to
change the getDestroyElementCommand() in the generated
XxxItemSemanticEditPolicy. To change the model inside the
TransactionalEditingDomain there are emf commands like RecordingCommand or
AbstractEMFOperation. But from the getDestroyElementCommand() I have to
return a GEF command. I have noticed there is a possibility to wrap a
EMFCommand to a GMF ICommand. But in my context this is no help.

The GMF online help though it has a CommandFramework description doesn't
fit to my problem.

Can you tell me what I should do?

With regards
Manfred
Re: EMF, GEF and GMF commands [message #180196 is a reply to message #180181] Tue, 01 April 2008 15:55 Go to previous message
Gilles Cannenterre is currently offline Gilles CannenterreFriend
Messages: 38
Registered: July 2009
Member
Hello Manfred,

To built your own command you may extend the
AbstractTransactionnalCommand (a GMF command implementing ICommand from
the gmf runtime) and wrap the command instance in an ICommandProxy(your
command) (returning GEF command from an ICommand of the gmf runtime) for
execution.

You can find references to the ICommandProxy in the generated
XXXBaseItemSemanticEditPolicy of your gmf diagram:

protected final Command getGEFWrapper(ICommand cmd) {
return new ICommandProxy(cmd);
}


Regards,

Gilles.

Manfred Hahn a écrit :
> Hi,
>
> I am completely confused about the usage of commands in respect to the
> gef edit policies and the emf model.
>
> I have to change my model when a connection is deleted. So I'm going to
> change the getDestroyElementCommand() in the generated
> XxxItemSemanticEditPolicy. To change the model inside the
> TransactionalEditingDomain there are emf commands like RecordingCommand
> or AbstractEMFOperation. But from the getDestroyElementCommand() I have
> to return a GEF command. I have noticed there is a possibility to wrap a
> EMFCommand to a GMF ICommand. But in my context this is no help.
>
> The GMF online help though it has a CommandFramework description doesn't
> fit to my problem.
>
> Can you tell me what I should do?
>
> With regards
> Manfred
>
Previous Topic:Object under object
Next Topic:[gmf] can't define Type Based Links for my dsm
Goto Forum:
  


Current Time: Fri Apr 26 23:36:27 GMT 2024

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

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

Back to the top