Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drag and Drop in Logic Editor Example
Drag and Drop in Logic Editor Example [message #53234] Thu, 09 January 2003 21:31 Go to next message
Eclipse UserFriend
Originally posted by: sy_cheung2.yahoo.com

Could someone please tell me what is the functionality of
FileTransferDragSourceListener? Why it set the drag source event data to
"some text"? When will that get invoke?

And what about LogicTemplateTransferDropTargetListener? Is this for the
drag and drop on the palette only? When will
TextTransferDropTargetListener get invoke?

Thanks.
Re: Drag and Drop in Logic Editor Example [message #53447 is a reply to message #53234] Thu, 09 January 2003 15:07 Go to previous messageGo to next message
Manfred Goetz is currently offline Manfred GoetzFriend
Messages: 8
Registered: July 2009
Junior Member
"Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
news:avkosg$u1n$1@rogue.oti.com...
> Could someone please tell me what is the functionality of
> FileTransferDragSourceListener? Why it set the drag source event data to
> "some text"? When will that get invoke?
> And what about LogicTemplateTransferDropTargetListener? Is this for the
> drag and drop on the palette only? When will
> TextTransferDropTargetListener get invoke?
>
> Thanks.

LogicTemplateTransferDropListener is just the
TemplateTransferDropTargetListener from gef.dnd tuned to return
LogicTemplateFactories. It supports dropping Templates dragged from
whereever they are and calling a Factory to create Editparts from that
Templates- ok usually that would be a palette.
Concerning the other two: They are not used. Perhaps we should not assume
that every class in Logicexample makes sense. After all, it is still being
worked on.
Re: Drag and Drop in Logic Editor Example [message #53607 is a reply to message #53447] Fri, 10 January 2003 19:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: sy_cheung2.yahoo.com

Thanks. All Drop Target Listener are initialize in
initializeGraphicalViewer() of LogicEditor. How call GET tell the difference
between different Transfer Drop Target Listeners and decide which one to
use for different transfer? It just call addDropTargetListener() adding them
to the graphical viewer one by one?

Thanks in advance.
Sam
protected void initializeGraphicalViewer() {

getGraphicalViewer().setContents(getLogicDiagram());

getGraphicalViewer().addDropTargetListener(

new LogicTemplateTransferDropTargetListener(getGraphicalViewer() ));

getGraphicalViewer().addDropTargetListener(

new TextTransferDropTargetListener(getGraphicalViewer(),
TextTransfer.getInstance()));

}

"Manfred Goetz" <xgoetz@de.ibm.com> wrote in message
news:avmmrf$4bv$1@rogue.oti.com...
> "Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
> news:avkosg$u1n$1@rogue.oti.com...
> > Could someone please tell me what is the functionality of
> > FileTransferDragSourceListener? Why it set the drag source event data to
> > "some text"? When will that get invoke?
> > And what about LogicTemplateTransferDropTargetListener? Is this for the
> > drag and drop on the palette only? When will
> > TextTransferDropTargetListener get invoke?
> >
> > Thanks.
>
> LogicTemplateTransferDropListener is just the
> TemplateTransferDropTargetListener from gef.dnd tuned to return
> LogicTemplateFactories. It supports dropping Templates dragged from
> whereever they are and calling a Factory to create Editparts from that
> Templates- ok usually that would be a palette.
> Concerning the other two: They are not used. Perhaps we should not assume
> that every class in Logicexample makes sense. After all, it is still being
> worked on.
>
>
Re: Drag and Drop in Logic Editor Example [message #53659 is a reply to message #53607] Fri, 10 January 2003 21:35 Go to previous messageGo to next message
Eric Bordeau is currently offline Eric BordeauFriend
Messages: 259
Registered: July 2009
Senior Member
The active listener is determined by
DelegatingDropAdapter.updateCurrentListener(DropTargetEvent) based on
each listener's isEnabled(DropTargetEvent) method (in
AbstractTrasferDropTargetListener). First, isEnabled(...) checks to see
if the transfer type is supported by the listener, based on the transfer
type you used when you registered the listener with the viewer (like in
LogicEditor.initializeGraphicalViewer()). If it passes this test, it
checks to see if there is an EditPart at the drop location that
understands the target request. If so, this listener is enabled and the
DelegatingDropAdapter stops looking.


Sam Cheung wrote:
> Thanks. All Drop Target Listener are initialize in
> initializeGraphicalViewer() of LogicEditor. How call GET tell the difference
> between different Transfer Drop Target Listeners and decide which one to
> use for different transfer? It just call addDropTargetListener() adding them
> to the graphical viewer one by one?
>
> Thanks in advance.
> Sam
> protected void initializeGraphicalViewer() {
>
> getGraphicalViewer().setContents(getLogicDiagram());
>
> getGraphicalViewer().addDropTargetListener(
>
> new LogicTemplateTransferDropTargetListener(getGraphicalViewer() ));
>
> getGraphicalViewer().addDropTargetListener(
>
> new TextTransferDropTargetListener(getGraphicalViewer(),
> TextTransfer.getInstance()));
>
> }
>
> "Manfred Goetz" <xgoetz@de.ibm.com> wrote in message
> news:avmmrf$4bv$1@rogue.oti.com...
>
>>"Sam Cheung" <sy_cheung2@yahoo.com> wrote in message
>>news:avkosg$u1n$1@rogue.oti.com...
>>
>>>Could someone please tell me what is the functionality of
>>>FileTransferDragSourceListener? Why it set the drag source event data to
>>>"some text"? When will that get invoke?
>>>And what about LogicTemplateTransferDropTargetListener? Is this for the
>>>drag and drop on the palette only? When will
>>>TextTransferDropTargetListener get invoke?
>>>
>>>Thanks.
>>
>>LogicTemplateTransferDropListener is just the
>>TemplateTransferDropTargetListener from gef.dnd tuned to return
>>LogicTemplateFactories. It supports dropping Templates dragged from
>>whereever they are and calling a Factory to create Editparts from that
>>Templates- ok usually that would be a palette.
>>Concerning the other two: They are not used. Perhaps we should not assume
>>that every class in Logicexample makes sense. After all, it is still being
>>worked on.
>>
>>
>
>
>
Re: Drag and Drop in Logic Editor Example [message #243126 is a reply to message #53234] Mon, 26 May 2008 07:23 Go to previous message
Eclipse UserFriend
Originally posted by: shady_86.sify.com

the TextTransferDropTargetListener is used to drag text from anywhere and drop it on the label.

and i am also looking why FileTransferDragSourceListener is used, if any one know the answer then please do reply here..,
Previous Topic:org.eclipse.draw2d.AbstractHintLayout questions
Next Topic:CircuitEditPart and MouseMotionListener
Goto Forum:
  


Current Time: Tue Mar 19 08:06:48 GMT 2024

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

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

Back to the top