Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Dnd in diagram editor fires two event each call canAdd
Dnd in diagram editor fires two event each call canAdd [message #698311] Tue, 19 July 2011 08:54 Go to next message
Joerg Reichert is currently offline Joerg ReichertFriend
Messages: 80
Registered: July 2009
Location: Leipzig
Member
Hello,

I have implemented a tree viewer for my model so I can drag and drop nodes from that viewer to the diagram editor. The feature provider extracts the model element from the tree node and returns the responsible Add feature. This works so far. Then I added a dialog popping up when the dragged model element is not allowed to be add. This is done in the canAdd method of the Add feature. But this dialog twice as the canAdd method is called twice, once by the dragEnter event and a second time by the dragOver event. Is there any reason why the dragEnter event calls the canAdd method? How can this be adapted?

Regards,
Joerg


--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: Dnd in diagram editor fires two event each call canAdd [message #698854 is a reply to message #698311] Wed, 20 July 2011 11:27 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Jörg,

this is simply the standard GEF behaviour. It checks if drag&drop is allowed
and might be used to display the stop sign.

Michael

"Joerg Reichert" schrieb im Newsbeitrag
news:j03g52$dfr$1@news.eclipse.org...

Hello,

I have implemented a tree viewer for my model so I can drag and drop nodes
from that viewer to the diagram editor. The feature provider extracts the
model element from the tree node and returns the responsible Add feature.
This works so far. Then I added a dialog popping up when the dragged model
element is not allowed to be add. This is done in the canAdd method of the
Add feature. But this dialog twice as the canAdd method is called twice,
once by the dragEnter event and a second time by the dragOver event. Is
there any reason why the dragEnter event calls the canAdd method? How can
this be adapted?

Regards,
Joerg
--
--
Need professional support for Xtext and EMF?
Go to: http://xtext.itemis.com
Re: Dnd in diagram editor fires two event each call canAdd [message #698861 is a reply to message #698854] Wed, 20 July 2011 11:43 Go to previous message
Joerg Reichert is currently offline Joerg ReichertFriend
Messages: 80
Registered: July 2009
Location: Leipzig
Member
ok, so that is the default behaviour and I will leave it that way, although it might be informative for the user why a certain DnD operation is prohibited.

Nevertheless thanks for clarification
Joerg
Previous Topic:Migrating the Graphiti sources from CVS to GIT
Next Topic:Disable guides
Goto Forum:
  


Current Time: Fri Apr 26 19:40:48 GMT 2024

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

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

Back to the top