Creating a two-level submenu

MagicDraw OpenAPI, scripting related questions and discussions

Moderator: Moderators

Creating a two-level submenu

Postby Raul Lorenzo » Fri Mar 24, 2006 7:03 am

Hello,

I am trying to create a submenu into a submenu, something like that

Tools (Main MagicDraw Menu)
->PlugInREM
->Export....
->Import....
->Options
->Refresh Presentation
->Show/Hide.....
->.......

But I don´t get it.
I am doing this:
private NMAction getSeparatedActions()
{
ActionsCategory category = new ActionsCategory(null, "REM PlugIn");
// this call makes submenu.
category.setNested(true);
category.addAction(new SimpleAction(null, "Importar..."));
category.addAction(new SimpleAction(null, "Exportar diagramas..."));

ActionsCategory category_opciones = new ActionsCategory(null, "Opciones
Presentacin...");
category.addAction(category_opciones);
category.addAction(new SimpleAction(null, "Sobre PlugInREM..."));
return category;
}
Should I create another MenuConfigurator instante like in example from
MagicDraw plugins examples?

Thanks in advance
Raul Lorenzo
 
Posts Rating:

Re: Creating a two-level submenu

Postby Raul Lorenzo » Sun Mar 26, 2006 11:15 am

Hello,

I got it, if someone is interested, I attached the code to do that.

> Hello,
>
> I am trying to create a submenu into a submenu, something like that
>
> Tools (Main MagicDraw Menu)
> ->PlugInREM
> ->Export....
> ->Import....
> ->Options
> ->Refresh Presentation
> ->Show/Hide.....
> ->.......
>
> But I don´t get it.
> I am doing this:
> private NMAction getSeparatedActions()
> {
> ActionsCategory category = new ActionsCategory(null, "REM PlugIn");
> // this call makes submenu.
> category.setNested(true);
> category.addAction(new SimpleAction(null, "Importar..."));
> category.addAction(new SimpleAction(null, "Exportar diagramas..."));
>
> ActionsCategory category_opciones = new ActionsCategory(null, "Opciones
> Presentacin...");
> category.addAction(category_opciones);
> category.addAction(new SimpleAction(null, "Sobre PlugInREM..."));
> return category;
> }
> Should I create another MenuConfigurator instante like in example from
> MagicDraw plugins examples?
>
> Thanks in advance

You do not have the required permissions to view the files attached to this post.
Raul Lorenzo
 
Posts Rating:


Return to Programmatic Extendibility

Who is online

Users browsing this forum: No registered users and 1 guest