Dynamic menu [message #467118] |
Sat, 28 April 2007 01:48  |
Eclipse User |
|
|
|
In my RCP app , i want to add/remove menus .
Now i've found that in the workbenchwindowadvisor class ,we can get the
menumanager this way:
this.getWindowConfigurer().getActionBarConfigurer().getMenuM anager();
But ,my question is :how to get the workbenchwindowadvisor object?
or ,maybe,there is better ways to get the Menumanager()?
or,there is other ways to add menus when the app is running?
|
|
|
|
Re: Dynamic menu [message #467157 is a reply to message #467128] |
Sun, 29 April 2007 22:00   |
Eclipse User |
|
|
|
I know this, but I need another way.
The reason is :
the menu i want add may be dynamic ,for example ,the text displayed on the
menu is dynamic,it is not the same at different time.
"kane" <zxkane@msn.com>
??????:12919341.1177749689525.JavaMail.root@cp1.javalobby.org...
> define your actions in plugin.xml and set the actionSet invisible
>
> you can show the actionSet by calling showActionSet in runtime
>
> > In my RCP app , i want to add/remove menus .
> >
> > Now i've found that in the workbenchwindowadvisor
> > class ,we can get the
> > menumanager this way:
> > this.getWindowConfigurer().getActionBarConfigurer().ge
> > tMenuManager();
> >
> > But ,my question is :how to get the
> > workbenchwindowadvisor object?
> >
> > or ,maybe,there is better ways to get the
> > Menumanager()?
> >
> > or,there is other ways to add menus when the app is
> > running?
> >
> >
|
|
|
|
|
|
|
Re: Dynamic menu [message #467713 is a reply to message #467244] |
Thu, 10 May 2007 08:51  |
Eclipse User |
|
|
|
Dollyn wrote:
> Thanks.
> I use a static filed .
> In the fillMenuBar()menthod , i write this:
>
> Tools.menuBar = menubar;
>
> Then ,I can use this Tools.menuBar to add new menu,but is it a good way?
Well, it might be OK for an RCP app, assuming eclipse doesn't do
anything like wipe it and rebuild it.
> Another way is to use the Shell'menthod : Menu getMenuBar().But after i'got
> the Menu obj, i haven't add a new Menu into it successfully.
This won't work. The menu manager will dispose any Menu or MenuItems it
cannot find a matching contribution item for.
Later,
PW
|
|
|
Powered by
FUDForum. Page generated in 0.06185 seconds