Reputation: 7729
There is a plugin that has an action (action itself is even placed on toolbar i.e. Tomcat runner and Vim editing mode).
So is there any way to add conveniently shortcuts to these actions, which have no shortcuts implicitly defined, by say changing an XML configuration...
Any advices are appreciated.
Upvotes: 0
Views: 1640
Reputation: 13984
The answer is Yes you can do it.
window->preferences->keys
now here you create new bindings or can change the old ones.Example:
>>Original
>>Setting it
>>Result
Note: There is a hard way as mentioned in @greydet answer. But, don't worry its not that hard. Follow these steps:
org.eclipse.jdt.ui
. Mostly a well written plugin divides its UI and processing component in different plugins.name
or some fuzzy id etc.For example for java getter and setter action following is the command extension point:
<command
name="%ActionDefinition.getterSetter.name"
description="%ActionDefinition.getterSetter.description"
categoryId="org.eclipse.jdt.ui.category.source"
id="org.eclipse.jdt.ui.edit.text.java.create.getter.setter">
</command>
The corresponding binding extension I have written:
<plugin>
<extension
point="org.eclipse.ui.bindings">
<key
commandId="org.eclipse.jdt.ui.edit.text.java.create.getter.setter"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
sequence="CTRL+T">
</key>
</extension>
</plugin>
The Problem: The command you earlier found is for package explorer
view. There is a command contributed by the java editor also. You have to create a binding for that.
Upvotes: 0
Reputation: 5539
There are two different ways to contribute to the Eclipse Workbench: Actions and Commands.
Prefer using the command framework taht is newer & more complete than the action one and that allows to add key binding easily.
Have a look to the org.eclipse.ui.bindings extension point to contribute a key binding for a given command: http://wiki.eclipse.org/FAQ_How_do_I_provide_a_keyboard_shortcut_for_my_action%3F
A more complete article about the Eclipse command framework: http://www.vogella.de/articles/EclipseCommands/article.html
Upvotes: 1