### Contexts and key bindings

A context can be specified for a key binding so that the binding is only available when the user is working within a specific context. Contexts are declared in the org.eclipse.ui.contexts extension point.

A context can be bound to a key binding by specifying the id of the context when the key binding is defined. For example, if we only wanted the save command to work while the user is editing text, we could specify a context for the key binding:

    <keyBinding
          string="Ctrl+S"
          command="org.eclipse.ui.file.save"
          contextId="org.eclipse.ui.textEditorScope"
          configuration="org.eclipse.ui.defaultAcceleratorConfiguration">
    </keyBinding>
    ...

(See Contexts) for a more detailed discussion of contexts and how they are defined.