Key bindings
The association between a command and the key combinations that should invoke the command is called a key binding. Plug-ins can define key bindings along with commands in the org.eclipse.ui.bindings extension point.
...
<key
sequence="Ctrl+S"
commandId="org.eclipse.ui.file.save"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
...
There is our friend org.eclipse.ui.file.save. Recall our hypothetical action definition:
<extension point = "org.eclipse.ui.actionSets">
<actionSet id="com.example.actions.actionSet"
label="Example Actions"
visible="true">
<action id="com.example.actions.action1"
menubarPath="additions"
label="Example Save Action"
class="org.example.actions.ExampleActionDelegate"
definitionID="org.eclipse.ui.file.save">
</action>
...
</actionSet>
</extension>
The sequence attribute for a key binding defines the key combination that is used to invoke a command. So, it follows that when our example action set is active, our save action will be invoked when the user chooses Ctrl+S.
Likewise, when the workbench SaveAction is active, the same key combination will invoke it instead, since the workbench uses the same command id for its SaveAction.
To complete the example, we need to understand what the configuration is all about.
Partager