|
Re: Defining a dynamic context submenu [message #1661256 is a reply to message #1661217] |
Mon, 09 March 2015 14:52 |
|
Hello,
Among the tools available in Sirius, create a new "Popop menu". Set the
name of your parent context menu as the ID or Label of this tool.
Then create an operation action for each submenu action you need. In the
precondition field, write a boolean expression that should be true if
you want to display this contextual action for the selected element.
Regards,
Steve
Le 09/03/2015 15:30, Francois Cabrol a écrit :
> Hi everyone, another question about context menus.
>
> I would like to define a context menu item enabling to display a
> submenu whose contents are populated dynamically, typically to easily
> create dynamic menus such as in the "Create child" and "Create sibling"
> menu items in the EMF-generated editor's context menu.
>
> It is possible to define such dynamic menu items with Sirius ?
>
> Thanks in advance,
>
> François
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Re: Defining a dynamic context submenu [message #1661396 is a reply to message #1661293] |
Mon, 09 March 2015 16:06 |
|
I might be missing a point, but I guess this only add some condition on
your expression, like checking the number of children (eContents()->size
< x) or if a certain feature starts with a certain prefix
(featureName.startsWith("prefix")). If the expression is too complex you
can use a java service.
Regards,
Steve
Le 09/03/2015 16:12, Francois Cabrol a écrit :
> Thank you very much, this approach should work with the examples I
> mentioned.
>
> I also would like to know if there is a way to handle a dynamic menu
> in case its contents can only be known at runtime, for example if the
> menu items depend on the contents of the edited model.
>
> François
--
Steve Monnier - Obeo
Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
|
|
|
|
Powered by
FUDForum. Page generated in 0.02400 seconds