com.metamatrix.toolbox.ui.widget.table
Class DefaultTableCellRenderer

java.lang.Object
  extended by com.metamatrix.toolbox.ui.widget.table.DefaultTableCellRenderer
All Implemented Interfaces:
javax.swing.SwingConstants, javax.swing.table.TableCellRenderer
Direct Known Subclasses:
PropertiedObjectTableCellRenderer, ProvidersMain.ProvidersCellRenderer, ServiceMgmtPanel.ServiceMgmtCellRenderer

public class DefaultTableCellRenderer
extends java.lang.Object
implements javax.swing.SwingConstants, javax.swing.table.TableCellRenderer

This is the default cell renderer for TableWidgets. It renders boolean values as CheckBoxes and right-justifies numeric values.

Since:
Golden Gate
Version:
Golden Gate
Author:
John P. A. Verhaeg

Nested Class Summary
 class DefaultTableCellRenderer.DefaultBooleanComponent
           
 class DefaultTableCellRenderer.DefaultTextComponent
           
 
Field Summary
 javax.swing.border.Border checkBoxBorder
           
 javax.swing.border.Border noFocusBorder
           
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
DefaultTableCellRenderer()
           
 
Method Summary
 java.awt.Component getTableCellRendererComponent(javax.swing.JTable table, java.lang.Object value, boolean isSelected, boolean hasFocus, int rowIndex, int columnIndex)
          Returns the appropriate Component to render the value in the specified table at the specified row and column indexes.
protected  void initializeComponent(java.awt.Component component, javax.swing.JTable table, boolean isSelected, boolean hasFocus, int rowIndex, int columnIndex)
           
 void setBooleanComponent(CheckBox theCheckBox)
           
 void setTextComponent(LabelWidget theLabel)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

noFocusBorder

public final javax.swing.border.Border noFocusBorder

checkBoxBorder

public final javax.swing.border.Border checkBoxBorder
Constructor Detail

DefaultTableCellRenderer

public DefaultTableCellRenderer()
Method Detail

getTableCellRendererComponent

public java.awt.Component getTableCellRendererComponent(javax.swing.JTable table,
                                                        java.lang.Object value,
                                                        boolean isSelected,
                                                        boolean hasFocus,
                                                        int rowIndex,
                                                        int columnIndex)
Returns the appropriate Component to render the value in the specified table at the specified row and column indexes.

Specified by:
getTableCellRendererComponent in interface javax.swing.table.TableCellRenderer
Parameters:
table - The table containing the value
value - The value
isSelected - True if the cell containing the value is currently selected
hasFocus - True if the cell containing the value currently has focus
rowIndex - The row index of the cell containing the value
columnIndex - The column index of the cell containing the value
Returns:
A CheckBox for boolean values, a LabelWidget with right-justified text for numeric values, and a LabelWidget with left-justified text for all other values.
Since:
Golden Gate

initializeComponent

protected void initializeComponent(java.awt.Component component,
                                   javax.swing.JTable table,
                                   boolean isSelected,
                                   boolean hasFocus,
                                   int rowIndex,
                                   int columnIndex)
Since:
2.1

setBooleanComponent

public void setBooleanComponent(CheckBox theCheckBox)

setTextComponent

public void setTextComponent(LabelWidget theLabel)


Copyright © 2009. All Rights Reserved.