Class RowObjectSelectionManager<T>

  • Type Parameters:
    T - the row type
    All Implemented Interfaces:
    SelectionManager, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, javax.swing.event.TableModelListener, javax.swing.ListSelectionModel

    public class RowObjectSelectionManager<T>
    extends javax.swing.DefaultListSelectionModel
    implements SelectionManager
    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.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class javax.swing.DefaultListSelectionModel

        leadAnchorNotificationEnabled, listenerList
      • Fields inherited from interface javax.swing.ListSelectionModel

        MULTIPLE_INTERVAL_SELECTION, SINGLE_INTERVAL_SELECTION, SINGLE_SELECTION
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSelectionManagerListener​(SelectionManagerListener listener)  
      void clearSavedSelection()  
      void clearSelection()  
      void dispose()  
      protected void fireValueChanged​(int firstIndex, int lastIndex, boolean isAdjusting)  
      void removeSelectionManagerListener​(SelectionManagerListener listener)  
      void tableChanged​(javax.swing.event.TableModelEvent e)  
      protected java.util.List<T> translateRowsToValues​(int[] viewRows)  
      • Methods inherited from class javax.swing.DefaultListSelectionModel

        addListSelectionListener, addSelectionInterval, clone, fireValueChanged, fireValueChanged, getAnchorSelectionIndex, getLeadSelectionIndex, getListeners, getListSelectionListeners, getMaxSelectionIndex, getMinSelectionIndex, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isLeadAnchorNotificationEnabled, isSelectedIndex, isSelectionEmpty, moveLeadSelectionIndex, removeIndexInterval, removeListSelectionListener, removeSelectionInterval, setAnchorSelectionIndex, setLeadAnchorNotificationEnabled, setLeadSelectionIndex, setSelectionInterval, setSelectionMode, setValueIsAdjusting, toString
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface javax.swing.ListSelectionModel

        addListSelectionListener, addSelectionInterval, getAnchorSelectionIndex, getLeadSelectionIndex, getMaxSelectionIndex, getMinSelectionIndex, getSelectedIndices, getSelectedItemsCount, getSelectionMode, getValueIsAdjusting, insertIndexInterval, isSelectedIndex, isSelectionEmpty, removeIndexInterval, removeListSelectionListener, removeSelectionInterval, setAnchorSelectionIndex, setLeadSelectionIndex, setSelectionInterval, setSelectionMode, setValueIsAdjusting
    • Constructor Detail

      • RowObjectSelectionManager

        public RowObjectSelectionManager​(javax.swing.JTable table,
                                         RowObjectTableModel<T> model)
    • Method Detail

      • clearSelection

        public void clearSelection()
        Specified by:
        clearSelection in interface javax.swing.ListSelectionModel
        Overrides:
        clearSelection in class javax.swing.DefaultListSelectionModel
      • fireValueChanged

        protected void fireValueChanged​(int firstIndex,
                                        int lastIndex,
                                        boolean isAdjusting)
        Overrides:
        fireValueChanged in class javax.swing.DefaultListSelectionModel
      • translateRowsToValues

        protected java.util.List<T> translateRowsToValues​(int[] viewRows)
      • tableChanged

        public void tableChanged​(javax.swing.event.TableModelEvent e)
        Specified by:
        tableChanged in interface javax.swing.event.TableModelListener