Skip to main content



      Home
Home » Eclipse Projects » GEF » DND for .class files?
DND for .class files? [message #93612] Wed, 10 September 2003 18:48 Go to next message
Eclipse UserFriend
Originally posted by: felix.mayer.cingular.com

In there a way I can drag and drop a Java .class file onto a GEF diagram?
My listener's AbstractTransferDropTargetListener.isEnabled() doesn't even
get called when I try to move such a file over.
Re: DND for .class files? [message #93780 is a reply to message #93612] Thu, 11 September 2003 11:05 Go to previous messageGo to next message
Eclipse UserFriend
What type of Transfer are you using? Did you add the listener to the
GraphicalViewer? I have an article on the website that walks you
through adding DND to the logic example to drop files onto the editor.
This sounds similar. If you haven't already, check it out at
http://eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html

Eric



Felix Mayer wrote:
> In there a way I can drag and drop a Java .class file onto a GEF diagram?
> My listener's AbstractTransferDropTargetListener.isEnabled() doesn't even
> get called when I try to move such a file over.
>
Re: DND for .class files? [message #93810 is a reply to message #93780] Thu, 11 September 2003 11:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: felix.mayer.cingular.com

I guess I should have mentioned that I do have DND working just fine for
normal Java source files (.java extension) with a FileTransfer (somehow
TextTransfer doesn't work).

Now I am trying to drag a compiled Java class (.class extension) from a
JAR within my project on the diagram. With my still limited knowledge I
would expect that AbstractTransferDropTargetListener.isEnabled() is called
to check if my listener supports this kind of drop. I checked with the
debugger, but this method simply is not called when I try to drag a .class
file.

I also noticed that while it is possible to DND a .java file onto the
editor area to just get the editor opened, this is not the case with a
class from a JAR file. You can only doubleclick to open it (at least in
Eclipse 2.1.1). Therefore I am wondering if there is maybe limitation in
the Package Explorer; this would be a pity because I could really use this
functionality.

Eric Bordeau wrote:

> What type of Transfer are you using? Did you add the listener to the
> GraphicalViewer? I have an article on the website that walks you
> through adding DND to the logic example to drop files onto the editor.
> This sounds similar. If you haven't already, check it out at
> http://eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html

> Eric



> Felix Mayer wrote:
> > In there a way I can drag and drop a Java .class file onto a GEF diagram?
> > My listener's AbstractTransferDropTargetListener.isEnabled() doesn't even
> > get called when I try to move such a file over.
> >
Re: DND for .class files? [message #93884 is a reply to message #93810] Thu, 11 September 2003 16:06 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

isEnabled will only be called if the TransferTypes match between the
DragSource and the DropTarget. This is why you need to verify that the
transfer itself is allowed, since that is a pre-req to isEnabled being
called.
"Felix Mayer" <felix.mayer@cingular.com> wrote in message
news:bjq4ot$ern$1@eclipse.org...
> I guess I should have mentioned that I do have DND working just fine for
> normal Java source files (.java extension) with a FileTransfer (somehow
> TextTransfer doesn't work).
>
> Now I am trying to drag a compiled Java class (.class extension) from a
> JAR within my project on the diagram. With my still limited knowledge I
> would expect that AbstractTransferDropTargetListener.isEnabled() is called
> to check if my listener supports this kind of drop. I checked with the
> debugger, but this method simply is not called when I try to drag a .class
> file.
>
> I also noticed that while it is possible to DND a .java file onto the
> editor area to just get the editor opened, this is not the case with a
> class from a JAR file. You can only doubleclick to open it (at least in
> Eclipse 2.1.1). Therefore I am wondering if there is maybe limitation in
> the Package Explorer; this would be a pity because I could really use this
> functionality.
>
> Eric Bordeau wrote:
>
> > What type of Transfer are you using? Did you add the listener to the
> > GraphicalViewer? I have an article on the website that walks you
> > through adding DND to the logic example to drop files onto the editor.
> > This sounds similar. If you haven't already, check it out at
> > http://eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html
>
> > Eric
>
>
>
> > Felix Mayer wrote:
> > > In there a way I can drag and drop a Java .class file onto a GEF
diagram?
> > > My listener's AbstractTransferDropTargetListener.isEnabled() doesn't
even
> > > get called when I try to move such a file over.
> > >
>
>
Re: DND for .class files? [message #93914 is a reply to message #93810] Thu, 11 September 2003 16:40 Go to previous message
Eclipse UserFriend
I don't even think the package explorer allows dragging of class files
that are in jars. If you drag a java file, the cursor will change (at
first to a "not" symbol, then to the appropriate DND cursor when you're
allowed to drop). When I try to drag a class file from a jar, the
cursor doesn't change, indicating there isn't a drag starting at all.

You might want to post to the jdt newsgroup to find out if class files
can be dragged from within a jar.

Eric


Felix Mayer wrote:
> I guess I should have mentioned that I do have DND working just fine for
> normal Java source files (.java extension) with a FileTransfer (somehow
> TextTransfer doesn't work).
>
> Now I am trying to drag a compiled Java class (.class extension) from a
> JAR within my project on the diagram. With my still limited knowledge I
> would expect that AbstractTransferDropTargetListener.isEnabled() is called
> to check if my listener supports this kind of drop. I checked with the
> debugger, but this method simply is not called when I try to drag a .class
> file.
>
> I also noticed that while it is possible to DND a .java file onto the
> editor area to just get the editor opened, this is not the case with a
> class from a JAR file. You can only doubleclick to open it (at least in
> Eclipse 2.1.1). Therefore I am wondering if there is maybe limitation in
> the Package Explorer; this would be a pity because I could really use this
> functionality.
>
> Eric Bordeau wrote:
>
>
>>What type of Transfer are you using? Did you add the listener to the
>>GraphicalViewer? I have an article on the website that walks you
>>through adding DND to the logic example to drop files onto the editor.
>>This sounds similar. If you haven't already, check it out at
>>http://eclipse.org/articles/Article-GEF-dnd/GEF-dnd.html
>
>
>>Eric
>
>
>
>
>>Felix Mayer wrote:
>>
>>>In there a way I can drag and drop a Java .class file onto a GEF diagram?
>>>My listener's AbstractTransferDropTargetListener.isEnabled() doesn't even
>>>get called when I try to move such a file over.
>>>
>
>
>
Previous Topic:cyclic directed graph layout in GEF 2.2 Release
Next Topic:Deleting Connections
Goto Forum:
  


Current Time: Tue Jul 22 14:52:29 EDT 2025

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

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

Back to the top