Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Plug-in Developer Guide
Previous Page Home Next Page

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:

<extension
         point="org.eclipse.ui.bindings">
  <key
      sequence="Ctrl+S"
      commandId="org.eclipse.ui.file.save"
      contextId="org.eclipse.ui.textEditorScope"
      schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
  </key>
</extension>
...
(See Contexts) for a more detailed discussion of contexts and how they are defined.

 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire