Drag and drop java elements from the package explorer [message #252161] |
Thu, 20 March 2008 13:39 |
Eclipse User |
|
|
|
Hello,
I'm currently reading Eric Clayberg and Dan Rubel's book about eclipse
plugins, implementing their Favorites example as I'm progressing.
Now, I'm at the part that shows how to drag and drop elements to the
Favorites view. The problem is that it works fine for resource elements
for not for java elements. In the latter case, the handler receives an
event the _data_ field of which has 0 elements.
To be more precise, there's a FavoritesDropTarget class which extends
DropTargetAdapter. In its constructor, it creates a new DropTarget,
specifying:
target.setTransfer(new Transfer[] {
JavaUI.getJavaElementClipboardTransfer(),
ResourceTransfer.getInstance()});
Then, the FavoritesDropTarget overrides the _dragEnter_ and _drop_ methods.
The _drop_ method takes a DropTargetEvent as an argument and when I try
dragging a java element from the Package Explorer to the Favorites View,
the _data_ field of the event is an array of size 0. It works fine for
resource elements.
I'd be really thankful if could help me :)
Many thanks in advance,
--
Damien Thivolle
|
|
|
Powered by
FUDForum. Page generated in 0.02809 seconds