DnD PluginTransfer from Navigator [message #1698844] |
Thu, 18 June 2015 11:08  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
Christian Pontesegger wrote on Thu, 18 June 2015 07:08Is 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  |
Eclipse User |
|
|
|
Brian de Alwis wrote on Thu, 18 June 2015 14:10You 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.
|
|
|
Powered by
FUDForum. Page generated in 0.02748 seconds