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

BooleanCellRenderer

public class BooleanCellRenderer extends AbstractCellRenderer

Fields Summary
protected String
_falseValue
value used if the boolean object is false
protected String
_trueValue
value used if the boolean object is true
Constructors Summary
public BooleanCellRenderer()



      
        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 Boolean) {
            return ((Boolean) data).booleanValue() ? _trueValue : _falseValue;
        }

        return data.toString(); //if here then not a boolean
    
public voidsetFalseValue(java.lang.String falseValue)

        _falseValue = falseValue;
    
public voidsetTrueValue(java.lang.String trueValue)

        _trueValue = trueValue;