Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Enabling drag-n-drop from palette
Enabling drag-n-drop from palette [message #685925] Mon, 20 June 2011 15:21 Go to next message
Alex Kravets is currently offline Alex Kravets
Messages: 370
Registered: November 2009
Senior Member
Hello,

I found this discussion on enabling DND from the palette in GMF generated editor. Changes work, but when I drag a palette item over any edit part in the editor feedback always shows that drop is permitted, even if particular edit part does not accept object being created. Is this expected behavior?

Thanks,
Alex
Re: Enabling drag-n-drop from palette [message #685980 is a reply to message #685925] Tue, 21 June 2011 04:59 Go to previous message
Giovanni De Sossi is currently offline Giovanni De Sossi
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi Alex,

take a look at the [XYZ]DiagramItemSemanticEditPolicy: here, in the getCreateCommand(CreateElementRequest req) method, you can disable the creation of unwanted objects simply returning "null"; this way, you have the "forbidden" cursor icon.

HTH, bye

Giovanni
Previous Topic:Resizing subclasses of LabelEditPart
Next Topic:GMF Databaseconnection Issue
Goto Forum:
  


Current Time: Tue Jul 22 23:44:50 EDT 2014

Powered by FUDForum. Page generated in 0.02126 seconds