com.pietschy.command.annotation
Annotation Type ActionCommand_


@Documented
@Retention(value=RUNTIME)
@Target(value=METHOD)
public @interface ActionCommand_

The ActionCommand annotation can be used to mark a method as being an action command. These annotated methods can then be automatically converted into action commands using GuiCommands.bindAnnotatedCommands(CommandContainer, Object).

The following is an example marking a save method as the implementation of the "save" action command.

    @ActionCommand_("save")
    public void save()
    {
       // do the save operation...
    } 
 
The annotated methods can optionally define either a Map, ActionCommand or Window argument. Methods with a Map will be passed the invoking commands parameter map, those with an ActionCommand will be passed the command, and those with a Window will be passed the commands invoker window.
    @ActionCommand_("save")
    public void save(Map parameters)
    {
       Object invoker = parameters.get(com.pietschy.command.ActionCommand.INVOKER);
       // do the save operation...
    } 
 

See Also:
GuiCommands.bindAnnotatedCommands(CommandContainer, Object), GuiCommands.bindAnnotatedCommands(JComponent, Object), GuiCommands.bindAnnotatedCommands(JComponent), SwingWorkerCommand_

Required Element Summary
 java.lang.String value
          The id of the action command.
 

Element Detail

value

public abstract java.lang.String value
The id of the action command.



Copyright © 2006 - 2007 Andrew Pietsch