How to register action in EditorActionBarContributor [message #447437] |
Wed, 05 April 2006 13:18  |
Eclipse User |
|
|
|
Hi,
It's easy to add and register actions in the ApplicationActionBarAdvisor but I can't figure out how to do it in the editor context when an EditorActionBarContributor is used to contribute editor actions. There doesn't seem to be a register() method and I can't seem to find a way to get a suitable IKeyBindingService.
I need to register the action to activate the key binding.
Thanks!
Peter
|
|
|
|
|
Re: How to register action in EditorActionBarContributor [message #447732 is a reply to message #447730] |
Thu, 13 April 2006 13:18  |
Eclipse User |
|
|
|
Peter Suen wrote:
> I can't seem to get it to work. In my class which extends EditorActionBarContributor, I have:
>
> private void makeActions() {
> filterAction = new FilterColumnsAction(window);
> getActionBars().setGlobalActionHandler(filterAction.getId(), filterAction);
>
> getActionBars().updateActionBars();
> }
>
> but this fails and the editor doesn't start up. I just want to register the action, like in ApplicationActionBarAdvisor, so that the specified keybinding extension works for this action.
Your code looks decent. Does your filterAction.getId() return null?
Does your filterAction have an actionDefinitionID defined as well? Is
there a matching command somewhere?
If the editor doesn't start up, what error did it give? Also, you
should probably be doing your setGlobalActionHandler(*) in the
setActiveEditor(*) method. Get the subclasses of
EditorActionBarContributor (F4) and see how they set up actions.
Later,
PW
|
|
|
Powered by
FUDForum. Page generated in 0.04947 seconds