PDA

View Full Version : ActionCommand vs AbstractActionCommandExecutor


afida
Oct 11th, 2004, 03:54 AM
Can some breifly explain the purpose ActionCommand, AbstractActionCommandExecutor. As they both seem to serve same purpose and are causing little confusion. Aslo in sample app both are used and I just wanted to make sure I understand them.


Thanks

Amad

pdbruycker
Oct 11th, 2004, 05:33 AM
The ActionCommand is used to implement "local" commands, these are commands that only have a meaning to one view. (in the sample app: the rename command in the OwnerManagerView)

The AbstractActionCommandExecutor is used to implement "global" commands (commands that are application wide). (in the sample app: the properties and delete command in the OwnerManagerView)

See http://opensource.atlassian.com/confluence/spring/display/RCP/Action+Framework#ActionFramework-GlobalActions for more info on abstract commands.

Hope this helps,

Peter

pdbruycker
Oct 11th, 2004, 05:34 AM
Typo:


See http://opensource.atlassian.com/confluence/spring/display/RCP/Action+Framework#ActionFramework-GlobalActions for more info on abstract commands.


I didn't mean abstract commands but global commands[/quote]

Keith Donald
Oct 11th, 2004, 05:14 PM
Right on, Peter. You can also choose to implement ActionCommandExecutor in the cases where extending ActionCommand is just not an option. For example, the NewOwnerWizard does this, to encapsulate logic for opening up the NewOwnerWizard dialog.

With this approach, you use composition with a TargetableActionCommand instance, setting the executor for the targetable action command (even if the command itself isn't retargeted after startup)

pdbruycker
Oct 12th, 2004, 02:18 AM
I updated the user documentation to reflect Keith's answer.