|
NextApp Echo3 v3.0.b4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nextapp.echo.app.Component nextapp.echo.app.list.AbstractListComponent nextapp.echo.app.ListBox
public class ListBox
ListBox
component: a selection component which displays selection items in a list. May be configured to allow the
selection of one item at a time, or to allow the selection of multiple items at one time. Does not support child components.
Field Summary |
---|
Constructor Summary | |
---|---|
ListBox()
Creates an empty ListBox . |
|
ListBox(ListModel model)
Creates a ListBox visualizing the specified model. |
|
ListBox(ListModel model,
ListSelectionModel selectionModel)
Creates a ListBox visualizing the specified
ListModel and describing selections using the specified
ListSelectionModel . |
|
ListBox(java.lang.Object[] itemArray)
Creates a ListBox with a DefaultListModel
that initially contains the specified array of items. |
Method Summary | |
---|---|
int |
getMaxSelectedIndex()
Returns the maximum selected index. |
int |
getMinSelectedIndex()
Returns the minimum selected index. |
int[] |
getSelectedIndices()
Returns all selected indices. |
java.lang.Object |
getSelectedValue()
Returns the selected item. |
java.lang.Object[] |
getSelectedValues()
Returns all selected items. |
int |
getSelectionMode()
Returns the selection mode. |
boolean |
isSelectedIndex(int index)
Determines whether an index is selected. |
void |
setSelectedIndex(int index)
Selects only the given index. |
void |
setSelectedIndex(int index,
boolean selected)
Sets the selection state of the given index. |
void |
setSelectedIndices(int[] indices)
Selects the specified indices, deselecting any other indices. |
void |
setSelectionMode(int newValue)
Sets the selection mode. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListBox()
ListBox
.
A DefaultListModel
will be created.
A DefaultListSelectionModel
will be created and used
to describe selections.
public ListBox(ListModel model)
ListBox
visualizing the specified model.
A DefaultListSelectionModel
will be created and used
to describe selections.
model
- the initial modelpublic ListBox(ListModel model, ListSelectionModel selectionModel)
ListBox
visualizing the specified
ListModel
and describing selections using the specified
ListSelectionModel
.
model
- the initial modelselectionModel
- the initial selection modelpublic ListBox(java.lang.Object[] itemArray)
ListBox
with a DefaultListModel
that initially contains the specified array of items.
A DefaultListSelectionModel
will be created and used
to describe selections.
itemArray
- an array of items that will initially populate
this ListBox
Method Detail |
---|
public int getMaxSelectedIndex()
public int getMinSelectedIndex()
public int[] getSelectedIndices()
public java.lang.Object getSelectedValue()
public java.lang.Object[] getSelectedValues()
public int getSelectionMode()
ListSelectionModel.SINGLE_SELECTION
: only one
list element may be selected.ListSelectionModel.MULTIPLE_SELECTION
:
multiple list elements may be selected.public boolean isSelectedIndex(int index)
index
- the index
public void setSelectedIndex(int index)
index
- the indexpublic void setSelectedIndex(int index, boolean selected)
index
- the indexselected
- the selection statepublic void setSelectedIndices(int[] indices)
indices
- the indices to be selectedpublic void setSelectionMode(int newValue)
newValue
- the selection mode, one of the following values:
ListSelectionModel.SINGLE_SELECTION
: only one
list element may be selected.ListSelectionModel.MULTIPLE_SELECTION
:
multiple list elements may be selected.
|
NextApp Echo3 v3.0.b4 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |