Get EditPart [message #157066] |
Sat, 06 November 2004 08:05  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.05539 seconds