R
- the type of rowspublic final class SwingTableSelectionModel<R> extends javax.swing.DefaultListSelectionModel implements SelectionModel<R>
Constructor and Description |
---|
SwingTableSelectionModel(FilteredTableModel<R,?,?> tableModel)
Instantiates a new SwingTableSelectionModel
|
Modifier and Type | Method and Description |
---|---|
void |
addSelectedIndex(int index)
Selects the item at
index |
void |
addSelectedIndexes(java.util.Collection<java.lang.Integer> indexes)
Adds these indexes to the selection
|
void |
addSelectedIndexListener(EventDataListener<java.lang.Integer> listener) |
void |
addSelectedItem(R item)
Adds the given item to the selection
|
void |
addSelectedItemListener(EventDataListener<R> listener) |
void |
addSelectedItems(java.util.Collection<R> items)
Adds the given items to the selection
|
void |
addSelectedItemsListener(EventDataListener<java.util.List<R>> listener) |
void |
addSelectionChangedListener(EventListener listener) |
void |
addSelectionInterval(int fromIndex,
int toIndex) |
void |
fireValueChanged(int firstIndex,
int lastIndex,
boolean isAdjusting) |
StateObserver |
getMultipleSelectionObserver() |
int |
getSelectedIndex() |
java.util.List<java.lang.Integer> |
getSelectedIndexes() |
R |
getSelectedItem() |
java.util.List<R> |
getSelectedItems() |
int |
getSelectionCount() |
StateObserver |
getSelectionEmptyObserver() |
StateObserver |
getSingleSelectionObserver() |
void |
insertIndexInterval(int fromIndex,
int length,
boolean before) |
void |
moveSelectionDown()
Moves all selected indexes down one index, wraps around.
|
void |
moveSelectionUp()
Moves all selected indexes up one index, wraps around.
|
void |
removeIndexInterval(int fromIndex,
int toIndex) |
void |
removeSelectedIndex(int index)
Removes the item at
index from the selection |
void |
removeSelectedIndexes(java.util.Collection<java.lang.Integer> indexes)
Removes the given indexes from the selection
|
void |
removeSelectedIndexListener(EventDataListener listener) |
void |
removeSelectedItem(R item)
Remove the given item from the selection
|
void |
removeSelectedItemListener(EventDataListener listener) |
void |
removeSelectedItems(java.util.Collection<R> items)
Remove the given items from the selection
|
void |
removeSelectedItemsListener(EventDataListener listener) |
void |
removeSelectionChangedListener(EventListener listener) |
void |
removeSelectionInterval(int fromIndex,
int toIndex) |
void |
selectAll()
Selects all visible entities
|
void |
setSelectedIndex(int index)
Clears the selection and selects the item at
index |
void |
setSelectedIndexes(java.util.Collection<java.lang.Integer> indexes)
Selects the given indexes
|
void |
setSelectedItem(R item)
Sets the selected item
|
void |
setSelectedItems(java.util.Collection<R> items)
Selects the given items
|
void |
setSelectionInterval(int fromIndex,
int toIndex) |
addListSelectionListener, clearSelection, clone, fireValueChanged, fireValueChanged, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getSelectionMode, getValueIsAdjusting, isLeadAnchorNotificationEnabled, isSelectedIndex, isSelectionEmpty, moveLeadSelectionIndex, removeListSelectionListener, setAnchorSelectionIndex, setLeadAnchorNotificationEnabled, setLeadSelectionIndex, setSelectionMode, setValueIsAdjusting, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearSelection, isSelectionEmpty
public SwingTableSelectionModel(FilteredTableModel<R,?,?> tableModel)
tableModel
- the FilteredTableModel required for accessing table model items and sizepublic void addSelectedIndex(int index)
index
addSelectedIndex
in interface SelectionModel<R>
index
- the indexpublic void removeSelectedIndex(int index)
index
from the selectionremoveSelectedIndex
in interface SelectionModel<R>
index
- the indexpublic void removeSelectedIndexes(java.util.Collection<java.lang.Integer> indexes)
removeSelectedIndexes
in interface SelectionModel<R>
indexes
- the indexespublic void setSelectedIndex(int index)
index
setSelectedIndex
in interface SelectionModel<R>
index
- the indexpublic int getSelectionCount()
getSelectionCount
in interface SelectionModel<R>
public void addSelectedIndexes(java.util.Collection<java.lang.Integer> indexes)
addSelectedIndexes
in interface SelectionModel<R>
indexes
- the indexes to add to the selectionpublic void setSelectedIndexes(java.util.Collection<java.lang.Integer> indexes)
setSelectedIndexes
in interface SelectionModel<R>
indexes
- the indexes to selectpublic java.util.List<java.lang.Integer> getSelectedIndexes()
getSelectedIndexes
in interface SelectionModel<R>
public int getSelectedIndex()
getSelectedIndex
in interface SelectionModel<R>
public void selectAll()
selectAll
in interface SelectionModel<R>
SelectionModel.addSelectionChangedListener(EventListener)
public R getSelectedItem()
getSelectedItem
in interface SelectionModel<R>
public java.util.List<R> getSelectedItems()
getSelectedItems
in interface SelectionModel<R>
public void setSelectedItem(R item)
setSelectedItem
in interface SelectionModel<R>
item
- the item to selectpublic void setSelectedItems(java.util.Collection<R> items)
setSelectedItems
in interface SelectionModel<R>
items
- the items to selectpublic void addSelectedItem(R item)
addSelectedItem
in interface SelectionModel<R>
item
- the item to add to the selectionpublic void addSelectedItems(java.util.Collection<R> items)
addSelectedItems
in interface SelectionModel<R>
items
- the items to add to the selectionpublic void removeSelectedItem(R item)
removeSelectedItem
in interface SelectionModel<R>
item
- the item to remove from the selectionpublic void removeSelectedItems(java.util.Collection<R> items)
removeSelectedItems
in interface SelectionModel<R>
items
- the items to remove from the selectionpublic void addSelectionInterval(int fromIndex, int toIndex)
addSelectionInterval
in interface javax.swing.ListSelectionModel
addSelectionInterval
in class javax.swing.DefaultListSelectionModel
public void setSelectionInterval(int fromIndex, int toIndex)
setSelectionInterval
in interface javax.swing.ListSelectionModel
setSelectionInterval
in class javax.swing.DefaultListSelectionModel
public void removeSelectionInterval(int fromIndex, int toIndex)
removeSelectionInterval
in interface javax.swing.ListSelectionModel
removeSelectionInterval
in class javax.swing.DefaultListSelectionModel
public void insertIndexInterval(int fromIndex, int length, boolean before)
insertIndexInterval
in interface javax.swing.ListSelectionModel
insertIndexInterval
in class javax.swing.DefaultListSelectionModel
public void removeIndexInterval(int fromIndex, int toIndex)
removeIndexInterval
in interface javax.swing.ListSelectionModel
removeIndexInterval
in class javax.swing.DefaultListSelectionModel
public void moveSelectionUp()
moveSelectionUp
in interface SelectionModel<R>
SelectionModel.addSelectionChangedListener(EventListener)
public void moveSelectionDown()
moveSelectionDown
in interface SelectionModel<R>
SelectionModel.addSelectionChangedListener(EventListener)
public void fireValueChanged(int firstIndex, int lastIndex, boolean isAdjusting)
fireValueChanged
in class javax.swing.DefaultListSelectionModel
public void addSelectedIndexListener(EventDataListener<java.lang.Integer> listener)
addSelectedIndexListener
in interface SelectionModel<R>
listener
- a listener to be notified each time the selected index changespublic void removeSelectedIndexListener(EventDataListener listener)
removeSelectedIndexListener
in interface SelectionModel<R>
listener
- the listener to removepublic void addSelectionChangedListener(EventListener listener)
addSelectionChangedListener
in interface SelectionModel<R>
listener
- a listener to be notified each time the selection changespublic void removeSelectionChangedListener(EventListener listener)
removeSelectionChangedListener
in interface SelectionModel<R>
listener
- the listener to removepublic void addSelectedItemListener(EventDataListener<R> listener)
addSelectedItemListener
in interface SelectionModel<R>
listener
- a listener to be notified each time the selected item changespublic void removeSelectedItemListener(EventDataListener listener)
removeSelectedItemListener
in interface SelectionModel<R>
listener
- the listener to removepublic void addSelectedItemsListener(EventDataListener<java.util.List<R>> listener)
addSelectedItemsListener
in interface SelectionModel<R>
listener
- a listener to be notified each time the selected items changepublic void removeSelectedItemsListener(EventDataListener listener)
removeSelectedItemsListener
in interface SelectionModel<R>
listener
- the listener to removepublic StateObserver getMultipleSelectionObserver()
getMultipleSelectionObserver
in interface SelectionModel<R>
public StateObserver getSingleSelectionObserver()
getSingleSelectionObserver
in interface SelectionModel<R>
public StateObserver getSelectionEmptyObserver()
getSelectionEmptyObserver
in interface SelectionModel<R>