Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 196962

Summary: [DnD] PluginDropAdapter does allow to drop PluginTransfer everywhere
Product: [Eclipse Project] Platform Reporter: Benno Baumgartner <benno.baumgartner>
Component: UIAssignee: Platform UI Triaged <platform-ui-triaged>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: vvandervooren
Version: 3.3Keywords: helpwanted
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug
Bug Depends on:    
Bug Blocks: 71065    

Description Benno Baumgartner CLA 2007-07-18 10:31:07 EDT
I20070717-1020

IDropActionDelegate should somehow be able to indicate if a target is valid. This would allow to give an appropriate feedback in a view that supports the PluginTransfer and has a PluginDropAdapter drop listener.

At the moment the mouse cursor indicates that a drop is possible on any element all the time as soon as a PluginTransfer is available, which is not very satisfying.

I thought about something like:
public boolean canMoveTo(Object target);
public boolean canCopyTo(Object target);
public boolean canLinkTo(Object target);
Comment 1 Eric Moffatt CLA 2007-09-28 15:00:45 EDT
Benno, you don't by chance have a test project around for this do you?
Comment 2 Benno Baumgartner CLA 2007-10-01 08:46:04 EDT
(In reply to comment #1)
> Benno, you don't by chance have a test project around for this do you?
> 

Mmm, there used to be a working example attached to http://www.eclipse.org/articles/Article-Workbench-DND/drag_drop.html But it does not work anymore. The plugin contributed a view which is a drag source for plugin transfers. The Package explorer is a target for plugin transfers. The PE allows to drop the Plugin Transfere everywhere, although it should allow it only on IContainer objects.
Comment 3 Viv van der Vooren CLA 2007-11-12 03:28:57 EST
I also encountered this issue. 
I created an IValidatingDropActionDelegate which is derived from IDropActionDelegate
When a drag action is initiated with an IValidatingDropActionDelegate, I store the ID of the delegate in a global singleton. 
When the drag finishes, I set the ID back to null.
When supporting the PluginTransfer in 'validateDrop' of a drop target, I check if the singleton identifies a delegate - if so, I try to instantiate the delegate and invoke it's validateDrop method

This all works fine when working within one Eclipse instance but if I try to drag from one Eclipse to another of course, the target Eclipse of course no longer has the delegate's ID set and so validateDrop can't be called. 

If there was some way of storing information during a drag operation and passing this information on to a drop operation this could be used to solve this problem as then the delegate's ID could be passed on to the Drop operation. 
Comment 4 Eclipse Webmaster CLA 2019-09-06 15:32:44 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.
Comment 5 Eclipse Genie CLA 2021-11-20 20:15:13 EST
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. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. 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.