org.netbeans.swing.outline 1.20

org.netbeans.swing.etable
Class ETableColumnModel

java.lang.Object
  extended by javax.swing.table.DefaultTableColumnModel
      extended by org.netbeans.swing.etable.ETableColumnModel
All Implemented Interfaces:
PropertyChangeListener, Serializable, EventListener, ListSelectionListener, TableColumnModel

public class ETableColumnModel
extends DefaultTableColumnModel

Column model implementation for ETable.

See Also:
Serialized Form

Field Summary
protected  List<TableColumn> hiddenColumns
          List: holds list of columns that were hidden by the user.
protected  List<TableColumn> sortedColumns
          List: holds list of sorted columns in this model.
 
Fields inherited from class javax.swing.table.DefaultTableColumnModel
changeEvent, columnMargin, columnSelectionAllowed, listenerList, selectionModel, tableColumns, totalColumnWidth
 
Constructor Summary
ETableColumnModel()
          Creates a new instance of ETableColumnModel
 
Method Summary
 void clean()
          Removes all columns, including hidden ones.
 void clearSortedColumns()
          Makes the whole table unsorted.
 TableColumnSelector.TreeNode getColumnHierarchyRoot()
          Allows the user to customize the list of the visible columns using a hierarchy in a special TableColumnSelector.
 Comparator<ETable.RowMapping> getComparator()
          Provides a comparator for sorting the rows of the table.
 boolean isColumnHidden(TableColumn tc)
          Test if the column is hidden or visible.
 void readSettings(Properties p, String propertyPrefix, ETable table)
          Method allowing to read stored values.
 void removeColumn(TableColumn column)
           
 void setColumnHidden(TableColumn column, boolean hidden)
          Makes the given column hidden or visible according to the parameter hidden.
 void setColumnHierarchyRoot(TableColumnSelector.TreeNode columnHierarchyRoot)
          Allows the user to customize the list of the visible columns using a hierarchy in a special TableColumnSelector.
 void setColumnSorted(ETableColumn etc, boolean ascending, int newRank)
          This method marks this column as sorted.
 void writeSettings(Properties p, String propertyPrefix)
          Method allowing to store customization values.
 
Methods inherited from class javax.swing.table.DefaultTableColumnModel
addColumn, addColumnModelListener, createSelectionModel, fireColumnAdded, fireColumnMarginChanged, fireColumnMoved, fireColumnRemoved, fireColumnSelectionChanged, getColumn, getColumnCount, getColumnIndex, getColumnIndexAtX, getColumnMargin, getColumnModelListeners, getColumns, getColumnSelectionAllowed, getListeners, getSelectedColumnCount, getSelectedColumns, getSelectionModel, getTotalColumnWidth, moveColumn, propertyChange, recalcWidthCache, removeColumnModelListener, setColumnMargin, setColumnSelectionAllowed, setSelectionModel, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sortedColumns

protected transient List<TableColumn> sortedColumns
List: holds list of sorted columns in this model. If the list is empty if no sorting is applied.


hiddenColumns

protected List<TableColumn> hiddenColumns
List: holds list of columns that were hidden by the user. The columns contained here are not contained in the inherited tableColumns list.

Constructor Detail

ETableColumnModel

public ETableColumnModel()
Creates a new instance of ETableColumnModel

Method Detail

readSettings

public void readSettings(Properties p,
                         String propertyPrefix,
                         ETable table)
Method allowing to read stored values. The stored values should be only those that the user has customized, it does not make sense to store the values that were set using the initialization code because the initialization code can be run in the same way after restart.


writeSettings

public void writeSettings(Properties p,
                          String propertyPrefix)
Method allowing to store customization values. The stored values should be only those that the user has customized, it does not make sense to store the values that were set using the initialization code because the initialization code can be run in the same way after restart.


getComparator

public Comparator<ETable.RowMapping> getComparator()
Provides a comparator for sorting the rows of the table. The comparator operates over ETable.RowMappings objects.

Returns:
The comparator for sorting the rows of the table.

setColumnSorted

public void setColumnSorted(ETableColumn etc,
                            boolean ascending,
                            int newRank)
This method marks this column as sorted. Value 0 of the parameter rank means that this column is not sorted.

This method does not refresh the table UI. Use ETable.setColumnSorted(int, boolean, int) instead when the UI should be changed accordingly.

Parameters:
etc - column in ETable column model
ascending - true means ascending
newRank - value 1 means that this is the most important sorted column, number 2 means second etc.
Since:
1.3

removeColumn

public void removeColumn(TableColumn column)
Specified by:
removeColumn in interface TableColumnModel
Overrides:
removeColumn in class DefaultTableColumnModel

setColumnHidden

public void setColumnHidden(TableColumn column,
                            boolean hidden)
Makes the given column hidden or visible according to the parameter hidden.

Parameters:
column - The table column to change the visibility.
hidden - true to make the column hidden, false to make it visible.

isColumnHidden

public boolean isColumnHidden(TableColumn tc)
Test if the column is hidden or visible.

Parameters:
tc - The table column to test
Returns:
true when the column is hidden, false when it's visible.

clearSortedColumns

public void clearSortedColumns()
Makes the whole table unsorted.


clean

public void clean()
Removes all columns, including hidden ones.

Since:
1.12

getColumnHierarchyRoot

public TableColumnSelector.TreeNode getColumnHierarchyRoot()
Allows the user to customize the list of the visible columns using a hierarchy in a special TableColumnSelector.


setColumnHierarchyRoot

public void setColumnHierarchyRoot(TableColumnSelector.TreeNode columnHierarchyRoot)
Allows the user to customize the list of the visible columns using a hierarchy in a special TableColumnSelector.


org.netbeans.swing.outline 1.20

Built on May 25 2012.  |  Portions Copyright 1997-2012 Oracle. All rights reserved.