|
|
Re: How to get editPart from notation.Diagram [message #171106 is a reply to message #171092] |
Fri, 01 February 2008 08:22  |
Eclipse User |
|
|
|
Originally posted by: trommas.yahoo.com
Boris Blajer wrote:
> Hi Tomas,
>
> EditParts exist only in the context of an EditPartViewer showing them.
> If you have an EditPartViewer, then
> viewer.getEditPartRegistry().get(notationalElement) will return the edit
> part associated with this notational element. For the diagram itself,
> viewer.getContents() is a shorter alternative.
> If you don't have any viewer, then the concept of edit part makes little
> sense. One notational element may correspond to many different edit
> parts, they don't even need to be of the same or related classes (e.g.,
> a subclass of GraphicalEditPart vs. subclass of TreeEditPart).
>
> Hope that helps.
> Best regards,
> Boris
Thanks for clarifying.
What I'm trying to achieve is to run a create command after a diagram
gets created. ...EditorUtil's doExecuteWithResult seems like the best
place. A create command needs a DiagramEditPart to create a node. Simply
adding them to the diagram.getElement()'s collection seems to initialize
the node incorrectly... Hmm.. Anyways, Thanks for helping!
Tomas
>
>
> Tomas Zijdemans wrote:
>> I have a gmf.runtime.notation.Diagram - Is there a way to get it's
>> editPart?
>>
>>
>> Tomas
|
|
|
Powered by
FUDForum. Page generated in 0.09999 seconds