Bug 99905 - [RCP] [DnD] Extract EditorInput drag'n'drop from EditorAreaDropAdapter out of org.eclipse.ui.ide plugin
Summary: [RCP] [DnD] Extract EditorInput drag'n'drop from EditorAreaDropAdapter out of...
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 3.1   Edit
Hardware: PC All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform UI Triaged CLA
QA Contact:
URL:
Whiteboard:
Keywords: api, helpwanted
Depends on:
Blocks:
 
Reported: 2005-06-14 04:35 EDT by Michal Tkacz CLA
Modified: 2019-09-06 16:08 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michal Tkacz CLA 2005-06-14 04:35:38 EDT
Dragging EditorInputData into the editor area using EditorInputTransfer is a
general functionality that is not specific to an IDE. However part of this
functionality is now implemented inside
org.eclipse.ui.internal.ide.EditorAreaDropAdapter which makes it impossible to
use it in an RCP application without either having a dependency on
org.eclipse.ui.ide or copying the implementation.
This class should be refactored so that the functionality concerning
EditorInputTransfer is moved into a base class available outside
org.eclipse.ui.ide plugin (probably in org.eclipse.ui.workbench plugin?).
Comment 1 Nick Edgar CLA 2005-06-14 13:31:06 EDT
EditorAreaDropAdapter is IDE-specific, having knowledge about resource-specific
types like IResource and IMarker, not just the general IEditorInput.

RCP apps can configure their own editor area drop support using
IWorkbenchWindowConfigurer.addEditorAreaTransfer and
configureEditorAreaDropListener.

To see how this is done in the IDE, see IDEWorkbenchWindowAdvisor.preWindowOpen().

Note that the general EditorInputTransfer is API in the generic workbench.

I agree that the factoring here could be improved though.
In particular, it would be good to be able to register different drop handlers
for the different transfer types.

Also, there's no real reason for these to be "privileged" API in the advisors. 
It should be possible to contribute editor area drop handlers via a regular
extension point.
Comment 2 Michal Tkacz CLA 2005-06-14 13:57:32 EDT
Yes, I've seen IDEWorkbenchWindowAdvisor.preWindowOpen() and I know that
EditorAreaDropAdapter handles not only EditorInputTransfer and therefore has
dependency on IDE classes. I thought the first step to improve that would be to
make this class extend a new class containing only EditorInputTransfer related
functionality and located outside org.eclipse.ui.ide that could be reused in
RCP. Of course registering drop handlers via extension point would be great too :)
Comment 3 Nick Edgar CLA 2005-06-14 14:30:04 EDT
I'd prefer to have a more extensible solution than just enabling subclassing.
Comment 4 Nick Edgar CLA 2006-03-15 11:24:31 EST
Reassigning bugs in component areas that are changing ownership.
Comment 5 David Kyle CLA 2009-08-25 14:24:07 EDT
Any progress on this enhancement? I think I was burned by this in bug 287486.
Comment 6 Boris Bokowski CLA 2009-08-25 14:34:09 EDT
From bug 287486 comment #5:

> (In reply to comment #4)
> > right, but StyledTextDropTargetEffect#dropAccept sets currentOffset to -1.
> > do you know why dropAccept is not being called ?
> 
> Yes, the problem was at our end. <sound of hand smacking head/>
> 
> We implement our own WorkbenchWindowAdvisor which did not setup drag and drop
> support for the editor area while IDEWorkbenchWindowAdvisor.preWindowOpen()
> does.
> 
> During the dragOver event call, the EditorSiteDragAndDropServiceImpl's internal
> MergedDropTarget.getAppropriateListener(DropTargetEvent, boolean) is called and
> it does not have a secondaryListener to handle the dragOver. A null is returned
> and all hell breaks loose.
> 
> Simply adding the following to our own WorkbenchWindowAdvisor implementation
> solved the problem.
> 
>   @Override
>   public void preWindowOpen() {
>     IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
>     ....
>     configurer.configureEditorAreaDropListener(new EditorAreaDropAdapter(
>                 configurer.getWindow()));
>   }
> 
> Looks like this is related to #99905. 
> 
> A quick search shows no documentation stating the above code must be called.
> The built in RCP examples does not include it.
> 
> Thank you for your time.
> 
Comment 7 Boris Bokowski CLA 2009-08-25 14:35:29 EDT
Eric, this looks like EditorSiteDragAndDropServiceImpl is making an assumption that does not hold for RCP apps - would you be able to investigate?
Comment 8 Boris Bokowski CLA 2009-11-26 16:15:42 EST
Prakash is now responsible for watching bugs in the [RCP] component area.
Comment 9 Eclipse Webmaster CLA 2019-09-06 16:08:36 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.