Interface FilteredTableModel<R,​C>

    • Method Detail

      • addSortListener

        void addSortListener​(EventListener listener)
        Parameters:
        listener - a listener to be notified each time the model has been sorted
      • removeSortListener

        void removeSortListener​(EventListener listener)
        Parameters:
        listener - the listener to remove
      • addTableDataChangedListener

        void addTableDataChangedListener​(EventListener listener)
        Parameters:
        listener - a listener to be notified each time the table data changes
      • removeTableDataChangedListener

        void removeTableDataChangedListener​(EventListener listener)
        Parameters:
        listener - the listener to remove
      • addTableModelClearedListener

        void addTableModelClearedListener​(EventListener listener)
        Parameters:
        listener - a listener to be notified each time the table model is cleared
      • removeTableModelClearedListener

        void removeTableModelClearedListener​(EventListener listener)
        Parameters:
        listener - the listener to remove
      • allowSelectionChange

        boolean allowSelectionChange()
        Returns:
        true if an impending selection change should be allowed
      • getRowCount

        int getRowCount()
        Specified by:
        getRowCount in interface TableModel
        Returns:
        the size of the table model
      • indexOf

        int indexOf​(R item)
        Parameters:
        item - the item
        Returns:
        the index of the item in the table model
      • itemAt

        R itemAt​(int rowIndex)
        Parameters:
        rowIndex - the row index
        Returns:
        the item at the given row index in the table model
      • getStringAt

        String getStringAt​(int rowIndex,
                           C columnIdentifier)
        Returns a String representation of the value for the given row and column.
        Parameters:
        rowIndex - the row index
        columnIdentifier - the column identifier
        Returns:
        the string value
      • removeItems

        void removeItems​(Collection<R> items)
        Removes the given items from this table model
        Parameters:
        items - the items to remove from the model
      • removeItem

        void removeItem​(R item)
        Removes the given item from this table model
        Parameters:
        item - the item to remove from the model
      • removeItemAt

        void removeItemAt​(int index)
        Removes from this table model the visible element whose index is between index
        Parameters:
        index - the index of the row to be removed
        Throws:
        IndexOutOfBoundsException - in case the indexe is out of bounds
      • removeItems

        void removeItems​(int fromIndex,
                         int toIndex)
        Removes from this table model all visible elements whose index is between fromIndex, inclusive and toIndex, exclusive
        Parameters:
        fromIndex - index of first row to be removed
        toIndex - index after last row to be removed
        Throws:
        IndexOutOfBoundsException - in case the indexes are out of bounds
      • columnSummaryModel

        Optional<ColumnSummaryModel> columnSummaryModel​(C columnIdentifier)
        Returns the ColumnSummaryModel associated with columnIdentifier
        Parameters:
        columnIdentifier - the column identifier
        Returns:
        the ColumnSummaryModel for the column identified by the given identifier, an empty Optional if none is available
      • columnFilterModels

        Map<C,​ColumnFilterModel<R,​C,​?>> columnFilterModels()
        Returns:
        the column filter models, mapped to their respective column identifier
      • columnFilterModel

        <T> ColumnFilterModel<R,​C,​T> columnFilterModel​(C columnIdentifier)
        Returns the ColumnConditionModel for the column with the given identifier.
        Type Parameters:
        T - the column value type
        Parameters:
        columnIdentifier - the column identifier
        Returns:
        the ColumnConditionModel for the column with the given identifier.
        Throws:
        IllegalArgumentException - in case no filter model exists for the given column
      • values

        <T> Collection<T> values​(C columnIdentifier)
        Type Parameters:
        T - the value type
        Parameters:
        columnIdentifier - the identifier of the column for which to retrieve the values
        Returns:
        the values (including nulls) of the column identified by the given identifier from the visible rows in the table model
      • getColumnClass

        Class<?> getColumnClass​(C columnIdentifier)
        Returns the class of the column with the given identifier
        Parameters:
        columnIdentifier - the column identifier
        Returns:
        the Class representing the given column
      • selectedValues

        <T> Collection<T> selectedValues​(C columnIdentifier)
        Type Parameters:
        T - the value type
        Parameters:
        columnIdentifier - the identifier of the column for which to retrieve the values
        Returns:
        the values (including nulls) of the column identified by the given identifier from the selected rows in the table model
      • isMergeOnRefresh

        boolean isMergeOnRefresh()
        Returns:
        true if merge on refresh is enabled
      • setMergeOnRefresh

        void setMergeOnRefresh​(boolean mergeOnRefresh)
        Parameters:
        mergeOnRefresh - true if merge on refresh should be enabled
      • isAsyncRefresh

        boolean isAsyncRefresh()
        Returns:
        true if asynchronous refreshing is enabled, true by default
      • setAsyncRefresh

        void setAsyncRefresh​(boolean asyncRefresh)
        Sometimes we'd like to be able to refresh one or more table models and perform some action on the refreshed data, after the refresh has finished, such as selecting a particular entity or such. This is quite difficult to achieve with asynchronous refresh enabled, so here's a way to temporarily disable asynchronous refresh, for a more consistent/predictable behaviour.
        Parameters:
        asyncRefresh - true if asynchronous refreshing should be enabled, true by default
      • clear

        void clear()
        Clears all items from this table model