public interface SelectionModel
Modifier and Type | Field and Description |
---|---|
static int |
MULTIPLE_SELECTION
Allow multiple screen objects to be
selected at once.
|
static int |
SINGLE_SELECTION
Allow only one screen object to
be selected at a time.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelection(java.lang.Object sel)
Add an object to the selection.
|
void |
addSelectionListener(SelectionListener l)
Add a selection listener to this model.
|
void |
addSelections(java.lang.Object[] sel)
Add an array of objects to the selection. the model should
highlight the selected objects.
|
void |
clearSelection()
Clear the selection.
|
boolean |
containsSelection(java.lang.Object sel)
Test if the selection contains the given object
|
java.lang.Object |
getFirstSelection()
Return the first selection in the list.
|
java.lang.Object |
getLastSelection()
Return the last selection in the list.
|
java.util.Iterator |
getSelection()
Return an iterator over the selected objects.
|
java.lang.Object[] |
getSelectionAsArray()
Return the contents of the selection as an array.
|
int |
getSelectionCount()
Return the number of selected objects.
|
int |
getSelectionMode()
Return the mode of the selection, either
SINGLE_SELECTION or MULTIPLE_SELECTION.
|
void |
removeSelection(java.lang.Object sel)
Remove an object from the selection.
|
void |
removeSelectionListener(SelectionListener l)
Remove a listener from the list of listeners.
|
void |
setSelectionMode(int mode)
Set the selection mode, either
SINGLE_SELECTION or MULTIPLE_SELECTION.
|
static final int SINGLE_SELECTION
static final int MULTIPLE_SELECTION
void addSelectionListener(SelectionListener l)
void addSelection(java.lang.Object sel)
void addSelections(java.lang.Object[] sel)
void clearSelection()
boolean containsSelection(java.lang.Object sel)
java.lang.Object getFirstSelection()
java.lang.Object getLastSelection()
java.util.Iterator getSelection()
java.lang.Object[] getSelectionAsArray()
int getSelectionCount()
int getSelectionMode()
void removeSelectionListener(SelectionListener l)
void removeSelection(java.lang.Object sel)
void setSelectionMode(int mode)