public abstract class IlvListActionHandler extends IlvSingleActionHandler
isList="true"
.
For example, the action that displays the main recent file list of the
application is defined as follows:
<action actionCommand="RecentFiles" isList="true" ...For more details on list actions, see the
IlvAction
class.Constructor and Description |
---|
IlvListActionHandler(String command)
Constructs a new
IlvListActionHandler that handles the
list action with the specified command key. |
Modifier and Type | Method and Description |
---|---|
String |
getEmptyString()
Returns the empty string used when the list action does not contain
any items.
|
char |
getFirstNumberingCharacter()
Returns the character used for numbering the menu items associated
with the items of the list action.
|
Object[] |
getListItems()
Returns the items that are stored in the list action handled by this object.
|
int |
getMenuItemMaximumLength()
Returns the maximum number of characters allowed for displaying menu
items associated with items of the list action that this object handles.
|
int |
getSelectedItem()
Returns the index of the currently selected item in the list items of the
list action.
|
boolean |
isDynamicList()
Determines whether the items stored in the list action are dynamically
determined before displaying the pop-up menu associated with the list action.
|
boolean |
isNumbering()
Determines whether menu items displaying list items of the list action
are prefixed with a numbering string.
|
boolean |
isSubMenuItems()
Determines whether the menu items created for the items of the
list action should be created in a sub pop-up menu.
|
protected void |
selectedItemChanged(int index,
Object object)
Invoked when the selected item of the list of items has changed.
|
void |
setAction(Action action)
Sets the action this object handles.
|
void |
setDynamicList(boolean dynamic)
Specifies the dynamic list mode of the list action this object handles.
|
void |
setEmptyString(String emptyString)
Sets the string used when the list action does not contain
any items.
|
void |
setFirstNumberingCharacter(char c)
Sets the character used for numbering the menu item associated with
the items of the list action.
|
void |
setListItems(Object[] items)
Sets the items that are stored in the list action handled by this object.
|
void |
setMenuItemMaximumLength(int maxLength)
Sets the maximum number of characters allowed for displaying the menu items
associated with items of the list action that this object handles.
|
void |
setNumbering(boolean numbering)
Specifies whether menu items displaying list items of the list action
should be prefixed with a numbering string.
|
void |
setSelectedItem(int index)
Sets the newly selected item in the list of items of the list action.
|
void |
setSubMenuItems(boolean subMenu)
Creates the menu items for the items of the list action in a sub pop-up menu
or below the menu item associated with the list action, depending on the
value of the
subMenu parameter. |
actionPerformed, getAction, getCommand, isProcessingAction, setCommand, updateAction, updateSingleAction
public IlvListActionHandler(String command)
IlvListActionHandler
that handles the
list action with the specified command
key.command
- The command key of the action handled by this action handler.public Object[] getListItems()
public void setListItems(Object[] items)
items
- The new items of the list action.getListItems()
,
IlvAction.SetListItems(javax.swing.Action, java.lang.Object[])
public int getSelectedItem()
-1
if no item is selected.setSelectedItem(int)
,
selectedItemChanged(int, java.lang.Object)
,
IlvAction.GetSelectionIndex(javax.swing.Action)
public void setSelectedItem(int index)
index
- The index of the newly selected list item.getSelectedItem()
,
selectedItemChanged(int, java.lang.Object)
,
IlvAction.SetSelectionIndex(javax.swing.Action, int)
protected void selectedItemChanged(int index, Object object)
index
- The index of the newly selected item.object
- The newly selected item.getSelectedItem()
,
setSelectedItem(int)
public boolean isDynamicList()
IlvSingleActionHandler.updateAction(javax.swing.Action)
is
invoked just before the pop-up menu is displayed.true
if list items are dynamically set;
false
otherwise.setDynamicList(boolean)
public void setDynamicList(boolean dynamic)
dynamic
- If true
, list items are defined just before
the pop-up menu associated with the list action is displayed; otherwise,
list items are set once using the setListItems(java.lang.Object[])
method.isDynamicList()
public boolean isSubMenuItems()
true
if menu items are created in a sub pop-up menu;
false
otherwise.setSubMenuItems(boolean)
public void setSubMenuItems(boolean subMenu)
subMenu
parameter.subMenu
- If true
, menu items will be created in a
sub pop-up menu; if false
, menu items will be created
below the menu item associated with the list action and the menu item
will become invisible.isSubMenuItems()
public int getMenuItemMaximumLength()
setMenuItemMaximumLength(int)
public void setMenuItemMaximumLength(int maxLength)
maxLength
- The new maximum number of characters.getMenuItemMaximumLength()
public boolean isNumbering()
public void setNumbering(boolean numbering)
numbering
- If true
, menu items will be prefixed with
a numbering string; if false
, menu items will not be prefixed.isNumbering()
,
getFirstNumberingCharacter()
public char getFirstNumberingCharacter()
isNumbering()
returns true
).public void setFirstNumberingCharacter(char c)
isNumbering()
returns true
).c
- The first numbering character.getFirstNumberingCharacter()
,
isNumbering()
public String getEmptyString()
public void setEmptyString(String emptyString)
emptyString
- The new empty string. The specified string should be a
key to a string resource.getEmptyString()
public void setAction(Action action)
IlvSingleActionHandler.setCommand(java.lang.String)
method.setAction
in class IlvSingleActionHandler
action
- The new action this instance handles.IlvSingleActionHandler.getAction()
,
IlvSingleActionHandler.setCommand(java.lang.String)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.