Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Selective DND using isEnabled?
Selective DND using isEnabled? [message #239530] Thu, 01 November 2007 22:51 Go to next message
Adam Cabler is currently offline Adam CablerFriend
Messages: 113
Registered: July 2009
Senior Member
Hello,
I am trying to implement some DND operations between my views and GEF
editors. I want to be able to have the cursor updated based on where
things can and can't be dropped. It seems that overridding isEnabled in
the DropTargetListener would be a great place for this, but for some
reason, dragSetData on the DragSource isn't called until after you try
to drop, so event.data is always null at this time. And setting the
data on dragStart has no effect (weird). This seems like a common thing
to do, so I'm sure I'm missing something here...

thanks,
adam
Re: Selective DND using isEnabled? [message #239536 is a reply to message #239530] Fri, 02 November 2007 00:38 Go to previous message
Adam Cabler is currently offline Adam CablerFriend
Messages: 113
Registered: July 2009
Senior Member
Of course, posting always means I'll find the answer. Just saw this
from Veronika:

See DropTarget section of :
http://eclipse.org/articles/Article-SWT-DND/DND-in-SWT.html

What you are trying to do is only supported on Windows:

public void dragOver(DropTargetEvent event) {
event.feedback = DND.FEEDBACK_SELECT | DND.FEEDBACK_SCROLL;
if (textTransfer.isSupportedType(event.currentDataType)) {
// NOTE: on unsupported platforms this will return null
Object o = textTransfer.nativeToJava(event.currentDataType);
String t = (String)o;
if (t != null) System.out.println(t);
}
}


AdamC wrote:
> Hello,
> I am trying to implement some DND operations between my views and GEF
> editors. I want to be able to have the cursor updated based on where
> things can and can't be dropped. It seems that overridding isEnabled
> in the DropTargetListener would be a great place for this, but for
> some reason, dragSetData on the DragSource isn't called until after
> you try to drop, so event.data is always null at this time. And
> setting the data on dragStart has no effect (weird). This seems like
> a common thing to do, so I'm sure I'm missing something here...
>
> thanks,
> adam
Previous Topic:zoom in/out and polylineconnection
Next Topic:Making EditParts visible but not selectable
Goto Forum:
  


Current Time: Fri Apr 19 16:09:31 GMT 2024

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

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

Back to the top