|Re: Tool creating [message #1237247 is a reply to message #1237069]
||Wed, 29 January 2014 08:33
| Maxime Porhel
Registered: July 2009
Le 28/01/2014 21:16, Vladimir Vujovich a écrit :|
> Hi there!
> In my Ecore model, I have a node (N1) which has reference to node (N2).
> In my Sirius project I present N1 with Bordered Node object, and N2 with
> Node object. I would like to create a tool for creating a Node (N2), but
> only if user selects a Border Node (N1). I tried to do this (put
> precondition, Change context), but none of this helped. In Node Creation
> a container of my N2 is root object.
Your nodes N2 are specified by a NodeMapping, direct child of the
default layer I think, so the defaut behavior of a
NodeCreationDescription tool it to allow the creation of N2 nodes as
direct children of the diagram to follow the mapping strucure described
in the Viewpoint specification model.
I think you could use the extra mappings field of the creation tool
(Advanced tab) to select the N1 mapping as extra mapping: the tool will
be enabled when the user clicks on a N1 bordered node too.
Then you can use the container variable in the precondition to enable
the tool only for clicks on N1 nodes.
When I write enabled/disabled, please understand that the cursor is the
standard mouse cursor or the "not-allowed" cursor.
If you have enabled the popup bars (Enabled popup bars field in the
General tab of DiagramDescription properties), the your N2 creation tool
will be available in the popup bar when the user selects a N1 bordered node.
> Whole situation is shown in the attached picture
> How can I do this?
> How can I change a source object for Tool?
> Best regards.
Powered by FUDForum
. Page generated in 0.01586 seconds