Class TableModelSelectionAdapter

  • All Implemented Interfaces:
    java.util.EventListener, javax.swing.event.ListSelectionListener

    public class TableModelSelectionAdapter
    extends java.lang.Object
    implements javax.swing.event.ListSelectionListener
    This class is the implementation of a listener to remember, which rows in the table are selected and convert the indizes correctly to the model.
    • Constructor Summary

      Constructors 
      Constructor Description
      TableModelSelectionAdapter​(javax.swing.JTable table)
      the constructor, which sets the table, which we listen to.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer getSelectedRowIndex()  
      java.util.List<java.lang.Integer> getSelectedRowIndizes()  
      protected void selectionChanged​(java.lang.Integer selectedRow, java.util.List<java.lang.Integer> selectedRows)
      this method may be overridden to react on a selcetion-change in a subclass
      void valueChanged​(javax.swing.event.ListSelectionEvent event)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TableModelSelectionAdapter

        public TableModelSelectionAdapter​(javax.swing.JTable table)
        the constructor, which sets the table, which we listen to.
        Parameters:
        table -
    • Method Detail

      • valueChanged

        public final void valueChanged​(javax.swing.event.ListSelectionEvent event)
        Specified by:
        valueChanged in interface javax.swing.event.ListSelectionListener
      • selectionChanged

        protected void selectionChanged​(java.lang.Integer selectedRow,
                                        java.util.List<java.lang.Integer> selectedRows)
        this method may be overridden to react on a selcetion-change in a subclass
        Parameters:
        selectedRow - the actually selected row in the table-model
        selectedRows - all selected rows in the table-model
      • getSelectedRowIndizes

        public java.util.List<java.lang.Integer> getSelectedRowIndizes()
        Returns:
        the indizes of all selected Rows in terms of the TableModel
      • getSelectedRowIndex

        public java.lang.Integer getSelectedRowIndex()
        Returns:
        the index of the actually selected row in terms of the TableModel