Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to add new DragDropEditPolicy(Adding new DragDropEditPolicy where there are other edit-policies already installed)
How to add new DragDropEditPolicy [message #506216] Wed, 06 January 2010 15:14 Go to next message
Gidi Weber is currently offline Gidi WeberFriend
Messages: 3
Registered: January 2010
Junior Member
We are trying to add some customized drag-and-drop logic, when dropping certain EObjects onto the Diagram Editor in IDA (InfoSphere Data Architect) 7.5.2 - based on Eclipse 3.4.2.

We defined a new edit-policy class and registered it with highest priority by using the edit-policy provider
(extension point:org.eclipse.gmf.runtime.diagram.ui.editpolicyProviders).

It seems that the new edit-policy is installed, but then gets overwritten by the IDA native edit-policy
(com.ibm.datatools.diagram.logical.internal.ie.editpolicies. IEDnDEditPolicy), and our customized logic is never executed.

1. Is it possible to register two edit-policies with the same priority?
2. How can we make sure that our edit-policy will work without interfering with existing/future edit-policies?

Thank you very much for your help.
Regards,
Gidi
Re: How to add new DragDropEditPolicy [message #513048 is a reply to message #506216] Mon, 08 February 2010 16:33 Go to previous messageGo to next message
Gidi Weber is currently offline Gidi WeberFriend
Messages: 3
Registered: January 2010
Junior Member
does anyone have any idea for a solution/workaround for this problem? any input would be highly appreciated.
Re: How to add new DragDropEditPolicy [message #513528 is a reply to message #513048] Wed, 10 February 2010 13:30 Go to previous messageGo to next message
Romain Bioteau is currently offline Romain BioteauFriend
Messages: 64
Registered: August 2009
Location: Grenoble
Member
Le 08/02/2010 17:33, Gidi Weber a écrit :
> does anyone have any idea for a solution/workaround for this problem?
> any input would be highly appreciated.

Hi Gidi,
afaik there isn't any priority management for edit policies.
EditPolicies have keys. If you want to override the existing D'n'D
behavior you should remove the existing D'n'D EditPolicy first
(removeEditPolicy(String key))

But you could also add your own editpolicy in addition to the existing
ones. Just call installEditPolicy(yourOwnKey,new
YourCustomizeDnDEditPolicy()) in createDefaultEditPolicies() of EditPart

I Hope it will help...

Regards,
Romain


R&D Engineer at BonitaSoft
Re: How to add new DragDropEditPolicy [message #513536 is a reply to message #513528] Wed, 10 February 2010 14:18 Go to previous message
Gidi Weber is currently offline Gidi WeberFriend
Messages: 3
Registered: January 2010
Junior Member
Thank you very much Romain, this has been great help!
Best regards,
Gidi
Previous Topic:Changing anchor location and z-order of connections
Next Topic:Automatically resize figure based on label size
Goto Forum:
  


Current Time: Sun Sep 23 22:24:55 GMT 2018

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

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

Back to the top