org.jdesktop.swing.table
Class TableColumnExt

java.lang.Object
  extended byjavax.swing.table.TableColumn
      extended byorg.jdesktop.swing.table.TableColumnExt
All Implemented Interfaces:
Cloneable, Serializable

public class TableColumnExt
extends TableColumn
implements Cloneable

TableColumnExt

See Also:
Serialized Form

Field Summary
protected  LabelProperties cellProperties
           
protected  boolean editable
           
protected  LabelProperties headerProperties
           
protected  Object prototypeValue
           
protected  Sorter sorter
           
protected  JTable table
           
protected  boolean visible
           
 
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
TableColumnExt()
           
TableColumnExt(JTable table)
           
TableColumnExt(JTable table, int modelIndex)
           
TableColumnExt(JTable table, int modelIndex, int width)
           
TableColumnExt(JTable table, int modelIndex, int width, TableCellRenderer cellRenderer, TableCellEditor cellEditor)
           
 
Method Summary
 void applyCellProperties(LabelProperties props)
           
 void applyHeaderProperties(LabelProperties props)
           
 Object clone()
          Returns a clone of this TableColumn.
 TableCellRenderer getCellRenderer()
           
 Object getClientProperty(Object key)
           
 Class getColumnClass()
           
 TableCellRenderer getHeaderRenderer()
           
 int getPreferredWidth()
          Returns the preferred width of the TableColumn.
 Object getPrototypeValue()
           
 Sorter getSorter()
           
 String getSorterClass()
           
 JTable getTable()
           
 String getTitle()
           
 boolean isEditable()
           
 boolean isSortable()
           
 boolean isVisible()
           
 void putClientProperty(Object key, Object value)
           
 void setEditable(boolean editable)
           
 void setPrototypeValue(Object value)
           
 void setSorterClass(String sorterClassName)
          Sets a user-defined sorter for this column
 void setTable(JTable table)
           
 void setTitle(String title)
           
 void setVisible(boolean visible)
           
 
Methods inherited from class javax.swing.table.TableColumn
addPropertyChangeListener, createDefaultHeaderRenderer, disableResizedPosting, enableResizedPosting, getCellEditor, getHeaderValue, getIdentifier, getMaxWidth, getMinWidth, getModelIndex, getPropertyChangeListeners, getResizable, getWidth, removePropertyChangeListener, setCellEditor, setCellRenderer, setHeaderRenderer, setHeaderValue, setIdentifier, setMaxWidth, setMinWidth, setModelIndex, setPreferredWidth, setResizable, setWidth, sizeWidthToFit
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

table

protected JTable table

cellProperties

protected LabelProperties cellProperties

headerProperties

protected LabelProperties headerProperties

editable

protected boolean editable

sorter

protected Sorter sorter

visible

protected boolean visible

prototypeValue

protected Object prototypeValue
Constructor Detail

TableColumnExt

public TableColumnExt()

TableColumnExt

public TableColumnExt(JTable table)

TableColumnExt

public TableColumnExt(JTable table,
                      int modelIndex)

TableColumnExt

public TableColumnExt(JTable table,
                      int modelIndex,
                      int width)

TableColumnExt

public TableColumnExt(JTable table,
                      int modelIndex,
                      int width,
                      TableCellRenderer cellRenderer,
                      TableCellEditor cellEditor)
Method Detail

clone

public Object clone()
Returns a clone of this TableColumn. Some implementations of TableColumn may assume that all TableColumnModels are unique, therefore it is recommended that the same TableColumn instance not be added more than once to a TableColumnModel. To show TableColumns with the same column of data from the model, create a new instance with the same modelIndex.

Returns:
a clone of this TableColumn

setTable

public void setTable(JTable table)

getTable

public JTable getTable()

getColumnClass

public Class getColumnClass()

getCellRenderer

public TableCellRenderer getCellRenderer()

getHeaderRenderer

public TableCellRenderer getHeaderRenderer()

setEditable

public void setEditable(boolean editable)

isEditable

public boolean isEditable()

applyCellProperties

public void applyCellProperties(LabelProperties props)

applyHeaderProperties

public void applyHeaderProperties(LabelProperties props)

getPreferredWidth

public int getPreferredWidth()
Returns the preferred width of the TableColumn. If the prototypeValue property is non-null, then this method will use that value object to compute the preferred width by accessing the cell and header renderers for this column to determine the optimal width.

Returns:
the preferredWidth property
See Also:
TableColumn.setPreferredWidth(int), setPrototypeValue(java.lang.Object)

setPrototypeValue

public void setPrototypeValue(Object value)

getPrototypeValue

public Object getPrototypeValue()

setSorterClass

public void setSorterClass(String sorterClassName)
Sets a user-defined sorter for this column


getSorterClass

public String getSorterClass()

getSorter

public Sorter getSorter()

isSortable

public boolean isSortable()

setTitle

public void setTitle(String title)

getTitle

public String getTitle()

setVisible

public void setVisible(boolean visible)

isVisible

public boolean isVisible()

putClientProperty

public void putClientProperty(Object key,
                              Object value)

getClientProperty

public Object getClientProperty(Object key)


Copyright 2004 by Sun Microsystems, Inc. All Rights Reserved.