Class ChatPanel.UserTableModel

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.table.TableModel
    Enclosing class:
    ChatPanel

    public class ChatPanel.UserTableModel
    extends javax.swing.table.DefaultTableModel
    Table model for list of users.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String[] columns
      The column names.
      protected java.util.List<ChatUser> sels
      The selected users.
      protected java.util.Map<IComponentIdentifier,​ChatUser> users
      The known chat users (cid->user state).
      • Fields inherited from class javax.swing.table.DefaultTableModel

        columnIdentifiers, dataVector
      • Fields inherited from class javax.swing.table.AbstractTableModel

        listenerList
    • Constructor Summary

      Constructors 
      Constructor Description
      UserTableModel()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTableModelListener​(javax.swing.event.TableModelListener l)  
      void addUser​(IComponentIdentifier cid, ChatUser user)  
      java.lang.Class<?> getColumnClass​(int i)  
      int getColumnCount()  
      java.lang.String getColumnName​(int i)  
      int getRowCount()  
      ChatUser getUser​(IComponentIdentifier cid)  
      java.util.Collection<IComponentIdentifier> getUserIDs()  
      java.util.Collection<ChatUser> getUsers()  
      java.lang.Object getValueAt​(int row, int column)  
      boolean isCellEditable​(int row, int column)  
      void removeTableModelListener​(javax.swing.event.TableModelListener l)  
      void removeUser​(IComponentIdentifier cid)  
      protected void restoreUserSelection()
      Restore the current user selection.
      protected void saveUserSelection()
      Save the current user selection
      void setValueAt​(java.lang.Object val, int row, int column)  
      • Methods inherited from class javax.swing.table.DefaultTableModel

        addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getDataVector, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount
      • Methods inherited from class javax.swing.table.AbstractTableModel

        findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners
      • Methods inherited from class java.lang.Object

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

      • columns

        protected java.lang.String[] columns
        The column names.
      • sels

        protected java.util.List<ChatUser> sels
        The selected users.
    • Constructor Detail

      • UserTableModel

        public UserTableModel()
    • Method Detail

      • getColumnCount

        public int getColumnCount()
        Specified by:
        getColumnCount in interface javax.swing.table.TableModel
        Overrides:
        getColumnCount in class javax.swing.table.DefaultTableModel
      • getColumnName

        public java.lang.String getColumnName​(int i)
        Specified by:
        getColumnName in interface javax.swing.table.TableModel
        Overrides:
        getColumnName in class javax.swing.table.DefaultTableModel
      • getColumnClass

        public java.lang.Class<?> getColumnClass​(int i)
        Specified by:
        getColumnClass in interface javax.swing.table.TableModel
        Overrides:
        getColumnClass in class javax.swing.table.AbstractTableModel
      • getRowCount

        public int getRowCount()
        Specified by:
        getRowCount in interface javax.swing.table.TableModel
        Overrides:
        getRowCount in class javax.swing.table.DefaultTableModel
      • getValueAt

        public java.lang.Object getValueAt​(int row,
                                           int column)
        Specified by:
        getValueAt in interface javax.swing.table.TableModel
        Overrides:
        getValueAt in class javax.swing.table.DefaultTableModel
      • isCellEditable

        public boolean isCellEditable​(int row,
                                      int column)
        Specified by:
        isCellEditable in interface javax.swing.table.TableModel
        Overrides:
        isCellEditable in class javax.swing.table.DefaultTableModel
      • getUsers

        public java.util.Collection<ChatUser> getUsers()
      • setValueAt

        public void setValueAt​(java.lang.Object val,
                               int row,
                               int column)
        Specified by:
        setValueAt in interface javax.swing.table.TableModel
        Overrides:
        setValueAt in class javax.swing.table.DefaultTableModel
      • addTableModelListener

        public void addTableModelListener​(javax.swing.event.TableModelListener l)
        Specified by:
        addTableModelListener in interface javax.swing.table.TableModel
        Overrides:
        addTableModelListener in class javax.swing.table.AbstractTableModel
      • removeTableModelListener

        public void removeTableModelListener​(javax.swing.event.TableModelListener l)
        Specified by:
        removeTableModelListener in interface javax.swing.table.TableModel
        Overrides:
        removeTableModelListener in class javax.swing.table.AbstractTableModel
      • saveUserSelection

        protected void saveUserSelection()
        Save the current user selection
      • restoreUserSelection

        protected void restoreUserSelection()
        Restore the current user selection.