Class AbstractCellRenderer

  extended by org.apache.struts2.components.table.renderer.AbstractCellRenderer
All Implemented Interfaces:
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
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


protected String _alignment
used for horizontal cell alignmnet

Constructor Detail


public AbstractCellRenderer()
Method Detail


public void setAlignment(String alignment)


public String getAlignment()


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


protected boolean isAligned()


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.