|
|||||||||
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.ActionGroup
An ActionGroup is a type of UpdateAction that is actually a group of nested Action objects (potentially including nested ActionGroups). ActionGroups are used to define groups of Actions - that might appear as a set of items between separators on a menu, as a pop-up menu, or as a button cluster on a toolbar.
ActionGroups are used to build an Action hierarchy that can be mapped directly on a hierarchical UI - like a menu. Subclasses of ActionGroup do not need to override any methods. They are typically known groups that appear in different parts of the UI. An example ActionGroup is the list of Wizards.
Action
, Serialized FormField Summary | |
protected java.util.ArrayList |
aList
The storage for the group of Actions. |
static java.lang.String |
DEFAULT_ACTION
The attribute key for the DEFAULT_ACTION (Integer) property. |
static java.lang.String |
LIST
The attribute key for the LIST (pseudo) property. |
static java.lang.String |
POPUP
The storage attribute key for the POPUP (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 | |
ActionGroup()
Constructs an ActionGroup with all default settings. |
|
ActionGroup(java.lang.String shortText)
Constructs an ActionGroup with the specified shortText. |
|
ActionGroup(java.lang.String shortText,
char mnemonic)
Constructs an ActionGroup with the specified shortText and mnemonic. |
|
ActionGroup(java.lang.String shortText,
char mnemonic,
boolean popup)
Constructs an ActionGroup with the specified shortText, mnemonic, and popup setting. |
|
ActionGroup(java.lang.String shortText,
char mnemonic,
java.lang.String longText)
Constructs an ActionGroup with the specified shortText, mnemonic, and longText. |
|
ActionGroup(java.lang.String shortText,
char mnemonic,
java.lang.String longText,
javax.swing.Icon smallIcon)
Constructs an ActionGroup with the specified shortText, mnemonic, longText, and smallIcon. |
|
ActionGroup(java.lang.String shortText,
char mnemonic,
java.lang.String longText,
javax.swing.Icon smallIcon,
boolean popup)
Constructs an ActionGroup with the specified shortText, mnemonic, longText, smallIcon, and popup setting. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
The default implementation of actionPerformed(ActionEvent e) does nothing for an ActionGroup. |
void |
add(javax.swing.Action a)
Adds a Action to the end of this ActionGroup. |
void |
add(int index,
javax.swing.Action a)
Adds a Action into this ActionGroup at the specified index. |
javax.swing.Action |
getAction(int index)
Returns the Action object at the specified index. |
int |
getActionCount()
Returns the number of Actions in this ActionGroup. |
javax.swing.Action[] |
getActions()
Returns an array of Action objects in this ActionGroup. |
int |
getDefaultAction()
Returns the default action index. |
boolean |
isPopup()
Returns the popup property setting. |
void |
remove(javax.swing.Action a)
Removes the specified Action from this ActionGroup. |
void |
removeAll()
Removes all Actions from this ActionGroup. |
void |
setDefaultAction(int defaultAction)
Sets the default action index. |
void |
setPopup(boolean popup)
Sets the popup property. |
void |
update(java.lang.Object source)
The default implementation of update is as follows: If the ActionGroup's popup property is set to true, nothing happens. |
Methods inherited from class com.borland.primetime.actions.UpdateAction |
getHelpTopic,
getLargeIcon,
getLongText,
getMnemonic,
getShortText,
getSmallIcon,
setHelpTopic,
setLargeIcon,
setLongText,
setMnemonic,
setShortText,
setSmallIcon |
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 POPUP
public static final java.lang.String LIST
public static final java.lang.String DEFAULT_ACTION
protected java.util.ArrayList aList
Constructor Detail |
public ActionGroup()
public ActionGroup(java.lang.String shortText)
shortText
- The short text for the ActionGrouppublic ActionGroup(java.lang.String shortText, char mnemonic)
shortText
- The short text for the ActionGroupmnemonic
- The mnemonic for the ActionGrouppublic ActionGroup(java.lang.String shortText, char mnemonic, boolean popup)
shortText
- The short text for the ActionGroupmnemonic
- The mnemonic for the ActionGrouppopup
- The popup setting for the ActionGrouppublic ActionGroup(java.lang.String shortText, char mnemonic, java.lang.String longText)
shortText
- The short text for the ActionGroupmnemonic
- The mnemonic for the ActionGrouplongText
- The long text for the ActionGrouppublic ActionGroup(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon)
shortText
- The short text for the ActionGroupmnemonic
- The mnemonic for the ActionGrouplongText
- The long text for the ActionGroupsmallIcon
- The small icon for the ActionGrouppublic ActionGroup(java.lang.String shortText, char mnemonic, java.lang.String longText, javax.swing.Icon smallIcon, boolean popup)
shortText
- The short text for the ActionGroupmnemonic
- The mnemonic for the ActionGrouplongText
- The long text for the ActionGroupsmallIcon
- The small icon for the ActionGrouppopup
- The popup setting for the ActionGroupMethod Detail |
public void setDefaultAction(int defaultAction)
defaultAction
- The default action index for this ActionGrouppublic int getDefaultAction()
public void setPopup(boolean popup)
popup
- The popup setting for the ActionGroup (default: false)public boolean isPopup()
public int getActionCount()
public javax.swing.Action getAction(int index)
public javax.swing.Action[] getActions()
public void add(javax.swing.Action a)
a
- The Action object to add to the end of this ActionGroup.public void add(int index, javax.swing.Action a)
index
- The int location to insert the Action object.a
- The Action object to insert into this ActionGroup.public void remove(javax.swing.Action a)
a
- The Action object to remove from this ActionGroup.public void removeAll()
public void update(java.lang.Object source)
The default implementation of update is as follows: If the ActionGroup's popup property is set to true, nothing happens. If the popup property is false (a flat ActionGroup), the nested Actions are scanned, and the update method is called on each one (that is a UpdateAction).
A subclass may wish to also respond to the update call and enable or disable the popup itself. Be sure to call super.update(...) when overriding, so that nested Actions are appropriately notified as well.
source
- The source of the action that is about to be displayed as UI.public final void actionPerformed(java.awt.event.ActionEvent e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |