JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.swing
Class JCTableColumn

java.lang.Object
  |
  +--javax.swing.table.TableColumn
        |
        +--com.klg.jclass.util.swing.JCTableColumn
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
JCSortableTable.SortableTableColumn, JCTreeTable.SwitchTableColumn

public class JCTableColumn
extends TableColumn

JCTableColumn extends TableColumn to add an EditorRendererRegistry type and a header label horizontal alignment specification.

See Also:
Serialized Form

Field Summary
protected  int headerLabelHorizontalAlignment
           
protected  String registryType
           
 
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
JCTableColumn()
          Default constructor
JCTableColumn(int modelIndex)
          Constructor which specifies the model index of this column.
JCTableColumn(int modelIndex, int width)
          Constructor which specifies the model index and the width of this column.
JCTableColumn(int modelIndex, int width, String registryType)
          Constructor which specifies the registry type, width, and model index.
JCTableColumn(int modelIndex, int width, TableCellRenderer cellRenderer, TableCellEditor cellEditor)
          Constructor which specifies the model index, width, and a cell renderer and editor for this column.
JCTableColumn(int modelIndex, int width, TableCellRenderer cellRenderer, TableCellEditor cellEditor, String registryType)
          Constructor which specifies the model index, width, a cell renderer and editor, and a registry type for this column.
JCTableColumn(int modelIndex, String registryType)
          Constructor which specifies the registry type and the model index.
JCTableColumn(String registryType)
          Constructor which specifies the registry type.
 
Method Summary
 TableCellEditor getCellEditor()
          Returns the TableCellEditor used by the JTable to edit values for this column.
 int getHeaderLabelHorizontalAlignment()
          Gets the horizontal alignment for the JLabel within the header of this column.
 String getRegistryType()
          Get the current registry type.
 void setHeaderLabelHorizontalAlignment(int alignment)
          Sets the horizontal alignment for the JLabel within the header of this column.
 void setRegistryType(String registryType)
          Set the current registry type.
 
Methods inherited from class javax.swing.table.TableColumn
addPropertyChangeListener, createDefaultHeaderRenderer, disableResizedPosting, enableResizedPosting, getCellRenderer, getHeaderRenderer, getHeaderValue, getIdentifier, getMaxWidth, getMinWidth, getModelIndex, getPreferredWidth, getPropertyChangeListeners, getResizable, getWidth, removePropertyChangeListener, setCellEditor, setCellRenderer, setHeaderRenderer, 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
 

Field Detail

registryType

protected String registryType

headerLabelHorizontalAlignment

protected int headerLabelHorizontalAlignment
Constructor Detail

JCTableColumn

public JCTableColumn()
Default constructor


JCTableColumn

public JCTableColumn(String registryType)
Constructor which specifies the registry type. The EditorRendererRegistry allows multipule editors and renderers to be registered for a particular class by defining a different modifier type for each.

Parameters:
registryType - The registry modifier type (can be null)

JCTableColumn

public JCTableColumn(int modelIndex)
Constructor which specifies the model index of this column. The modelIndex is the index of the column in the model which will supply the data for this column in the table. The modelIndex does not change as the columns are reordered in the view.

Parameters:
modelIndex - The model index for this column

JCTableColumn

public JCTableColumn(int modelIndex,
                     String registryType)
Constructor which specifies the registry type and the model index. The EditorRendererRegistry allows multipule editors and renderers to be registered for a particular class by defining a different modifier type for each. The modelIndex is the index of the column in the model which will supply the data for this column in the table. The modelIndex does not change as the columns are reordered in the view.

Parameters:
modelIndex - The model index for this column
registryType - The registry modifier type (can be null)

JCTableColumn

public JCTableColumn(int modelIndex,
                     int width)
Constructor which specifies the model index and the width of this column. The modelIndex is the index of the column in the model which will supply the data for this column in the table. The modelIndex does not change as the columns are reordered in the view. The width parameter is used to set both the preferredWidth for this column and the initial width.

Parameters:
modelIndex - The model index for this column
width - The preferred and initial width of this column

JCTableColumn

public JCTableColumn(int modelIndex,
                     int width,
                     String registryType)
Constructor which specifies the registry type, width, and model index. The EditorRendererRegistry allows multipule editors and renderers to be registered for a particular class by defining a different modifier type for each. The modelIndex is the index of the column in the model which will supply the data for this column in the table. The modelIndex does not change as the columns are reordered in the view. The width parameter is used to set both the preferredWidth for this column and the initial width.

