|
|
|
|
Re: How to add menus programmatically? [message #435714 is a reply to message #435661] |
Mon, 22 August 2005 09:37  |
Eclipse User |
|
|
|
Thank you for the answer, but the real problem is that I need a some
dynamic menu items contributed through plugins.
May be the solution could be in creation of new extension point for that
purpose.
Andrey.
Marcus Olk пишет:
> user@domain.invalid wrote:
>
>> As far as I understand, this method is applicable with RCP
>> application, but what should I do if I have only a plugin class? How
>> should I call WorkbenchAdvisor? Or how could I get reference to
>> MenuManager of the main menu within plugin class?
>
>
> AFAIK the RCP framework extensions of the workbench classes are the
> only objects capable of contributing to the workbench menu and toolbar
> programmatically. If you need to contribute from within a plugin
> you'll have to extend the corresponding extension points in your
> plugin manifest (plugin.xml).
>
> We're currently struggling with this basically very flexible concept
> because we have no control which contribution that has been described
> using the static way via the manifest (XML) shall be active at
> runtime (dynamically) implementing a kind of role based contribution
> filter ("user X in role Y shall see contribution A but not B").
>
> If you don't need to filter the contributions extending the
> corresponding extension points is the way to go.
>
> In your workbench ActionBarAdvisor implementation you should set up
> your basic menu and toolbar structure (File, Edit, Window Help etc.)
> programmatically. All remaining contributions can be described very
> conveniently using XML (plugin.xml).
>
> Hope that helps,
> Marcus
|
|
|
Powered by
FUDForum. Page generated in 0.04107 seconds