|Re: Create Pictogramm Element from Contextmenu [message #690893 is a reply to message #690653]
||Thu, 30 June 2011 11:43
| Michael Wenz
Registered: July 2009
Location: Walldorf, Germany
You should be able to reuse the CreateEClassFeature in the method |
getContextMenu(ICustomContext context) . You can simply create a new
CreateContext, provide the new target (e.g. the Diagram if you want to
display the new object there) and
"Kalle" schrieb im Newsbeitrag news:email@example.com...
I'll use this topic for another similar problem I have with the ContextMenu.
I'm new to Graphiti, so I'm not sure if I got the right understanding of the
structure of Graphiti.
I want to create and add an EClass by using the ContextMenu. I already
defined a "AddEClassFeature" and a "CreateEClassFeature". It works for the
palette, but when I'm using the ToolBehaviorProvider and want to override
the "getContextMenu(ICustomContext context)" I don't have access to a
(I)CreateContext or a (I)AddContext. So I'm not able to create a new EClass.
I already got the idea of creating an own custom AddEClassFeature, which
extends AbstractCustomFeature. I overrode the execute-method and created a
new AddContext. The NewObject of the AddContext is the businessObject of the
currently selected pictogramElement, which is the old businessObject. At the
end of the method I used the addIfPossible-method, but it seems that now I
only added a new EClass to the diagram, which is linked to the old
I'm grateful for any new approach concerning Graphiti.
Powered by FUDForum
. Page generated in 0.02846 seconds