|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.AbstractAction | +--com.borland.primetime.actions.UpdateAction | +--com.borland.primetime.actions.StateAction
A StateAction is a type of UpdateAction that encapsulates a single state property.
A StateAction functions as a regular UpdateAction (or Swing Action object) - it stores the shortText, longText, icon, and enabled state for a single boolean state. The difference is that a StateAction represents a boolean state - as opposed to the UpdateAction (or Action) that represents an arbitrary action.
Subclasses of StateAction need only override the two abstract methods:
public void setState(Object source, boolean state)
and
public boolean getState(Object source)
. They can optionally
override the public method: public void update(Object source)
to initialize the StateAction object immediately before it is
represented as UI somewhere in the environment.
The Grouped property is added to allow a StateAction to appear as grouped in UI - like the use of a radio button or toggle button instead of a checkbox.
Action
, Serialized FormField Summary | |
static java.lang.String |
GROUPED
The storage attribute key for the GROUPED (Boolean) property. |
Fields inherited from class com.borland.primetime.actions.UpdateAction |
ACCELERATOR,
EMPTY_ARRAY,
HELP_TOPIC,
LARGE_ICON,
MNEMONIC |
Fields inherited from class javax.swing.AbstractAction |
changeSupport,
enabled |
Constructor Summary | |
StateAction()
Constructs a StateAction will all default properties. |
|
StateAction(java.lang.String shortText)
Constructs a StateAction will the specified shortText. |
|
StateAction(java.lang.String shortText,
char mnemonic)
Constructs a StateAction will the specified shortText and mnemonic. |
|
StateAction(java.lang.String shortText,
char mnemonic,
java.lang.String longText)
Constructs a StateAction will the specified shortText, mnemonic, and longText. |
|
StateAction(java.lang.String shortText,
char mnemonic,
java.lang.String longText,
javax.swing.Icon smallIcon)
Constructs a StateAction will the specified shortText, mnemonic, longText, and smallIcon. |
|
StateAction(java.lang.String shortText,
char mnemonic,
java.lang.String longText,
javax.swing.Icon smallIcon,
boolean grouped)
Constructs a StateAction will the specified shortText, mnemonic, longText, smallIcon, and grouped setting. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
The StateAction class implements the actionPerformed(ActionEvent e)
method as a toggle. |
abstract boolean |
getState(java.lang.Object source)
Subclasses should implement this method by returning the appropriate boolean based on the passed source context. |
boolean |
isGrouped()
Returns the grouped property setting. |
void |
setGrouped(boolean grouped)
Sets the grouped property. |
abstract void |
setState(java.lang.Object source,
boolean state)
Subclasses should implement this method by setting the appropriate boolean state using the passed source context. |
Methods inherited from class com.borland.primetime.actions.UpdateAction |
getHelpTopic,
getLargeIcon,
getLongText,
getMnemonic,
getShortText,
getSmallIcon,
setHelpTopic,
setLargeIcon,
setLongText,
setMnemonic,
setShortText,
setSmallIcon,
update |
Methods inherited from class javax.swing.AbstractAction |
addPropertyChangeListener,
clone,
firePropertyChange,
getValue,
isEnabled,
putValue,
removePropertyChangeListener,
setEnabled |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String GROUPED
Constructor Detail |
public StateAction()
public StateAction(java.lang.String shortText)
shortText
- The short text for the StateActionpublic StateAction(java.lang.String shortText, char mnemonic)
shortText
- The short text for the StateActionmnemonic
- The mnemonic for the StateActionpublic StateAction(java.lang.String shortText, char mnemonic, java.lang.String longText)
shortText
- The short text for the StateActionmnemonic
- The mnemonic for the StateActionlongText
- The long text for the StateActionpublic StateAction(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon)
shortText
- The short text for the StateActionmnemonic
- The mnemonic for the StateActionlongText
- The long text for the StateActionsmallIcon
- The small icon for the StateActionpublic StateAction(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon, boolean grouped)
shortText
- The short text for the StateActionmnemonic
- The mnemonic for the StateActionlongText
- The long text for the StateActionsmallIcon
- The small icon for the StateActiongrouped
- The grouped setting for the StateActionMethod Detail |
public void setGrouped(boolean grouped)
grouped
- The grouped statepublic boolean isGrouped()
public final void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed(ActionEvent e)
method as a toggle. This behavior cannot be overriden.public abstract void setState(java.lang.Object source, boolean state)
public abstract boolean getState(java.lang.Object source)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |