| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html lang="en"> |
| <HEAD> |
| |
| <meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2005. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." > |
| |
| <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
| <META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css"> |
| |
| <LINK REL="STYLESHEET" HREF="../book.css" CHARSET="ISO-8859-1" TYPE="text/css"> |
| <TITLE> |
| Key bindings |
| </TITLE> |
| |
| <link rel="stylesheet" type="text/css" HREF="../book.css"> |
| </HEAD> |
| <BODY BGCOLOR="#ffffff"> |
| <h3>Key bindings</h3> |
| |
| |
| <p>The association between a command and the key combinations that should |
| invoke the command is called a <b>key binding</b>. Plug-ins can define key |
| bindings along with commands in the <b><a href="../reference/extension-points/org_eclipse_ui_bindings.html">org.eclipse.ui.bindings</a></b> |
| extension point.</p> |
| |
| |
| <pre>... |
| <key <b>commandId="org.eclipse.ui.file.save"</b> |
| contextId="org.eclipse.ui.contexts.window" |
| schemeId="org.eclipse.ui.examples.contributions.scheme" |
| <b>sequence="CTRL+S"</b>> |
| </key> |
| ...</pre> |
| |
| |
| <p>There is our friend <b>org.eclipse.ui.file.save</b>. In Eclipse, the workbench registers |
| the <b>SaveAction</b> as a handler for this command id in every Workbench Window.</p> |
| |
| <p>The <b>sequence</b> attribute for a key binding defines the key |
| combination that is used to invoke a command. When the |
| workbench <b>SaveAction</b> is active, the key combination <kbd>CTRL+S</kbd> will invoke it, |
| since the workbench uses the same command id for its <b>SaveAction</b>.</p> |
| |
| |
| </BODY> |
| </HTML> |