public class BasicSelectionModel extends Object implements SelectionModel
MULTIPLE_SELECTION, SINGLE_SELECTION| Constructor and Description |
|---|
BasicSelectionModel()
Construct an empty selection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addSelection(Object sel)
Add an object to the selection.
|
void |
addSelectionListener(SelectionListener l)
Add a selection listener to this model.
|
void |
addSelections(Object[] sels)
Add an array of objects to the selection and
highlight the selected objects.
|
void |
clearSelection()
Clear the selection.
|
boolean |
containsSelection(Object sel)
Test if the selection contains the given object
|
void |
dispatchSelectionEvent(SelectionEvent e)
Dispatch a selection event to all registered listeners
|
Object |
getFirstSelection()
Return the first selection in the list.
|
Object |
getLastSelection()
Return the last selection in the list.
|
Iterator |
getSelection()
Return an iterator over the selected objects.
|
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(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.
|
public void addSelectionListener(SelectionListener l)
addSelectionListener in interface SelectionModelpublic void addSelection(Object sel)
addSelection in interface SelectionModelpublic void addSelections(Object[] sels)
addSelections in interface SelectionModelpublic void clearSelection()
clearSelection in interface SelectionModelpublic boolean containsSelection(Object sel)
containsSelection in interface SelectionModelpublic void dispatchSelectionEvent(SelectionEvent e)
public Object getFirstSelection()
getFirstSelection in interface SelectionModelpublic Object getLastSelection()
getLastSelection in interface SelectionModelpublic Iterator getSelection()
getSelection in interface SelectionModelpublic Object[] getSelectionAsArray()
getSelectionAsArray in interface SelectionModelpublic int getSelectionCount()
getSelectionCount in interface SelectionModelpublic int getSelectionMode()
getSelectionMode in interface SelectionModelpublic void removeSelection(Object sel)
removeSelection in interface SelectionModelpublic void removeSelectionListener(SelectionListener l)
removeSelectionListener in interface SelectionModelpublic void setSelectionMode(int mode)
setSelectionMode in interface SelectionModelCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.