|
JAPI 0_6-alpha-2 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)
|
protected Object |
clone()
|
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)
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
clone in class AbstractActionCloneNotSupportedExceptionpublic JCheckBox createCheckBox()
public JCheckBoxMenuItem createCheckBoxMenuItem()
public void putValue(String key,
Object newValue)
throws IllegalArgumentException
REFLECTION_TARGET or REFLECTION_PROPERTY_NAME, so you'll know of errors quite soon.
putValue in interface ActionputValue in class AbstractActionIllegalArgumentException - if newValue is of the wrong typepublic 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 | |||||||||