Class AbstractManagementTableModel<T extends Comparable>

    • Field Detail

      • m_Values

        protected List<T extends Comparable> m_Values
        the objects to display.
      • m_Sorted

        protected boolean m_Sorted
        whether the model is sorted.
    • Constructor Detail

      • AbstractManagementTableModel

        public AbstractManagementTableModel()
        Default constructor (sorted).
      • AbstractManagementTableModel

        public AbstractManagementTableModel​(boolean sorted)
        Default constructor.
        Parameters:
        sorted - true if to sort items
      • AbstractManagementTableModel

        public AbstractManagementTableModel​(T[] values)
        The constructor (sorted).
        Parameters:
        values - the values to display
      • AbstractManagementTableModel

        public AbstractManagementTableModel​(T[] values,
                                            boolean sorted)
        The constructor.
        Parameters:
        values - the values to display
        sorted - true if to sort items
      • AbstractManagementTableModel

        public AbstractManagementTableModel​(List<T> values)
        The constructor (sorted).
        Parameters:
        values - the values to display
      • AbstractManagementTableModel

        public AbstractManagementTableModel​(List<T> values,
                                            boolean sorted)
        the constructor.
        Parameters:
        values - the values to display
        sorted - true if to sort items
    • Method Detail

      • isSorted

        public boolean isSorted()
        Returns whether the model is sorted.
        Returns:
        true if sorted
      • getRowCount

        public int getRowCount()
        Returns the actual number of entries in the table.
        Specified by:
        getRowCount in interface TableModel
        Returns:
        the number of entries
      • getColumnCount

        public abstract int getColumnCount()
        Returns the number of columns in the table.
        Specified by:
        getColumnCount in interface TableModel
        Returns:
        the number of columns
      • getColumnClass

        public abstract Class getColumnClass​(int columnIndex)
        Returns the class type of the column.
        Specified by:
        getColumnClass in interface TableModel
        Overrides:
        getColumnClass in class AbstractTableModel
        Parameters:
        columnIndex - the column to get the class for
        Returns:
        the class for the column
      • getValueAt

        public abstract Object getValueAt​(int row,
                                          int column)
        Returns the Object at the given position.
        Specified by:
        getValueAt in interface TableModel
        Parameters:
        row - the row
        column - the column
        Returns:
        the Object
      • isSearchMatch

        public abstract boolean isSearchMatch​(SearchParameters params,
                                              int row)
        Tests whether the search matches the specified row.
        Specified by:
        isSearchMatch in interface CustomSearchTableModel
        Parameters:
        params - the search parameters
        row - the row of the underlying, unsorted model
        Returns:
        true if the search matches this row
      • clear

        public void clear()
        Clears the internal model.
        Specified by:
        clear in interface ClearableModel
      • add

        public void add​(T value)
        Adds the Object to the model, if not alread present.
        Parameters:
        value - the Object to add
      • addAll

        public void addAll​(List<T> values)
        Adds the Objects to the model, if not alread present.
        Parameters:
        values - the Objects to add
      • remove

        public void remove​(T value)
        Removes the Object to the model, if not alread present.
        Parameters:
        value - the Object to remove
      • moveUp

        public boolean moveUp​(int index)
        Moves the specified element one position up.
        Parameters:
        index - the index of the element to move up
        Returns:
        true if successfully moved
      • moveDown

        public boolean moveDown​(int index)
        Moves the specified element one position down.
        Parameters:
        index - the index of the element to move down
        Returns:
        true if successfully moved
      • toList

        public List<T> toList()
        Returns the model as list.
        Returns:
        the list