Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Dragging into a Common Navigator problem.
icon5.gif  Dragging into a Common Navigator problem. [message #1043471] Wed, 17 April 2013 18:54 Go to next message
Craig Foote is currently offline Craig Foote
Messages: 195
Registered: July 2009
Senior Member
I have a Common Navigator view and need to drop custom modeled objects from a custom view into the navigator. I have a DragSourceAdapter attached to the custom view's viewer and a ResourceDropAdapterAssistant copy that I've customized to handle dropping those custom objects by creating files for them. But I can't get it to work:

1. DragSourceAdapter#dragSetData is called after ResourceDropAdapterAssistant#validateDrop so I have no access to the dragged object in the #validate. I'm working around this by getting the selection from the SelectionService.

2. ResourceDropAdapterAssistant#handleDrop is never called.

3. After the first time #validate is called, the icon overlay changes to the one indicating drop is not possible, #validate is never called again until I restart the app.

Is this even possible to do? Is there a problem with interactions between the CommonDropAdapterAssistant (which ResourceDropAdapterAssistant extends) and the DragSourceListener (which DragSourceAdapter extends)? Any ideas would be really appreciated.

Craig Foote
Re: Dragging into a Common Navigator problem. [message #1044143 is a reply to message #1043471] Thu, 18 April 2013 14:40 Go to previous message
Craig Foote is currently offline Craig Foote
Messages: 195
Registered: July 2009
Senior Member
A followup to what I've just found. Apparently you can't use <enablement> and <possibleChildren> or strange things happen. So I added my <possibleChildren> expression to my <enablement> expression and now #handleDrop is being called. I think there might still be a problem, perhaps even a bug, in that #dragSetData is called after #validateDrop, so the dragged items aren't available to examine in #validateDrop to do conditional validation. My workaround of using the SelectionService just feels like a hack but it's working so far.

Craig
Previous Topic:How to enable handler with condition like context1 || context2 || context3
Next Topic:Product Root file Shows no copyright information
Goto Forum:
  


Current Time: Thu Oct 23 21:20:54 GMT 2014

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

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