|
JAPI 0.9.0 Yet another Java API API Documentation |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.AbstractAction
net.sf.japi.swing.ToggleAction
public final class ToggleAction
The ToggleAction works similar as an ReflectionAction. But it keeps track of the components. Be sure to use its factory methodsA
| Field Summary | |
|---|---|
static String |
REFLECTION_PROPERTY_NAME
The key used for storing the target object's boolean property name to find the methods Value Type: String. |
static String |
REFLECTION_TARGET
The key used for storing the target object to invoke the methods on. |
| Fields inherited from class javax.swing.AbstractAction |
|---|
changeSupport, enabled |
| Fields inherited from interface javax.swing.Action |
|---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SHORT_DESCRIPTION, SMALL_ICON |
| Constructor Summary | |
|---|---|
ToggleAction()
|
|
| Method Summary | |
|---|---|
void |
actionPerformed(ActionEvent e)
Invoked when an action occurs. |
protected Object |
clone()
Clones the abstract action. |
JCheckBox |
createCheckBox()
Create a JCheckBox for this action. |
JCheckBoxMenuItem |
createCheckBoxMenuItem()
Create a JCheckBoxMenuItem. |
boolean |
isSelected()
Returns the state of the action. |
void |
putValue(String key,
Object newValue)
Sets the Value associated with the specified key.
This implementation checks the type of newValue if the key is REFLECTION_TARGET or REFLECTION_PROPERTY_NAME, so you'll know of errors quite soon. |
void |
setSelected(boolean selected)
Update the selected state. |
| Methods inherited from class javax.swing.AbstractAction |
|---|
addPropertyChangeListener, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, removePropertyChangeListener, setEnabled |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String REFLECTION_TARGET
Object.
public static final String REFLECTION_PROPERTY_NAME
String.
| Constructor Detail |
|---|
public ToggleAction()
| Method Detail |
|---|
public boolean isSelected()
public void actionPerformed(ActionEvent e)
protected Object clone()
throws CloneNotSupportedException
Object.clone().
clone in class AbstractActionCloneNotSupportedException - if the object's class does not
support the Cloneable interface. Subclasses
that override the clone method can also
throw this exception to indicate that an instance cannot
be cloned.Cloneablepublic JCheckBox createCheckBox()
public JCheckBoxMenuItem createCheckBoxMenuItem()
public void putValue(String key,
Object newValue)
throws IllegalArgumentException
Value associated with the specified key.
This implementation checks the type of newValue if the key is REFLECTION_TARGET or REFLECTION_PROPERTY_NAME, so you'll know of errors quite soon.
putValue in interface ActionputValue in class AbstractActionkey - the String that identifies the stored objectnewValue - the Object to store using this key
IllegalArgumentException - if newValue is of the wrong typeAction.putValue(java.lang.String, java.lang.Object)public void setSelected(boolean selected)
selected - new selected state
|
JAPI Yet another Java API API Documentation |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||