Skip to main content



      Home
Home » Eclipse Projects » GEF » Drag and drop from a TreeViewer
Drag and drop from a TreeViewer [message #249038] Fri, 22 May 2009 19:56 Go to next message
Eclipse UserFriend
I have a graphical editor with a TreeViewer in a panel on the right-hand
side (similar to GraphicalEditorWithPalette). I want to be able to drag
and drop items from the tree onto the main panel. This will create a new
figure that corresponds to the model object from the tree.

The various classes I have include:

Foo (the model object of the items in the tree)
FooEditPart (extends AbstractTreeEditPart - edit part in the tree)

FooView (the model object of the figure in the diagram)
FooViewEditPart (edit part for the figure)

DiagramEditPart (edit part of the diagram itself)
DiagramXYLayoutEditPolicy (handles layout of the diagram)

Now, if I use the palette, I can get the layout edit policy to handle
create commands, so I know that part works. The problem is that the
palette only lets me create a new FooView object - I need to pass the Foo
object to the FooView. In other words, when I drag a Foo from the tree, I
want the create request to be populated with the Foo.

What I can't work out is where the request gets created, and how do I
populate it with the selected Foo from the tree?

(I can work out how to do this with native drag-and-drop, but that seems a
bit unnecessary if I can do it all with GEF's normal support).
Re: Drag and drop from a TreeViewer [message #249468 is a reply to message #249038] Wed, 01 July 2009 09:07 Go to previous message
Eclipse UserFriend
Hi,

I needed to know if you can customize the pallete viewer in GEF to show a
tree viewer . Is this possible ?
Previous Topic:FlowLayout not wrapping
Next Topic:Add CreateDevice action to context menu
Goto Forum:
  


Current Time: Wed Mar 26 01:49:42 EDT 2025

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

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

Back to the top