Package docking.widgets.table
Interface SelectionManager
-
- All Superinterfaces:
java.util.EventListener
,javax.swing.ListSelectionModel
,javax.swing.event.TableModelListener
- All Known Implementing Classes:
RowObjectSelectionManager
public interface SelectionManager extends javax.swing.ListSelectionModel, javax.swing.event.TableModelListener
A class to track and restore selections made in a table. We use this in the docking environment primarily due to the heavy usage of filtering for most tables. As tables are filtered, the contents change (and then change back when the filter is removed). It is nice to be able to filter a table, select an item of interest, and then unfilter the table to see that item in more context.Notes on usage:
- Some table models are sensitive to the order in which
TableModel#tableChanged()
is called. These models should either not use this SelectionManger, or need to change their code to be more robust. As an example, theDefaultSortedTableModel
updates its indexes in odd ways. Further, there is a chance that the state of its indexing is incorrect when tableChanged is called. So, that model has to account for the fact that it may get called by this class when it is in a bad state.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addSelectionManagerListener(SelectionManagerListener listener)
void
clearSavedSelection()
void
dispose()
void
removeSelectionManagerListener(SelectionManagerListener listener)
void
setLogger(org.apache.logging.log4j.Logger logger)
Allows clients to enable tracing by providing a logger with tracing enabled.-
Methods inherited from interface javax.swing.ListSelectionModel
addListSelectionListener, addSelectionInterval, clearSelection, getAnchorSelectionIndex, getLeadSelectionIndex, getMaxSelectionIndex, getMinSelectionIndex, getSelectedIndices, getSelectedItemsCount, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isSelectedIndex, isSelectionEmpty, removeIndexInterval, removeListSelectionListener, removeSelectionInterval, setAnchorSelectionIndex, setLeadSelectionIndex, setSelectionInterval, setSelectionMode, setValueIsAdjusting
-
-
-
-
Method Detail
-
addSelectionManagerListener
void addSelectionManagerListener(SelectionManagerListener listener)
-
removeSelectionManagerListener
void removeSelectionManagerListener(SelectionManagerListener listener)
-
clearSavedSelection
void clearSavedSelection()
-
setLogger
void setLogger(org.apache.logging.log4j.Logger logger)
Allows clients to enable tracing by providing a logger with tracing enabled.- Parameters:
logger
- The logger to be used by this manager, which has tracing embedded in its code.
-
dispose
void dispose()
-
-