org.apache.struts2.components.table.renderer
Class AbstractCellRenderer

java.lang.Object
  extended by org.apache.struts2.components.table.renderer.AbstractCellRenderer
All Implemented Interfaces:
CellRenderer
Direct Known Subclasses:
BooleanCellRenderer, DateCellRenderer, DefaultCellRenderer, FixedTextCellRenderer, LinkCellRenderer, NumericCellRenderer

public abstract class AbstractCellRenderer
extends Object
implements CellRenderer

this is the base class that most renderers will be derived from. It allows setting the alignment. Subclasses should set there actuall content by implementing getCellValue


Field Summary
protected  String _alignment
          used for horizontal cell alignmnet
 
Constructor Summary
AbstractCellRenderer()
           
 
Method Summary
 String getAlignment()
           
protected abstract  String getCellValue(WebTable table, Object data, int row, int col)
          this is the method that subclasses need to implement to set their value.
protected  boolean isAligned()
           
 String renderCell(WebTable table, Object data, int row, int col)
          implememnts CellRenderer renderCell.
 void setAlignment(String alignment)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_alignment

protected String _alignment
used for horizontal cell alignmnet

Constructor Detail

AbstractCellRenderer

public AbstractCellRenderer()
Method Detail

setAlignment

public void setAlignment(String alignment)

getAlignment

public String getAlignment()

renderCell

public String renderCell(WebTable table,
                         Object data,
                         int row,
                         int col)
implememnts CellRenderer renderCell. It sets the alignment. gets the actual data from getCellValue

Specified by:
renderCell in interface CellRenderer

isAligned

protected boolean isAligned()

getCellValue

protected abstract String getCellValue(WebTable table,
                                       Object data,
                                       int row,
                                       int col)
this is the method that subclasses need to implement to set their value. they should not override renderCell unless they want to change the alignmnent renderering



Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.