Parameters:
modelIndex - The model index for this column
width - The preferred and initial width of this column
registryType - The registry modifier type (can be null)

JCTableColumn

public JCTableColumn(int modelIndex,
                     int width,
                     TableCellRenderer cellRenderer,
                     TableCellEditor cellEditor)
Constructor which specifies the model index, width, and a cell renderer and editor for this column. The modelIndex is the index of the column in the model which will supply the data for this column in the table. The modelIndex does not change as the columns are reordered in the view. The width parameter is used to set both the preferredWidth for this column and the initial width. The renderer and editor are the objects used respectively to render and edit values in this column. When these are null, default values, provided by the getDefaultRenderer and getDefaultEditor methods in the JTable class are used to provide defaults based on the type of the data in this column.

Parameters:
modelIndex - The model index for this column
width - The preferred and initial width of this column
cellRenderer - The cell renderer for this column
cellEditor - The cell editor for this column
See Also:
JTable.getDefaultRenderer(Class), JTable.getDefaultEditor(Class), JTable.getCellRenderer(int, int), JTable.getCellEditor(int, int)

JCTableColumn

public JCTableColumn(int modelIndex,
                     int width,
                     TableCellRenderer cellRenderer,
                     TableCellEditor cellEditor,
                     String registryType)
Constructor which specifies the model index, width, a cell renderer and editor, and a registry type for this column. The modelIndex is the index of the column in the model which will supply the data for this column in the table. The modelIndex does not change as the columns are reordered in the view. The width parameter is used to set both the preferredWidth for this column and the initial width. The renderer and editor are the objects used respectively to render and edit values in this column. When these are null, default values, provided by the getDefaultRenderer and getDefaultEditor methods in the JTable class are used to provide defaults based on the type of the data in this column. The EditorRendererRegistry allows multipule editors and renderers to be registered for a particular class by defining a different modifier type for each.

Parameters:
modelIndex - The model index for this column
width - The preferred and initial width of this column
cellRenderer - The cell renderer for this column
cellEditor - The cell editor for this column
registryType - The registry modifier type (can be null)
See Also:
JTable.getDefaultRenderer(Class), JTable.getDefaultEditor(Class), JTable.getCellRenderer(int, int), JTable.getCellEditor(int, int)
Method Detail

getRegistryType

public String getRegistryType()
Get the current registry type. The EditorRendererRegistry allows multipule editors and renderers to be registered for a particular class by defining a different modifier type for each.

Returns:
The current registry type. Can be null.

setRegistryType

public void setRegistryType(String registryType)
Set the current registry type. The EditorRendererRegistry allows multipule editors and renderers to be registered for a particular class by defining a different modifier type for each.

Parameters:
registryType - The new registry type (can be null)

getCellEditor

public TableCellEditor getCellEditor()
Returns the TableCellEditor used by the JTable to edit values for this column. When the cellEditor is null, the JTable uses a default editor based on the class of the cells in that column. The default value for a cellEditor is null.

Overrides:
getCellEditor in class TableColumn
Returns:
The current cellEditor for this column
See Also:
TableColumn.setCellEditor(javax.swing.table.TableCellEditor), JTable.setDefaultEditor(java.lang.Class, javax.swing.table.TableCellEditor)

setHeaderLabelHorizontalAlignment

public void setHeaderLabelHorizontalAlignment(int alignment)
Sets the horizontal alignment for the JLabel within the header of this column. This is used by the default header renderer for JCSortableTable and JCTreeTable. By default this value is a non-valid alignment value, in which case the renderer will use the default JLabel horizontal alignment value, which is SwingConstants.LEADING.

Parameters:
alignment - the new header label horizontal alignment value
See Also:
JLabel

getHeaderLabelHorizontalAlignment

public int getHeaderLabelHorizontalAlignment()
Gets the horizontal alignment for the JLabel within the header of this column. This is used by the default header renderer for JCSortableTable and JCTreeTable. By default this value is a non-valid alignment value, in which case the renderer will use the default JLabel horizontal alignment value, which is SwingConstants.LEADING.

Returns:
the current header label horizontal alignment value
See Also:
JLabel

Copyright © 2004 Quest Software Inc..
All rights reserved.