|
Re: Migrating Drag and Drop to 3.1 [message #208364 is a reply to message #208314] |
Wed, 01 February 2006 17:36 |
Eclipse User |
|
|
|
Originally posted by: enorman.webmethods.com
I believe AbstractTransferDropTargetListener also implements the
org.eclipse.jface.util.TransferDropTargetListener interface, so you could
just cast it to get rid of the warning.
getGraphicalViewer().addDropTargetListener((org.eclipse.jfac e.util.TransferD
ropTargetListener)new YourDropTargetListener(getGraphicalViewer(), this));
you can just cast the object to the other interface since
"Thomas Maier" <Thomas.Maier@uni-kassel.de> wrote in message
news:43DF5E01.6010900@uni-kassel.de...
> Hi all,
>
> is there a migration guide for drag and drop? Right now I am
> registering a (custom) class FileTransferDropTargetListener that extends
> org.eclipse.gef.dnd.AbstractTransferDropTargetListener by calling
>
> getGraphicalViewer().addDropTargetListener(new
> FileTransferDropTargetListener(getGraphicalViewer()));
>
> in my GEF editor's initializeGraphicalViewer() method. However,
> org.eclipse.gef.dnd.AbstractTransferDropTargetListener implements
> org.eclipse.gef.dnd.TransferDropTargetListener, which is deprecated (so
> the deprecated version of .addDropTargetListener() is called).
>
> The javadoc tells me to use
> org.eclipse.jface.util.TransferDropTargetListener instead. However,
> this is a jface class and not a GEF one so it does not know about
> requests and commands and all that.
>
> Is there an easy way to migrate my code and what do I have to do?
>
> Thanks and regards, Thomas.
|
|
|
Re: Migrating Drag and Drop to 3.1 [message #208568 is a reply to message #208364] |
Mon, 06 February 2006 19:50 |
Thomas Maier Messages: 117 Registered: July 2009 |
Senior Member |
|
|
Yes, thanks, Eric, I see it really does, because
org.eclipse.gef.dnd.TransferDropTargetListener extends
org.eclipse.jface.util.TransferDropTargetListener.
So I guess this deprecation is just to get rid of the (empty) interface
org.eclipse.gef.dnd.TransferDropTargetListener? Maybe because during
transition to 3.1 jface got its own (and did not have one before, just a
guess, though)? And so I can safely continue using
org.eclipse.gef.dnd.AbstractTransferDropTargetListener?
Eric Norman schrieb:
> I believe AbstractTransferDropTargetListener also implements the
> org.eclipse.jface.util.TransferDropTargetListener interface, so you could
> just cast it to get rid of the warning.
>
> getGraphicalViewer().addDropTargetListener((org.eclipse.jfac e.util.TransferD
> ropTargetListener)new YourDropTargetListener(getGraphicalViewer(), this));
>
> you can just cast the object to the other interface since
> "Thomas Maier" <Thomas.Maier@uni-kassel.de> wrote in message
> news:43DF5E01.6010900@uni-kassel.de...
>
>>Hi all,
>>
>>is there a migration guide for drag and drop? Right now I am
>>registering a (custom) class FileTransferDropTargetListener that extends
>>org.eclipse.gef.dnd.AbstractTransferDropTargetListener by calling
>>
>>getGraphicalViewer().addDropTargetListener(new
>>FileTransferDropTargetListener(getGraphicalViewer()));
>>
>>in my GEF editor's initializeGraphicalViewer() method. However,
>>org.eclipse.gef.dnd.AbstractTransferDropTargetListener implements
>>org.eclipse.gef.dnd.TransferDropTargetListener, which is deprecated (so
>>the deprecated version of .addDropTargetListener() is called).
>>
>>The javadoc tells me to use
>>org.eclipse.jface.util.TransferDropTargetListener instead. However,
>>this is a jface class and not a GEF one so it does not know about
>>requests and commands and all that.
>>
>>Is there an easy way to migrate my code and what do I have to do?
>>
>>Thanks and regards, Thomas.
|
|
|
Powered by
FUDForum. Page generated in 1.30578 seconds