|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.AbstractAction com.cosylab.gui.components.util.ActionList
public class ActionList
An action which holds a list of other Action
objects.
Convenient for containment of functionally similar actions.
With asotiation with Action
can be used for creation of menus.
Set putValue(MENU_CONTEXT,MENU_CONTEXT_RADIO)
to produce group
of radio menu items.
Action
will use separator menu item, where null
actionitemisplaced or Action has SEPARATOR
boolean attribute.
Field Summary | |
---|---|
static java.lang.String |
ACTIONS
DOCUMENT ME! |
static java.lang.String |
MENU_CONTEXT
Key name for a String value indicating if this list is to be presented in menu with buttons or radio buttons. |
static java.lang.String |
MENU_CONTEXT_BUTTON
DOCUMENT ME! |
static java.lang.String |
MENU_CONTEXT_RADIO
DOCUMENT ME! |
static java.lang.String |
SEPARATOR
Key name for a Boolean value indicating that the added action should be represented in the GUI as a separator. |
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 | |
---|---|
ActionList()
Creates a new ActionList object. |
|
ActionList(java.lang.String name)
Creates a new ActionList object. |
|
ActionList(java.lang.String name,
javax.swing.Icon icon)
Creates a new ActionList object. |
|
ActionList(java.lang.String name,
javax.swing.Icon icon,
javax.swing.Action[] actions)
Creates a new ActionList object. |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addAction(javax.swing.Action action)
Adds Action to end of the list. |
void |
addAction(int index,
javax.swing.Action action)
|
void |
addAll(ActionList action)
Adds all actions from ActionList to end of the this list in specified order. |
void |
clear()
Removes all actions from this list. |
boolean |
contains(javax.swing.Action action)
Checks if this list contains the given action. |
boolean |
containsActionWithName(java.lang.String name)
Checks if the list containes action with the given name. |
int |
firstIndexOfActionWithName(java.lang.String name)
Returns the index of the first action with the given name. |
javax.swing.Action |
getAction(int index)
Returns Action under provided index. |
javax.swing.Action |
getAction(java.lang.String ID)
Returns Action which command ID corresponds to the provided parameter. |
int |
indexOf(javax.swing.Action action)
|
java.util.Iterator |
iterator()
Returns iterator over contained actions. |
void |
removeAction(javax.swing.Action action)
|
javax.swing.Action |
removeAction(int index)
|
int |
size()
Returns the size of this list (number of actions in the list). |
javax.swing.Action[] |
toArray()
Returns all contained actions in an array. |
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 |
Field Detail |
---|
public static final java.lang.String SEPARATOR
public static final java.lang.String MENU_CONTEXT
Action.getValue(java.lang.String)
,
Constant Field Valuespublic static final java.lang.String MENU_CONTEXT_BUTTON
public static final java.lang.String MENU_CONTEXT_RADIO
public static java.lang.String ACTIONS
Constructor Detail |
---|
public ActionList()
public ActionList(java.lang.String name)
name
- public ActionList(java.lang.String name, javax.swing.Icon icon)
name
- icon
- public ActionList(java.lang.String name, javax.swing.Icon icon, javax.swing.Action[] actions)
name
- icon
- actions
- Method Detail |
---|
public void addAction(javax.swing.Action action)
action
- Action to be addedpublic boolean contains(javax.swing.Action action)
action
-
public boolean containsActionWithName(java.lang.String name)
name
- name of the action
public int firstIndexOfActionWithName(java.lang.String name)
name
- name of the action
public void addAll(ActionList action)
action
- actions to be addedpublic void addAction(int index, javax.swing.Action action)
public javax.swing.Action getAction(int index)
index
- the index of requested action
public javax.swing.Action getAction(java.lang.String ID)
ID
- the command key string of action
Action.ACTION_COMMAND_KEY
public int indexOf(javax.swing.Action action)
public void removeAction(javax.swing.Action action)
public javax.swing.Action removeAction(int index)
public int size()
public void actionPerformed(java.awt.event.ActionEvent e)
public javax.swing.Action[] toArray()
public java.util.Iterator iterator()
public void clear()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |