uic.model
Class UICToggleAction

java.lang.Object
  extended byuic.model.UICSimpleAction
      extended byuic.model.UICAction
          extended byuic.model.UICToggleAction
All Implemented Interfaces:
ActionListener, EventListener

public class UICToggleAction
extends UICAction

An toggle action to add the concept of 'selected'.

Since:
1.2
See Also:
UICToggleAction, ActionFactory

Nested Class Summary
 
Nested classes inherited from class uic.model.UICAction
UICAction.StatusBarUpdater
 
Nested classes inherited from class uic.model.UICSimpleAction
UICSimpleAction.DirectPolicy, UICSimpleAction.ExecutePolicy, UICSimpleAction.OnlyLastPolicy, UICSimpleAction.QueuedPolicy, UICSimpleAction.SimpleQueuedPolicy
 
Field Summary
 
Fields inherited from class uic.model.UICSimpleAction
currentPolicy, target, targetObject
 
Constructor Summary
UICToggleAction(String name)
           
UICToggleAction(String name, Object targetObject, String targetMethod, String title, ActionFactory actions)
           
UICToggleAction(String name, Object targetObject, String targetMethod, String title, String iconBaseName, ActionFactory actions)
           
UICToggleAction(String name, Object targetObject, String targetMethod, String title, String iconBaseName, String keyStroke, ActionFactory actions)
           
UICToggleAction(String name, Object targetObject, String targetMethod, String title, String iconBaseName, String keyStroke, String toolTipText, String whatIsThis, ActionFactory actions)
          Create new action.
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 void addComponent(AbstractButton b)
          A button component that represents this action the the users user interface can be registered here.
protected  void doAction(Object source)
          Called to actually execute the action on the registered method.
 void setSelected(boolean on)
          Set this action to be un/selected selecting/checking all registered components.
 void setTarget(Object object, String targetMethod)
          The target method that is to be called when the action is fired.
 
Methods inherited from class uic.model.UICAction
getComponentsIterator, getIconBaseName, getKeyStroke, getName, getTitle, getToolTipText, getWhatIsThis, setEnabled, setIconBaseName, setKeyStroke, setName, setStatuBar, setTitle, setToolTipText, setWhatIsThis, toString
 
Methods inherited from class uic.model.UICSimpleAction
execute, execute, setDirect, setExecutionPolity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UICToggleAction

public UICToggleAction(String name)

UICToggleAction

public UICToggleAction(String name,
                       Object targetObject,
                       String targetMethod,
                       String title,
                       ActionFactory actions)

UICToggleAction

public UICToggleAction(String name,
                       Object targetObject,
                       String targetMethod,
                       String title,
                       String iconBaseName,
                       ActionFactory actions)

UICToggleAction

public UICToggleAction(String name,
                       Object targetObject,
                       String targetMethod,
                       String title,
                       String iconBaseName,
                       String keyStroke,
                       ActionFactory actions)

UICToggleAction

public UICToggleAction(String name,
                       Object targetObject,
                       String targetMethod,
                       String title,
                       String iconBaseName,
                       String keyStroke,
                       String toolTipText,
                       String whatIsThis,
                       ActionFactory actions)
Create new action.

Parameters:
name - The identifying name of the action, must be unique.
targetObject - The object that contains the method we want to connect to.
targetMethod - the name of the method we want to connect to.
title - the name used on buttons or in a menu entry.
iconBaseName - the basename the new widgets can use to fetch the correct icon, or null if none
keyStroke - the keyStroke in the format accepted by javax.swing.KeyStroke.getKeyStroke(String)
toolTipText - the text for tooltips, or null for none
whatIsThis - the text for the statusBar.
actions - the actionFactory this action belongs to.
See Also:
KeyStroke.getKeyStroke(String)
Method Detail

setTarget

public void setTarget(Object object,
                      String targetMethod)
               throws IllegalArgumentException
Description copied from class: UICSimpleAction
The target method that is to be called when the action is fired.

Overrides:
setTarget in class UICSimpleAction
Parameters:
object - The object that contains the method we want to connect to.
targetMethod - the name of the method we want to connect to.
Throws:
IllegalArgumentException
See Also:
UICSimpleAction.setTarget(java.lang.Object, java.lang.String)

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class UICAction

setSelected

public void setSelected(boolean on)
Set this action to be un/selected selecting/checking all registered components.


addComponent

public void addComponent(AbstractButton b)
Description copied from class: UICAction
A button component that represents this action the the users user interface can be registered here. Any button that is added to this action will trigger the action to respond on a button 'press' after adding it using the addComponent method. Additionaly en/disabling the action will make the component also en/disable.

Overrides:
addComponent in class UICAction
See Also:
UICAction.addComponent(javax.swing.AbstractButton)

doAction

protected void doAction(Object source)
Description copied from class: UICSimpleAction
Called to actually execute the action on the registered method.

Overrides:
doAction in class UICSimpleAction


Copyright © 2002,2003 Thomas Zander Available under the Free Apache licence