Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Get EditPart
Get EditPart [message #157066] Sat, 06 November 2004 08:05 Go to next message
Eclipse UserFriend
Originally posted by: jsk_lam.hotmail.com

Hi,

How can I get back the EditPart of a node?

Example, in my EditPartFactory, I create the EditPart as the following:

if (obj instanceof Diagram)
return new DiagramEditPart((Diagram)obj);
else if (obj instanceof Node)
return new DiagramNodeEditPart((Node)obj);

In my other methods, how can I a reference to the EditPart of the node
object?

Thanks.
SL
Re: Get EditPart [message #157148 is a reply to message #157066] Sun, 07 November 2004 22:30 Go to previous message
kiril mitov is currently offline kiril mitovFriend
Messages: 128
Registered: July 2009
Senior Member
You can use

EditPart editPart =
(EditPart)getGraphicalViewer().getEditPartRegistry().get(by model);

and here getGraphicalViewer() returns the GraphicalViewer of you GEF
editor.

The editParts are registered in the graphicalViewre by their models - this
is by default.

kiril.



SL wrote:

> Hi,

> How can I get back the EditPart of a node?

> Example, in my EditPartFactory, I create the EditPart as the following:

> if (obj instanceof Diagram)
> return new DiagramEditPart((Diagram)obj);
> else if (obj instanceof Node)
> return new DiagramNodeEditPart((Node)obj);

> In my other methods, how can I a reference to the EditPart of the node
> object?

> Thanks.
> SL
Previous Topic:Directed Cyclic Graph/Tree and Draw2d
Next Topic:What does this exception mean?
Goto Forum:
  


Current Time: Sat Apr 27 04:56:19 GMT 2024

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

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

Back to the top