org.jdesktop.swingx.action
Interface Targetable

All Known Implementing Classes:
JXEditorPane

public interface Targetable

An interface which exposes the allowable actions to a TargetManager. The getCommands method will expose the allowable actions to another class and the doCommand method is called to invoke an action on the class.

Usually, the command key will be the key value of the Action. For components This could be the ActionMap keys. For actions managed with the ActionManager, this will be the value of an actions Action.ACTION_COMMAND_KEY

See Also:
TargetManager

Method Summary
 boolean doCommand(Object command, Object value)
          Perform the command using the object value.
 Object[] getCommands()
          Returns an array of supported commands.
 boolean hasCommand(Object command)
          Return a flag that indicates if a command is supported.
 

Method Detail

doCommand

boolean doCommand(Object command,
                  Object value)
Perform the command using the object value.

Parameters:
command - is a Action.ACTION_COMMAND_KEY
value - an arbitrary value. Usually this will be EventObject which trigered the command.

hasCommand

boolean hasCommand(Object command)
Return a flag that indicates if a command is supported.

Parameters:
command - is a Action.ACTION_COMMAND_KEY
Returns:
true if command is supported; false otherwise

getCommands

Object[] getCommands()
Returns an array of supported commands. If this Targetable doesn't support any commands (which is unlikely) then an empty array is returned.

Returns:
array of supported commands