Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » DragAndDrop
DragAndDrop [message #228231] Mon, 18 December 2006 08:50 Go to next message
Eclipse UserFriend
Originally posted by:

Hi everybode,

I have some problems implementing DnD. I want to drag items from a view to
a graphical editor. That works fine with one item (I'm using the
'AbstractTransferDropTargetListener'). But now I want to be able to drag
and drop multiple items. The problem is on the TargetListener side,
because it internally request the objetc creation. so, do I have to
provide my own implmentation of a TargetDropListener or can I somehow use
the 'AbstractTransferDropTargetListener'?


Re: DragAndDrop [message #228288 is a reply to message #228231] Tue, 19 December 2006 06:54 Go to previous messageGo to next message
Alex Boyko is currently offline Alex BoykoFriend
Messages: 200
Registered: July 2009
Senior Member

Perhaps you could extend AbstractTransferDropTargetListener and provide
your own implementation for #getObjectsBeingDropped(), i.e. get the
transfer object, cast it into Java object and then in StructuredSelection
probably... then you could examine what's in the selection and create a
list of objects that are being dropped in the graphical viewer (model
elements most likely). Then using these objects and mouse location a
request can be created and used to create the command by edit policies.
I'm not an expert in this area, but perhaps this would help.

Re: DragAndDrop [message #228338 is a reply to message #228288] Tue, 19 December 2006 16:05 Go to previous message
Eclipse UserFriend
Originally posted by:

Hi Alex,

Thanks for the idea. Now I've overriden the handleDrop event and create a
new request for each object being dropped and it works.


Previous Topic:Where to construct model?
Next Topic:supporting SWT LineAttributes? in draw2d
Goto Forum:

Current Time: Mon Dec 06 08:13:09 GMT 2021

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

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

Back to the top