Schemes are used to represent a general style or theme of
bindings. For example, the Workbench provides a "Default" scheme and
an "Emacs" scheme. Only one scheme is active at any
given time. End users control which one
is active using the
General > Keys
From an implementation point of view, schemes are simply
named groupings of bindings. A scheme won't
accomplish anything on its own unless there are bindings associated with
Let's look again at the workbench markup for
to find the binding definitions and how a scheme gets
associated with a binding.
There are two different key bindings defined for the "org.eclipse.ui.file.save"
command. Note that each one has a different schemeId
defined. When the default scheme is active, the "Ctrl+S"
key binding will invoke the command. When the emacs scheme is
active, the sequence "Ctrl+X Ctrl+S" will invoke the command.
Defining new schemes
When your plug-in defines a binding, it will most likely assign it to an existing
scheme. However, your plug-in may want to define a
completely new style of scheme. If this is the case, you can define
a new type of scheme inside the
definition. The workbench markup that defines the default and emacs key
configurations are shown below:
Note that the name defined here is the one used in the preferences page in the list of
Activating a scheme
The user controls the active scheme via the preferences page.
However, you can define the default active scheme as a part of the
"plugin_customization.ini" file. It is a preference: