com.arsdigita.bebop
Class PropertySheet.StringLabelCellRenderer

java.lang.Object
  extended bycom.arsdigita.bebop.PropertySheet.StringLabelCellRenderer
All Implemented Interfaces:
TableCellRenderer
Direct Known Subclasses:
PropertySheet.GlobalizedLabelCellRenderer
Enclosing class:
PropertySheet

public static class PropertySheet.StringLabelCellRenderer
extends Object
implements TableCellRenderer


Field Summary
 
Fields inherited from interface com.arsdigita.bebop.table.TableCellRenderer
versionId
 
Constructor Summary
PropertySheet.StringLabelCellRenderer(boolean outputEscape)
           
PropertySheet.StringLabelCellRenderer(String weight)
           
 
Method Summary
 Component getComponent(Table table, PageState state, Object value, boolean isSelected, Object key, int row, int column)
          Return a component with the visual representation for the passed in key and value.
protected  Label getLabel(Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertySheet.StringLabelCellRenderer

public PropertySheet.StringLabelCellRenderer(String weight)

PropertySheet.StringLabelCellRenderer

public PropertySheet.StringLabelCellRenderer(boolean outputEscape)
Method Detail

getComponent

public Component getComponent(Table table,
                              PageState state,
                              Object value,
                              boolean isSelected,
                              Object key,
                              int row,
                              int column)
Description copied from interface: TableCellRenderer
Return a component with the visual representation for the passed in key and value.

The table sets the control event prior to calling this method, so that any control link returned as the component will, when clicked, cause the table to fire a TableActionEvent whose getRowKey() and getColumn() return the values of key and column. A simple cell renderer that achieves this would implement this method in the following way:

   public Component getComponent(Table table, PageState state, Object value,
              boolean isSelected, Object key,
              int row, int column) {
     return new ControlLink(value.toString());
   }
 

The column refers to a column in the table's TableColumnModel, i.e. the visual column on the screen, and not the table's representation of the underlying data in the TableModel.

Specified by:
getComponent in interface TableCellRenderer
Parameters:
table - the table requesting the rendering.
state - represents the state of the current request.
value - the data element to render as returned by the table model's getElementAt(column).
isSelected - true if this item is selected.
key - the key identifying this row (and possibly column) as returned by the table model's getKeyAt(column)
row - the number of the row in the table, the first row has number 0.
column - the number of the table column.
Returns:
the component that should be used to render the value.
See Also:
TableColumnModel

getLabel

protected Label getLabel(Object value)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC