org.apache.struts2.components.table.renderer
Class AbstractCellRenderer
java.lang.Object
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 java.lang.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 java.lang.String |
_alignment
used for horizontal cell alignmnet |
Method Summary |
java.lang.String |
getAlignment()
|
protected abstract java.lang.String |
getCellValue(WebTable table,
java.lang.Object data,
int row,
int col)
this is the method that subclasses need to implement to set their value. |
protected boolean |
isAligned()
|
java.lang.String |
renderCell(WebTable table,
java.lang.Object data,
int row,
int col)
implememnts CellRenderer renderCell. |
void |
setAlignment(java.lang.String alignment)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_alignment
protected java.lang.String _alignment
- used for horizontal cell alignmnet
AbstractCellRenderer
public AbstractCellRenderer()
setAlignment
public void setAlignment(java.lang.String alignment)
getAlignment
public java.lang.String getAlignment()
renderCell
public java.lang.String renderCell(WebTable table,
java.lang.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 java.lang.String getCellValue(WebTable table,
java.lang.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-2006 Apache Software Foundation. All Rights Reserved.