Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Need some EditPolicy related help
Need some EditPolicy related help [message #210527] Thu, 06 November 2008 07:42 Go to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi! All,

I have used DnD feature for dragging an element from treeviewer to
GMF editor.
When drop is occuring on rectangular figure (inside editor), i want to
create another child rectangular figure in it.

Could you please suggest - how to do that? Which EditPolicy should I
install?
If possible, please provide some code snippet.


Regards,
Manoj
Re: Need some EditPolicy related help [message #210577 is a reply to message #210527] Thu, 06 November 2008 11:46 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Manoj,

Try to handling D&D request for this particular child figure. You have to
install DiagramDragDropEditPolicy inside corresponding XXXEditPart.createDefaultEditPolicies()
method and handle drop request there. As an example you can use XXEditPart
generated for the diagram element - it has corresponding EditPolicy generated,
but you have to completely modify getDropObjectsCommand() to return a command
creating "copy" of the element being dropped.

-----------------
Alex Shatalin
Re: Need some EditPolicy related help [message #210600 is a reply to message #210577] Thu, 06 November 2008 12:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Thanks Alex,

Regards,
Manoj

Alex Shatalin wrote:
> Hello Manoj,
>
> Try to handling D&D request for this particular child figure. You have
> to install DiagramDragDropEditPolicy inside corresponding
> XXXEditPart.createDefaultEditPolicies() method and handle drop request
> there. As an example you can use XXEditPart generated for the diagram
> element - it has corresponding EditPolicy generated, but you have to
> completely modify getDropObjectsCommand() to return a command creating
> "copy" of the element being dropped.
>
> -----------------
> Alex Shatalin
>
>
Re: Need some EditPolicy related help [message #210663 is a reply to message #210577] Fri, 07 November 2008 04:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: manojm.blr.interrasystems.com

Hi! Alex,

Could you please provide some code snippet or any reference to the same?

Regards,
Manoj

Alex Shatalin wrote:
> Hello Manoj,
>
> Try to handling D&D request for this particular child figure. You have
> to install DiagramDragDropEditPolicy inside corresponding
> XXXEditPart.createDefaultEditPolicies() method and handle drop request
> there. As an example you can use XXEditPart generated for the diagram
> element - it has corresponding EditPolicy generated, but you have to
> completely modify getDropObjectsCommand() to return a command creating
> "copy" of the element being dropped.
>
> -----------------
> Alex Shatalin
>
>
Re: Need some EditPolicy related help [message #210789 is a reply to message #210663] Mon, 10 November 2008 11:41 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Manoj,

> Could you please provide some code snippet or any reference to the
> same?
Did you seen XXXEditPart.createDefaultEditPolicies() for the diagram EditPart
generated by GMF? You have to generate diagram code with shortcuts feature
enabled and then you’ll see examples of necessary code there.

-----------------
Alex Shatalin
Previous Topic:Logic to calculate bendpoints for a polyline connection in rectilinear routing
Next Topic:Cannot open logic example diagram
Goto Forum:
  


Current Time: Fri Apr 19 18:41:09 GMT 2024

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

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

Back to the top