Bug 515028 - [package explorer] DnD: SelectionDropAdapter has prio over PluginDropAdapter
Summary: [package explorer] DnD: SelectionDropAdapter has prio over PluginDropAdapter
Status: CLOSED WONTFIX
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.7   Edit
Hardware: PC Linux
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: JDT-UI-Inbox CLA
QA Contact:
URL:
Whiteboard: stalebug
Keywords: needinfo
Depends on:
Blocks: 465109
  Show dependency tree
 
Reported: 2017-04-10 09:08 EDT by Christian Pontesegger CLA
Modified: 2019-10-09 03:08 EDT (History)
1 user (show)

See Also:


Attachments
Sample project (3.53 KB, application/zip)
2017-04-24 07:11 EDT, Christian Pontesegger CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Pontesegger CLA 2017-04-10 09:08:58 EDT
The Package Explorer accepts SelectionTransfers and PluginTransfers. However it seems that SelectionTransfers cannot be implemented in an external application to work correctly with the Package Explorer.

Unfortunately SelectionTransfer seems to have precedence (at least as soon as the drop target becomes an IResource).

If now a drag source supports both [SelectionTransfer, PluginTransfer] it is impossible to add support for the Package Explorer.

Interestingly my demo source implements org.eclipse.jface.util.LocalSelectionTransfer while in SelectionTransferDropAdapter#182 org.eclipse.ui.views.navigator.LocalSelectionTransfer is referenced.

However I can only make DnD work by removing the LocalSelectionTransfer type in my drag source.
Comment 1 Dani Megert CLA 2017-04-10 10:15:00 EDT
Your bug report contains two "seems" ;-).

Please provide either a test case or steps based on Eclipse SDK 4.7 M6 that allow us to reproduce the problem. Thanks.
Comment 2 Christian Pontesegger CLA 2017-04-10 11:35:30 EDT
Steps to reproduce:

1) Provide an implementation for org.eclipse.ui.dropActions
2) Provide a dragsource that only supports PluginTransfer
3) verify that YourDropActionDelegate.run() gets called on a drop action

4) now let your dragsource also support org.eclipse.jface.util.LocalSelectionTransfer

see that DnD to project explorer no longer works: YourDropActionDelegate.run() does not get called when dropping to an IResource
Comment 3 Christian Pontesegger CLA 2017-04-10 11:36:26 EDT
(In reply to Christian Pontesegger from comment #2)
> see that DnD to project explorer no longer works:

...DnD to Package Explorer... of course
Comment 4 Dani Megert CLA 2017-04-10 11:42:14 EDT
(In reply to Christian Pontesegger from comment #2)
> Steps to reproduce:
> 
> 1) Provide an implementation for org.eclipse.ui.dropActions
> 2) Provide a dragsource that only supports PluginTransfer
> 3) verify that YourDropActionDelegate.run() gets called on a drop action
> 
> 4) now let your dragsource also support
> org.eclipse.jface.util.LocalSelectionTransfer
> 
> see that DnD to project explorer no longer works:
> YourDropActionDelegate.run() does not get called when dropping to an
> IResource

We won't spend time to build that test case. If you will have to attach a test case or example.
Comment 5 Christian Pontesegger CLA 2017-04-24 07:11:20 EDT
Created attachment 267936 [details]
Sample project

Sample project added. The project contains a view 'Bug 515028' with a text box. Selections from there can be dropped to the Navigator. The DropActionDelegate will open a popup when it gets called.

Uncommenting line ViewPart.java#35 will show the invalid behavior.
Comment 6 Eclipse Genie CLA 2019-10-09 03:08:38 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.