Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to drag a treemenu item from a TreeViewer to the Graphical viewer
How to drag a treemenu item from a TreeViewer to the Graphical viewer [message #194345] Thu, 01 September 2005 10:08 Go to next message
Eclipse UserFriend
Originally posted by: seshasai.aesv.softwareag.com

Hi

I need to drop an Item from TreeViewer to a GraphicalViewer

I am able to drag and drop a file from eclipse package explorer or a
desktop to the Graphical Viewer.

Please help

Sai
Re: How to drag a treemenu item from a TreeViewer to the Graphical viewer [message #194568 is a reply to message #194345] Fri, 02 September 2005 06:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mail4zlq.gmail.com

At first you define you "Transfers",and then you "addDragSupport" for
the TreeViewer.Like this:
//support for drag & drop
Transfer[] outTransfers = new Transfer[] {
LocalSelectionTransfer.getInstance(),
ResourceTransfer.getInstance(),
FileTransfer.getInstance()
};

Transfer[] inTransfers = new Transfer[] {
LocalSelectionTransfer.getInstance(),
FileTransfer.getInstance()
};

int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT;

fViewer.addDragSupport(operations, outTransfers, this);
fViewer.addDropSupport(operations, inTransfers, this);

Sai 写道:
> Hi
> I need to drop an Item from TreeViewer to a GraphicalViewer
>
> I am able to drag and drop a file from eclipse package explorer or a
> desktop to the Graphical Viewer.
>
> Please help
>
> Sai
>
Re: How to drag a treemenu item from a TreeViewer to the Graphical viewer [message #194861 is a reply to message #194568] Tue, 06 September 2005 14:33 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

That's for the JFace TreeViewer, not the GEF one; however the concept is the
same: to define a transfer and then add drag and drop listeners to the
source and target respectively. Sai, look at the ediagram example which
does what you want. In particular, look at OutlineToDiagramTransfer,
OutlineDragSourceListener and DiagramDropTargetListener.

"Alex.zhang" <mail4zlq@gmail.com> wrote in message
news:df8qpo$it6$1@news.eclipse.org...
> At first you define you "Transfers",and then you "addDragSupport" for
> the TreeViewer.Like this:
> //support for drag & drop
> Transfer[] outTransfers = new Transfer[] {
> LocalSelectionTransfer.getInstance(),
> ResourceTransfer.getInstance(),
> FileTransfer.getInstance()
> };
>
> Transfer[] inTransfers = new Transfer[] {
> LocalSelectionTransfer.getInstance(),
> FileTransfer.getInstance()
> };
>
> int operations = DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_DEFAULT;
>
> fViewer.addDragSupport(operations, outTransfers, this);
> fViewer.addDropSupport(operations, inTransfers, this);
>
> Sai ??:
> > Hi
> > I need to drop an Item from TreeViewer to a GraphicalViewer
> >
> > I am able to drag and drop a file from eclipse package explorer or a
> > desktop to the Graphical Viewer.
> >
> > Please help
> >
> > Sai
> >
Previous Topic:Moving a child part
Next Topic:New Documentation in latest Maintenance builds
Goto Forum:
  


Current Time: Wed Apr 24 21:17:56 GMT 2024

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

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

Back to the top