org.bs.mdi.swing
Class SwingCommandTrigger

java.lang.Object
  extended byorg.bs.mdi.swing.SwingCommandTrigger
All Implemented Interfaces:
CommandTrigger
Direct Known Subclasses:
SwingCommandButton, SwingCommandMenu

public abstract class SwingCommandTrigger
extends Object
implements CommandTrigger

Enhanced CommandTrigger with additional GUI functionality


Constructor Summary
SwingCommandTrigger(SwingCommand command)
          Creates a new command trigger.
 
Method Summary
 void commandExecuted(CommandTrigger trigger)
          Informs this trigger that the associated command has been executed.
 void commandUpdated()
          Informs this trigger that the associated command has changed.
 void execute()
          Shortcut for getCommand().execute().
 Command getCommand()
          Gets the command which is associated with this command trigger.
abstract  boolean removeFrom(Container container)
          Removes this trigger from the sepecified container.
abstract  void setEnabled(boolean enabled)
          Enables or disables this command trigger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwingCommandTrigger

public SwingCommandTrigger(SwingCommand command)
Creates a new command trigger. Note that this is an abstract class which cannot be instantiated directly.

Parameters:
command - the command to be associated with the trigger
Method Detail

getCommand

public Command getCommand()
Description copied from interface: CommandTrigger
Gets the command which is associated with this command trigger.

Specified by:
getCommand in interface CommandTrigger
Returns:
the associated command

setEnabled

public abstract void setEnabled(boolean enabled)
Description copied from interface: CommandTrigger
Enables or disables this command trigger.

Specified by:
setEnabled in interface CommandTrigger
Parameters:
enabled - true if this trigger should be enabled, false otherwise

execute

public void execute()
Description copied from interface: CommandTrigger
Shortcut for getCommand().execute().

Specified by:
execute in interface CommandTrigger

removeFrom

public abstract boolean removeFrom(Container container)
Removes this trigger from the sepecified container.

Parameters:
container - the container which is supposed to contain this trigger
Returns:
true if the trigger has been removed, false otherwise

commandExecuted

public void commandExecuted(CommandTrigger trigger)
Description copied from interface: CommandTrigger
Informs this trigger that the associated command has been executed. Note that the command may have been fired by either this trigger or another trigger which has been associated with the command.

Specified by:
commandExecuted in interface CommandTrigger
Parameters:
trigger - the trigger which made the command execute

commandUpdated

public void commandUpdated()
Description copied from interface: CommandTrigger
Informs this trigger that the associated command has changed. This typically includes name or description changes. The trigger should update itself to reflect that changes.

Specified by:
commandUpdated in interface CommandTrigger