retrieve MenuItem by ID [message #456360] |
Wed, 01 June 2005 11:35 |
Eclipse User |
|
|
|
Originally posted by: boschi.integrainformatica.it
Hi everyone,
I'm developing an Eclipse plugin.
I need to enable/disable a menu item programmatically.
The question is: how can I access the MenuItem object?
for instance: from its IWorkbenchWindowActionDelegate.
The only things I know are the MenuItem id and menubarPath (as specified
in the plugin.xml file).
Thank you, I didn't find answer searching help or snippets
Bye
Luciano
|
|
|
|
Re: retrieve MenuItem by ID [message #456451 is a reply to message #456375] |
Sat, 04 June 2005 07:57 |
Eclipse User |
|
|
|
Originally posted by: boschi.integrainformatica.it
Philippe Ombredanne ha scritto:
> "Luciano Boschi" <boschi@integrainformatica.it> wrote in message
> news:d7k6t4$bm$1@news.eclipse.org...
>
>>Hi everyone,
>>I'm developing an Eclipse plugin.
>>I need to enable/disable a menu item programmatically.
>>
>>The question is: how can I access the MenuItem object?
>>for instance: from its IWorkbenchWindowActionDelegate.
>>
>>The only things I know are the MenuItem id and menubarPath (as specified
>>in the plugin.xml file).
>
> Has the menu been contributed by YOUR plugin? or another one?
>
>
It's contributed by my plugin.
I've edited plugin.xml via the PDE interface. Here is something of what
I have got:
-----------------
<extension
point="org.eclipse.ui.actionSets">
<actionSet
label="Gruppo di azioni"
description="Menu delle funzionalità di "Lexlooter""
visible="false"
id="it.unifi.ing.lexlooter.actionSet">
<menu
label="&Lexlooter"
id="LexlooterMenu">
<separator name="saveGroup"/>
<separator
name="openGroup">
</separator>
<separator name="toolGroup"/>
<separator name="configGroup"/>
</menu>
<action
label="&Salva..."
icon="icons/etool16/save.gif"
class="it.unifi.ing.lexlooter.actions.SaveResult"
tooltip="Salva tutti i modelli e i testi consolidati in
un unico archivio"
style="push"
state="true"
menubarPath="LexlooterMenu/saveGroup"
id="it.unifi.ing.lexlooter.actions.SaveResult"/>
.....
-----------------
then I have a SaveResult.java file that begins with something like:
-----------------
package it.unifi.ing.lexlooter.actions;
public class SaveResult implements IWorkbenchWindowActionDelegate
.....
-----------------
I know that the methods IWorkbenchWindowActionDelegate.run and
..selectionChanged have an IAction reference passed to them, but I would
like to access that IAction also from other methods.
Or have I to use another approach?
Thanks
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03923 seconds