Class DefaultTableColumnModelExt

    • Constructor Detail

      • DefaultTableColumnModelExt

        public DefaultTableColumnModelExt()
        Creates a an empty DefaultTableColumnModelExt.
    • Method Detail

      • getColumns

        public List<TableColumn> getColumns​(boolean includeHidden)
        Returns a List of contained TableColumns. Includes or excludes invisible columns, depending on whether the includeHidden is true or false, respectively. If false, an Iterator over the List is equivalent to the Enumeration returned by getColumns().

        NOTE: the order of columns in the List depends on whether or not the invisible columns are included, in the former case it's the insertion order in the latter it's the current order of the visible columns.

        Specified by:
        getColumns in interface TableColumnModelExt
        Parameters:
        includeHidden - a boolean to indicate whether invisible columns should be included
        Returns:
        a List of contained columns.
      • getColumnCount

        public int getColumnCount​(boolean includeHidden)
        Returns the number of contained columns. The count includes or excludes invisible columns, depending on whether the includeHidden is true or false, respectively. If false, this method returns the same count as getColumnCount().
        Specified by:
        getColumnCount in interface TableColumnModelExt
        Parameters:
        includeHidden - a boolean to indicate whether invisible columns should be included
        Returns:
        the number of contained columns, including or excluding the invisible as specified.
      • getColumnExt

        public TableColumnExt getColumnExt​(Object identifier)
        Returns the first TableColumnExt with the given identifier. The return value is null if there is no contained column with identifier or if the column with identifier is not of type TableColumnExt. The returned column may be visible or hidden.
        Specified by:
        getColumnExt in interface TableColumnModelExt
        Parameters:
        identifier - the object used as column identifier
        Returns:
        first TableColumnExt with the given identifier or null if none is found
      • getColumnExt

        public TableColumnExt getColumnExt​(int columnIndex)
        Returns the TableColumnExt at view position columnIndex. The return value is null, if the column at position columnIndex is not of type TableColumnExt. The returned column is visible.
        Specified by:
        getColumnExt in interface TableColumnModelExt
        Parameters:
        columnIndex - the index of the column desired
        Returns:
        the TableColumnExt object that matches the column index
      • isRemovedToInvisibleEvent

        public boolean isRemovedToInvisibleEvent​(int oldIndex)
        hot fix for #157: listeners that are aware of the possible existence of invisible columns should check if the received columnRemoved originated from moving a column from visible to invisible.
        Parameters:
        oldIndex - the fromIndex of the columnEvent
        Returns:
        true if the column was moved to invisible
      • isAddedFromInvisibleEvent

        public boolean isAddedFromInvisibleEvent​(int newIndex)
        hot fix for #157: listeners that are aware of the possible existence of invisible columns should check if the received columnAdded originated from moving a column from invisible to visible.
        Parameters:
        newIndex - the toIndex of the columnEvent
        Returns:
        true if the column was moved to visible
      • moveToInvisible

        protected void moveToInvisible​(TableColumnExt col)
        Update internal state after the visibility of the column was changed to invisible. The given column is assumed to be contained in this model.
        Parameters:
        col - the column which was hidden.
      • moveToVisible

        protected void moveToVisible​(TableColumnExt col)
        Update internal state after the visibility of the column was changed to visible. The given column is assumed to be contained in this model.
        Parameters:
        col - the column which was made visible.
      • getEventListenerList

        protected EventListenerList getEventListenerList()
        Exposed for testing only - don't use! Will be removed again!
        Returns:
        super's listener list
      • fireColumnPropertyChange

        protected void fireColumnPropertyChange​(PropertyChangeEvent evt)
        Notifies TableColumnModelExtListeners about property changes of contained columns. The event instance is the original as fired by the TableColumn.
        Parameters:
        evt - the event received
        See Also:
        EventListenerList
      • getTableColumnModelExtListeners

        public TableColumnModelExtListener[] getTableColumnModelExtListeners()
        Returns:
        array of all registered listeners