com.taursys.swing
Class MTableColumn

java.lang.Object
  extended byjavax.swing.table.TableColumn
      extended bycom.taursys.swing.MTableColumn
All Implemented Interfaces:
java.io.Serializable

public class MTableColumn
extends javax.swing.table.TableColumn

MTableColumn is a TableColumn for use with an MTable. This column contains additional information for binding and formatting. The following special actions take place when adding this MTableColumn to an MTable:

You can also control the format, alignment, and size of the column by setting the appropriate properties of this object.

Version:
1.0
Author:
Marty Phelan
See Also:
Serialized Form

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
MTableColumn()
          Constructs a new MTableColumn
 
Method Summary
 java.lang.String getDisplayHeading()
          Get the Heading to display for this MTableColumn.
 java.text.Format getFormat()
          Get the Format used for rendering this column.
 java.lang.String getFormatPattern()
          Get the Format pattern used for rendering this column.
 int getHorizontalAlignment()
          Get the horizontal alignment of the icon and text for the cell.
 MTableCellRenderer getMTableCellRenderer()
          Get the CellRenderer and cast it as an MTableCellRenderer (convience method).
 java.lang.String getPropertyName()
          Get the propertyName for the corresponding columnName in the MTableModel.
 ValueHolder getValueHolder()
          Get the valueHolder for this MTableColumn.
 void setDisplayHeading(java.lang.String newDisplayHeading)
          Set the Heading to display for this MTableColumn.
 void setFormat(java.text.Format format)
          Set the Format used for rendering this column.
 void setFormatPattern(java.lang.String newPattern)
          Set the Format pattern used for rendering this column.
 void setHorizontalAlignment(int alignment)
          Set the horizontal alignment of the icon and text for the cell.
 void setPropertyName(java.lang.String newPropertyName)
          Set the propertyName for the corresponding columnName in the MTableModel.
 void setValueHolder(ValueHolder newValueHolder)
          Set the valueHolder for this MTableColumn.
 
Methods inherited from class javax.swing.table.TableColumn
addPropertyChangeListener, createDefaultHeaderRenderer, disableResizedPosting, enableResizedPosting, getCellEditor, 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
 

Constructor Detail

MTableColumn

public MTableColumn()
Constructs a new MTableColumn

Method Detail

getMTableCellRenderer

public MTableCellRenderer getMTableCellRenderer()
Get the CellRenderer and cast it as an MTableCellRenderer (convience method).

Returns:
the CellRenderer and cast it as an MTableCellRenderer

setFormat

public void setFormat(java.text.Format format)
Set the Format used for rendering this column. This must be a subclass of java.text.Format. The format is passed to the underlying MTableCellRenderer to be used during rendition.

Parameters:
format - the Format used for rendering this column

getFormat

public java.text.Format getFormat()
Get the Format used for rendering this column. This must be a subclass of java.text.Format. The format is passed to the underlying MTableCellRenderer to be used during rendition.

Returns:
the Format used for rendering this column

setFormatPattern

public void setFormatPattern(java.lang.String newPattern)
Set the Format pattern used for rendering this column. This must be a valid format String for the current Format. The format pattern is passed to the underlying MTableCellRenderer to be used during rendition.

Parameters:
newPattern - the Format pattern used for rendering this column

getFormatPattern

public java.lang.String getFormatPattern()
Get the Format pattern used for rendering this column. This must be a valid format String for the current Format. The format pattern is passed to the underlying MTableCellRenderer to be used during rendition.

Returns:
the Format pattern used for rendering this column

setHorizontalAlignment

public void setHorizontalAlignment(int alignment)
Set the horizontal alignment of the icon and text for the cell.

Parameters:
alignment - - One of the following constants defined in SwingConstants: LEFT, CENTER (the default for image-only labels), RIGHT, LEADING (the default for text-only labels) or TRAILING.

getHorizontalAlignment

public int getHorizontalAlignment()
Get the horizontal alignment of the icon and text for the cell.

Returns:
alignment - One of the following constants defined in SwingConstants: LEFT, CENTER (the default for image-only labels), RIGHT, LEADING (the default for text-only labels) or TRAILING.

setPropertyName

public void setPropertyName(java.lang.String newPropertyName)
Set the propertyName for the corresponding columnName in the MTableModel. This propertyName must be a valid propertyName for the object contained in the ListValueHolder of the MTableModel. When this MTableColumn is added to an MTable, this propertyName is used to set the modelIndex by finding the column in the MTableModel. If it is not found, this property is added to the MTableModel's list of columns.

Parameters:
newPropertyName - the propertyName for the corresponding columnName in the MTableModel.

getPropertyName

public java.lang.String getPropertyName()
Get the propertyName for the corresponding columnName in the MTableModel. This propertyName must be a valid propertyName for the object contained in the ListValueHolder of the MTableModel. When this MTableColumn is added to an MTable, this propertyName is used to set the modelIndex by finding the column in the MTableModel. If it is not found, this property is added to the MTableModel's list of columns.

Returns:
the propertyName for the corresponding columnName in the MTableModel.

setValueHolder

public void setValueHolder(ValueHolder newValueHolder)
Set the valueHolder for this MTableColumn. This is usually set automatically when this MTableColumn is added to the MTable.

Parameters:
newValueHolder - the valueHolder for this MTableColumn.

getValueHolder

public ValueHolder getValueHolder()
Get the valueHolder for this MTableColumn. This is usually set automatically when this MTableColumn is added to the MTable.

Returns:
the valueHolder for this MTableColumn.

setDisplayHeading

public void setDisplayHeading(java.lang.String newDisplayHeading)
Set the Heading to display for this MTableColumn. This simply calls the setHeaderValue with a String value rather than Object value.

Parameters:
newDisplayHeading - the Heading to display for this MTableColumn

getDisplayHeading

public java.lang.String getDisplayHeading()
Get the Heading to display for this MTableColumn. This simply calls the getHeaderValue returning a String value rather than Object value.

Returns:
the Heading to display for this MTableColumn


Copyright © 2007 Martin T Phelan. All Rights Reserved.