|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.AbstractAction
de.tkuhn.swing.actions.DelegatingAction
de.tkuhn.swing.actions.BooleanPreferenceAction
public class BooleanPreferenceAction
BooleanPreferenceAction
is a BooleanAction
that is
linked together with a boolean Preferences
mapping. The state of
the action is the reflected of the preference mapping. It also implements the
ForwardingAction
interface.
BooleanAction
,
ForwardingAction
,
Preferences
,
Serialized FormField Summary |
---|
Fields inherited from class javax.swing.AbstractAction |
---|
changeSupport, enabled |
Fields inherited from interface javax.swing.Action |
---|
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON |
Constructor Summary | |
---|---|
BooleanPreferenceAction(java.util.prefs.Preferences prefs,
java.lang.String key,
boolean defaultReturn)
Creates a new instance of BooleanPreferenceAction |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent actionEvent)
Implementation of actionPerformed() in
ActionListener . |
void |
destroy()
If this is not called this object may not be garbage collected since it is registered as a PreferenceChangeListener . |
boolean |
isSelected()
Getter for property selected. |
void |
preferenceChange(java.util.prefs.PreferenceChangeEvent pce)
Implementation of preferenceChange() in
PreferenceChangeListener . |
void |
setSelected(boolean selected)
Setter for property selected. |
Methods inherited from class de.tkuhn.swing.actions.DelegatingAction |
---|
addActionListener, removeActionListener |
Methods inherited from class javax.swing.AbstractAction |
---|
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.Action |
---|
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled |
Constructor Detail |
---|
public BooleanPreferenceAction(java.util.prefs.Preferences prefs, java.lang.String key, boolean defaultReturn)
prefs
- the Preferences
holding the boolean mappingkey
- the key of the mappingdefaultReturn
- the boolean value that should returned if the backing store of
the Preferences
is not reachable.Method Detail |
---|
public void preferenceChange(java.util.prefs.PreferenceChangeEvent pce)
preferenceChange()
in
PreferenceChangeListener
.
preferenceChange
in interface java.util.prefs.PreferenceChangeListener
pce
- the PreferenceChangeEvent
to be processed.public void destroy()
PreferenceChangeListener
.
public boolean isSelected()
isSelected
in interface BooleanAction
public void setSelected(boolean selected)
setSelected
in interface BooleanAction
selected
- New value of property selected.public void actionPerformed(java.awt.event.ActionEvent actionEvent)
actionPerformed()
in
ActionListener
.
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class DelegatingAction
actionEvent
- the ActionEvent
to be processed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |