Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "FAQ What is the difference between a command and an action?"

 
m
Line 1: Line 1:
Commands and actions are two aspects of the same thing.
+
Commands and actions are two aspects of the same thing.   You can think of commands as the declarative part—specified in the plug-in manifest—and actions as the programmatic part.  Commands are used mainly to associate customizable key bindings with actions.  If you look in the '''Workbench > Keys''' preference page, you will see a list of all commands known to the platform, including what context and configuration they belong to.  Key bindings are hooked to commands, and then commands are hooked to actions.  This extra level of indirection allows for added flexibility in the implementation.  The user can change key bindings for a command without the associated actions knowing about it, and the action for a command can be dynamically changed for different circumstances without affecting the key bindings.
You can think of commands as the declarative part—specified  
+
in the plug-in manifest—and actions as the  
+
programmatic part.  Commands are used mainly to associate
+
customizable key bindings with actions.  If you look in the
+
'''Workbench > Keys''' preference page, you will see a list of
+
all commands known to the platform, including what context and
+
configuration they belong to.  Key bindings are hooked to commands, and
+
then commands are hooked to actions.  This extra level of indirection
+
allows for added flexibility in the implementation.  The user can change
+
key bindings for a command without the associated actions knowing about
+
it, and the action for a command can be dynamically changed for
+
different circumstances without affecting the key bindings.
+
  
 +
Note that although the Eclipse APIs contain both commands and actions, the UI very clearly uses only the term <i>command</i> when  referring to them.  The term <i>action</i> is avoided in the user interface. There&#146;s no point in confusing users with two  names for the same thing!
  
Note that although the Eclipse APIs contain both commands and actions,
+
{{Template:FAQ_Tagline}}
the UI very clearly uses only the term <i>command</i> when
+
referring to them.  The term <i>action</i> is avoided in the user
+
interface. There&#146;s no point in confusing users with two
+
names for the same thing!
+
 
+
<hr><font size=-2>This FAQ was originally published in [http://www.eclipsefaq.org Official Eclipse 3.0 FAQs]. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the [http://www.eclipse.org/legal/epl-v10.html Eclipse Public License v1.0].</font>
+

Revision as of 23:37, 14 June 2006

Commands and actions are two aspects of the same thing. You can think of commands as the declarative part&#151;specified in the plug-in manifest&#151;and actions as the programmatic part. Commands are used mainly to associate customizable key bindings with actions. If you look in the Workbench > Keys preference page, you will see a list of all commands known to the platform, including what context and configuration they belong to. Key bindings are hooked to commands, and then commands are hooked to actions. This extra level of indirection allows for added flexibility in the implementation. The user can change key bindings for a command without the associated actions knowing about it, and the action for a command can be dynamically changed for different circumstances without affecting the key bindings.

Note that although the Eclipse APIs contain both commands and actions, the UI very clearly uses only the term command when referring to them. The term action is avoided in the user interface. There&#146;s no point in confusing users with two names for the same thing!


This FAQ was originally published in Official Eclipse 3.0 FAQs. Copyright 2004, Pearson Education, Inc. All rights reserved. This text is made available here under the terms of the Eclipse Public License v1.0.

Back to the top