Dragging into a Common Navigator problem. [message #1043471] |
Wed, 17 April 2013 18:54 |
|
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 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03397 seconds