Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Question about CreateViewAndElementRequest
Question about CreateViewAndElementRequest [message #101234] Tue, 06 February 2007 02:47 Go to next message
Eclipse UserFriend
Hi, dear all

I'm extending an existing GMF editor and add drag&drop behavior to that
editor.

I've successfully created and installed editpolicy to provide the
drag&drop behavior. And when user of the diagram editor drop a object
into the diagram, I need to create and config a new node and
corresponding semantic element in the diagram.

So I created a CreateViewAndElementRequest and using
editpart.getCommand(createRequest) to get corresponding command. If I
use this Command object as return value of
DragDropEditPolicy.getDropObjectsCommand(), the diagram node and
semantic element are created correctly.

The problem is I hope to config the newly created object immediately
after it got created. I guess it might need a CompositeCommand which
contains two commands:
1. Command object from getCommand() function.
2. A new kind of Command object to config the newly created object

The problem is how to get the newly created objects in the 2nd Command
object.

Any suggestions are welcome!

James Gan
Re: Question about CreateViewAndElementRequest [message #135333 is a reply to message #101234] Tue, 12 June 2007 14:26 Go to previous message
Eclipse UserFriend
Hi James,

I don't know if you have already solve your problem...
I think but I'm not sure that you can use the "chain" method in your
command object. hope that will help you...

I'm interesting in your getDropObjectsCommand() method, could you please
send it?


Bertrand



Zhi Gan a écrit :

> Hi, dear all
>
> I'm extending an existing GMF editor and add drag&drop behavior to that
> editor.
>
> I've successfully created and installed editpolicy to provide the
> drag&drop behavior. And when user of the diagram editor drop a object
> into the diagram, I need to create and config a new node and
> corresponding semantic element in the diagram.
>
> So I created a CreateViewAndElementRequest and using
> editpart.getCommand(createRequest) to get corresponding command. If I
> use this Command object as return value of
> DragDropEditPolicy.getDropObjectsCommand(), the diagram node and
> semantic element are created correctly.
>
> The problem is I hope to config the newly created object immediately
> after it got created. I guess it might need a CompositeCommand which
> contains two commands:
> 1. Command object from getCommand() function.
> 2. A new kind of Command object to config the newly created object
>
> The problem is how to get the newly created objects in the 2nd Command
> object.
>
> Any suggestions are welcome!
>
> James Gan
Previous Topic:Propsheet Customization
Next Topic:Properties editor is empty
Goto Forum:
  


Current Time: Sat Mar 08 02:38:43 EST 2025

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

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

Back to the top