Jump to: navigation, search

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

m
Line 2: Line 2:
  
 
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, 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!
 +
 +
== See Also: ==
 +
*[[FAQ How do I make key bindings work in an RCP application?]]
 +
*[[FAQ How do I associate an action with a command?]]
  
 
{{Template:FAQ_Tagline}}
 
{{Template:FAQ_Tagline}}

Revision as of 10:01, 18 August 2006

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.

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’s no point in confusing users with two names for the same thing!

See Also:


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.