org.netbeans.swing.outline 1.20

org.netbeans.swing.etable
Class ETableColumn

java.lang.Object
  extended by javax.swing.table.TableColumn
      extended by org.netbeans.swing.etable.ETableColumn
All Implemented Interfaces:
Serializable, Comparable<ETableColumn>
Direct Known Subclasses:
Outline.OutlineColumn

public class ETableColumn
extends TableColumn
implements Comparable<ETableColumn>

Special type of TableColumn object used by ETable.

See Also:
Serialized Form

Nested Class Summary
 class ETableColumn.RowComparator
          Comparator used for sorting the rows according to value in a given column.
 
Field Summary
 
Fields inherited from class javax.swing.table.TableColumn
CELL_RENDERER_PROPERTY, cellEditor, cellRenderer, COLUMN_WIDTH_PROPERTY, HEADER_RENDERER_PROPERTY, HEADER_VALUE_PROPERTY, headerRenderer, headerValue, identifier, isResizable, maxWidth, minWidth, modelIndex, resizedPostingDisableCount, width
 
Constructor Summary
ETableColumn(ETable table)
          Creates a new instance of ETableColumn
ETableColumn(int modelIndex, ETable table)
          Creates a new instance of ETableColumn
ETableColumn(int modelIndex, int width, ETable table)
          Creates a new instance of ETableColumn
ETableColumn(int modelIndex, int width, TableCellRenderer cellRenderer, TableCellEditor cellEditor, ETable table)
          Creates a new instance of ETableColumn
 
Method Summary
 int compareTo(ETableColumn obj)
           
protected  TableCellRenderer createDefaultHeaderRenderer()
          Overridden to return our special header renderer.
 Comparator getNestedComparator()
          Returns comparator for sorting the rows belonging to same parent in tree-like part of table.
protected  Comparator<ETable.RowMapping> getRowComparator(int column, boolean ascending)
          Allow subclasses to supply special row comparator object.
 int getSortRank()
          Rank value 1 means that this is the most important column (with respect to the table sort), value 2 means second etc.
 boolean isAscending()
          Checks whether the sort order is ascending (true means ascending, false means descending).
 boolean isHidingAllowed()
          The column can be hidden if this method returns true.
 boolean isSorted()
          Returns true if the table is sorted using this column.
 boolean isSortingAllowed()
          The column can be sorted if this method returns true.
 void readSettings(Properties p, int index, String propertyPrefix)
          Method allowing to read stored values.
 void setAscending(boolean ascending)
          Sets the sort order.
 void setCustomIcon(Icon i)
          Allows setting a custom icon for this column.
 void setHeaderRenderer(TableCellRenderer tcr)
          Allows to set the header renderer.
 void setNestedComparator(Comparator c)
          Method allowing to set custom comparator for sorting the rows belonging to same parent in tree-like part of table.
 void setSorted(int rank, boolean ascending)
          Deprecated. This method has no effect if the column was not already sorted before. Use ETableColumnModel.setColumnSorted(org.netbeans.swing.etable.ETableColumn, boolean, int) instead.
 void setSortRank(int newRank)
          Rank value 1 means that this is the most important column (with respect to the table sort), value 2 means second etc.
 void writeSettings(Properties p, int index, String propertyPrefix)
          Method allowing to store customization values.
 
Methods inherited from class javax.swing.table.TableColumn
addPropertyChangeListener, disableResizedPosting, enableResizedPosting, getCellEditor, getCellRenderer, getHeaderRenderer, getHeaderValue, getIdentifier, getMaxWidth, getMinWidth, getModelIndex, getPreferredWidth, getPropertyChangeListeners, getResizable, getWidth, removePropertyChangeListener, setCellEditor, setCellRenderer, setHeaderValue, setIdentifier, setMaxWidth, setMinWidth, setModelIndex, setPreferredWidth, setResizable, setWidth, sizeWidthToFit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ETableColumn

public ETableColumn(ETable table)
Creates a new instance of ETableColumn


ETableColumn

public ETableColumn(int modelIndex,
                    ETable table)
Creates a new instance of ETableColumn


ETableColumn

public ETableColumn(int modelIndex,
                    int width,
                    ETable table)
Creates a new instance of ETableColumn


ETableColumn

public ETableColumn(int modelIndex,
                    int width,
                    TableCellRenderer cellRenderer,
                    TableCellEditor cellEditor,
                    ETable table)
Creates a new instance of ETableColumn

Method Detail

setSorted

@Deprecated
public void setSorted(int rank,
                                 boolean ascending)
Deprecated. This method has no effect if the column was not already sorted before. Use ETableColumnModel.setColumnSorted(org.netbeans.swing.etable.ETableColumn, boolean, int) instead.

This method marks this column as sorted. Value 0 of the parameter rank means that this column is not sorted.

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

isSorted

public boolean isSorted()
Returns true if the table is sorted using this column.


setSortRank

public void setSortRank(int newRank)
Rank value 1 means that this is the most important column (with respect to the table sort), value 2 means second etc. Please note: the column has to be already sorted when calling this method.

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

getSortRank

public int getSortRank()
Rank value 1 means that this is the most important column (with respect to the table sort), value 2 means second etc. To ask for the value of rank makes sense only when isSorted() returns true. If isSorted() returns false this method should return 0.


isAscending

public boolean isAscending()
Checks whether the sort order is ascending (true means ascending, false means descending).

Returns:
true for ascending order

setAscending

public void setAscending(boolean ascending)
Sets the sort order. Please note: the column has to be already sorted when calling this method otherwise IllegalStateException is thrown.

Parameters:
ascending - true means ascending
Since:
1.3

setHeaderRenderer

public void setHeaderRenderer(TableCellRenderer tcr)
Allows to set the header renderer. If this method is not called we use our special renderer created by method createDefaultHeaderRenderer().

Overrides:
setHeaderRenderer in class TableColumn

isHidingAllowed

public boolean isHidingAllowed()
The column can be hidden if this method returns true.


isSortingAllowed

public boolean isSortingAllowed()
The column can be sorted if this method returns true.


setCustomIcon

public void setCustomIcon(Icon i)
Allows setting a custom icon for this column.


readSettings

public void readSettings(Properties p,
                         int index,
                         String propertyPrefix)
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,
                          int index,
                          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.


compareTo

public int compareTo(ETableColumn obj)
Specified by:
compareTo in interface Comparable<ETableColumn>

getRowComparator

protected Comparator<ETable.RowMapping> getRowComparator(int column,
                                                         boolean ascending)
Allow subclasses to supply special row comparator object.


setNestedComparator

public void setNestedComparator(Comparator c)
Method allowing to set custom comparator for sorting the rows belonging to same parent in tree-like part of table. The comparator operates on the types of the given column, e.g. the class of the given column in table-like part or node in tree-line part of table.

Parameters:
c - comparator or null for using the default comparator
Since:
1.3

getNestedComparator

public Comparator getNestedComparator()
Returns comparator for sorting the rows belonging to same parent in tree-like part of table.

Returns:
comparator or null if no nested comparator was set and the default comparator will be used
Since:
1.3

createDefaultHeaderRenderer

protected TableCellRenderer createDefaultHeaderRenderer()
Overridden to return our special header renderer.

Overrides:
createDefaultHeaderRenderer in class TableColumn
See Also:
TableColumn.createDefaultHeaderRenderer()

org.netbeans.swing.outline 1.20

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