Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-ui-dev] Parameterized Commands (was 'Key Binding Problem')


Please read the archive of this list about a year back to see a discussion of commands vs. actions.
If you start with the attribute "actionDefinitionId" on actions back in 2.0 you can trace the evolution.
Please also note from the API to see that commands do have a human readable name and description, and an icon.

- 'Commands' developed from the fact that multiple semantically similar actions were being defined that declared the same key binding.

- 'ActionDefintionId' became a tag to semantically link these actions, and key bindings were assigned to ActionDefinitionIds.

- ActionDefintionIds were renamed 'command ids', and the idea of a 'command' was created which included this id, along with a name, description, and icons.

- Now commands had a one to many relationship to actions. (It is easy to see some similarities to 'retargetable actions' at this point)

- From the key binding side, when a key binding is pressed it finds the command and executes it, and that's it as far as the key processing is concerned.

- The command delegates executiong to the only other piece of the puzzle, something we started calling a handler (in an attempt to avoid confusing ourselves). A handler is like a stripped down version of action, effectively no more than a 'run()' type method and some properties that can be passed back to the command  (isEnabled, name overrides, etc.)

- Handlers do not have any association to menus, toolbars, or keybindings. They just do the work when they are called to execute on behalf of the command. Key bindings (and menus and toolbars, in the future) do not have any association to the handlers. They simply ask the command to do the work. Thus, commands nicely separate key bindings, etc. from the actual handlers.

- Multiple handlers can compete to handle a particular command according to various rules (e.g. a handler at the active part will override a general or global handler.), but at any given moment in time, there is exactly zero or one handler for a command.

- The command manager cares only about handlers, we have already proxied the various action systems internally 'global actions', 'action sets', key binding service, to all look like handlers.

Again, this is still a work in progress.
Chris.




"Ed Burnette" <Ed.Burnette@xxxxxxx>
Sent by: platform-ui-dev-admin@xxxxxxxxxxx

03/09/04 02:45 PM

Please respond to
platform-ui-dev

To
<platform-ui-dev@xxxxxxxxxxx>
cc
Subject
RE: [platform-ui-dev] Parameterized Commands (was 'Key Binding Problem')





Separating user interface elements from core elements is good in general but at some point you'll need to present a list of Commands to the user (in a script editor or keybinding dialog for example). Then each Command will need a human readable name and description, and an icon. Earlier you said you wanted, post M8, to replace Actions with Commands, but it seems that they'll need essentially the same properties. Or were you thinking that a Command would *always* be paired one to one with an Action and that the Action would "decorate" the Command?


> -----Original Message-----
> From: Douglas Pollock [mailto:douglas.pollock@xxxxxxxx]
>
> Commands are an attempt clean up and unify the rather diverse
> and complex
> world of actions and contributions.  They also provide a little more
> flexibility than actions were generally designed for -- by
> cleanly separating
> user interface elements from "commands" to be performed in
> the underlying
> system.
_______________________________________________
platform-ui-dev mailing list
platform-ui-dev@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/platform-ui-dev


Back to the top