Accessing editor actionbar contribution [message #447767] |
Fri, 14 April 2006 12:26  |
Eclipse User |
|
|
|
Hello,
I have an action on the toolbar (contributed by my editor). Its a
radiobutton. Now I need to get a reference to this action object to
determine its state. How to do it?
Thanks
--
Best regards,
Lukas Zapletal
|
|
|
|
|
|
|
|
|
Re: Accessing editor actionbar contribution [message #448136 is a reply to message #447942] |
Tue, 18 April 2006 18:57   |
Eclipse User |
|
|
|
Originally posted by: childress.shapetechllc.com
Paul Webster wrote:
> The way that these things are moving is to Commands, Handlers, and Bindings.
> It looks like you can use definitionId in your action declaration to
> link it to a command. Define a command in the org.eclipse.ui.commands
> extension point. Using a definitionId and a command turns the legacy
> actionSet or editorAction actions into handlers.
> Use ICommandServer#getCommand(String commandId) to get the Command.
> From Command, you can use getState(IMenuStateIds.STYLE), and then if
> your command state is an instance of ToggleState, use
> ((Boolean)state.getValue()).booleanValue().
I tried what you suggest. I created a command, and put its id as the
definitionId of the editorAction. Then, I tried to access it via,
CommandManager manager = new CommandManager();
Command command = manager.getCommand( "commandId" );
At this point, I'm not seeing any way to get at the state or other
information about the contribution. Am I missing something or doing
something wrong?
Ken...
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07702 seconds