uic.model
Class UICToggleAction
java.lang.Object
uic.model.UICSimpleAction
uic.model.UICAction
uic.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
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 |
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 nonekeyStroke
- the keyStroke in the format accepted by javax.swing.KeyStroke.getKeyStroke(String)toolTipText
- the text for tooltips, or null for nonewhatIsThis
- the text for the statusBar.actions
- the actionFactory this action belongs to.- See Also:
KeyStroke.getKeyStroke(String)
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