Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drop EditPart from TreeViewer
Drop EditPart from TreeViewer [message #230128] Thu, 01 February 2007 14:38
Eclipse UserFriend
Originally posted by:


I am new to this portal and trying to obtain some information about
EditPart creation.

I have a GEF Graphical Editor with a palette and several entries. I create
the parts by selecting entries from the palette and then dropping it into
the editor.

I would like to by pass the palette by dragging an element from a SWT
TreeViewer and dropping the element into the editor. So far, I have
created a drop listener in the GraphicalViewer component of my editor
using my 'ObjectTransferDropTargetListener' class.

public class ObjectTransferDropTargetListener
extends AbstractTransferDropTargetListener {}

I followed the LogicLabel drag and drop example to implement the factory.
However, here is where I have the problem. All my EditPart require a View
object to be passed as a parameter into the constructor.

public class ChassisShapeEditPart extends ShapeNodeEditPart {
public ChassisShapeEditPart(View view) {


I do not know how to create the view object to create the EditPart. In
addition, I have read several examples about EdiPart factories and
getNewObject () use. I am confused about it use.

Therefore, essentially, can someone help me with this problem? I would
like to catch the drop action when the mouse enters into the editor view.
I would like to extract the name of the object to be created and then
create the corresponding EditPart. The name of the EditPart is the text to
be dragged from the TreeViewer.

I appreciate your patience reading the long message. Your help is greatly

Thank you.
Previous Topic:connections z-order and container EditParts
Next Topic:Debug Graphics (Draw2d/SWT)
Goto Forum:

Current Time: Sun Oct 17 06:48:30 GMT 2021

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

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

Back to the top