FileDocCategorySizeDatePackage
DateCellRenderer.javaAPI DocExample1869Mon Jul 23 13:26:34 BST 2007org.apache.struts2.components.table.renderer

DateCellRenderer

public class DateCellRenderer extends AbstractCellRenderer

Fields Summary
SimpleDateFormat
_formater
String
_formatString
this is the string that SimpleDateFormat needs to display the date
Constructors Summary
public DateCellRenderer()



      
        super();
    
Methods Summary
public java.lang.StringgetCellValue(org.apache.struts2.components.table.WebTable table, java.lang.Object data, int row, int col)


        if (data == null) {
            return "";
        }

        if (data instanceof java.util.Date) {
            return _formater.format((java.util.Date) data);
        }

        return data.toString();
    
public voidsetFormatString(java.lang.String format)

        _formatString = format;
        _formater.applyPattern(_formatString);