Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » DnD PluginTransfer from Navigator
DnD PluginTransfer from Navigator [message #1698844] Thu, 18 June 2015 11:08 Go to next message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 250
Registered: July 2009
Location: Graz, Austria
Senior Member
I have a view allowing DnD for multiple transfer types. When doing a DnD operation from a navigator view I would like to receive an IResource. This works perfectly when adding the ResourceTransfer type.

Now when I also want to add generc drop support by adding PluginTransfer drop support to my view, a navigator drop suddenly switches to PluginTransfer for the drop operation.

As I simply want to extract the name of the IResource to display it, the navigator drop now fails.

Is there a reason that the generic PluginTransfer has priority over a specialized transfer type (in this case ResourceTransfer)?
Re: DnD PluginTransfer from Navigator [message #1698887 is a reply to message #1698844] Thu, 18 June 2015 14:10 Go to previous messageGo to next message
Eclipse UserFriend
Christian Pontesegger wrote on Thu, 18 June 2015 07:08
Is there a reason that the generic PluginTransfer has priority over a specialized transfer type (in this case ResourceTransfer)?


Hmm, I wouldn't describe the PluginTransfer as 'generic' as much as 'allows specialization'. You may have an item (like a JDT IJavaElement) that is backed and can be adapted to an IResource, but if there is some drop support specific to IJavaElement, I'm pretty sure most would want the drop treated an IJavaElement rather than an Resource.

The real problem here (IMHO) is that the CN is not sufficiently flexible to allow customizing DND (e.g., my bugs 422627 and 422501).

Brian.
Re: DnD PluginTransfer from Navigator [message #1698893 is a reply to message #1698887] Thu, 18 June 2015 14:51 Go to previous message
Christian Pontesegger is currently offline Christian PonteseggerFriend
Messages: 250
Registered: July 2009
Location: Graz, Austria
Senior Member
Brian de Alwis wrote on Thu, 18 June 2015 14:10
You may have an item (like a JDT IJavaElement) that is backed and can be adapted to an IResource, but if there is some drop support specific to IJavaElement, I'm pretty sure most would want the drop treated an IJavaElement rather than an Resource.


There is the SelectionTransfer, which could solve that issue quite fine. I thought the order of the defined TransferTypes in SWT would denote the priority. So if a drop target states
target.setTransfer(new Transfer[] { FileTransfer.getInstance(), TextTransfer.getInstance(), ResourceTransfer.getInstance() });


I would expect SWT to first try to generate a FileTransfer Drop. If not possible try a TextTransfer and so on. But this does not seem to be the case.
Previous Topic:How to add command contribution plugin to the Eclipse "Quick Access" for all perspectives?
Next Topic:How to do a dynamic tracing in Eclipse?
Goto Forum:
  


Current Time: Wed Apr 24 23:33:14 GMT 2024

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

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

Back to the top