Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.struts2.components.table.renderer
Class NumericCellRenderer

    java.lang.Object
      org.apache.struts2.components.table.renderer.AbstractCellRenderer
          org.apache.struts2.components.table.renderer.NumericCellRenderer

All Implemented Interfaces:
  CellRenderer

    public class NumericCellRenderer

extends AbstractCellRenderer

Field Summary
`(package private) DecimalFormat` | `_formater`
`(package private) String` | `_formatString` this is the format string that DecimalFormat would use.
`(package private) String` | `_negativeColor` if set the is the color to use if Number is negative.
`(package private) String` | `_positiveColor` if set this is the color to render if number is positive

Fields inherited from class org.apache.struts2.components.table.renderer.AbstractCellRenderer
`_alignment`

Constructor Summary
`NumericCellRenderer()`

Method Summary
`String` | `getCellValue(WebTable table, Object data, int row, int col)` this is the method that subclasses need to implement to set their value.
`protected void` | `processNumber(StringBuffer buf, String color, double cellValue)`
`void` | `setFormatString(String format)`
`void` | `setNegativeColor(String color)`
`void` | `setPositiveColor(String color)`

Methods inherited from class org.apache.struts2.components.table.renderer.AbstractCellRenderer
`getAlignment, isAligned, renderCell, setAlignment`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### _formater

    DecimalFormat _formater

### _formatString

    String _formatString

  this is the format string that DecimalFormat would use.

  See Also:
    `DecimalFormat`

### _negativeColor

    String _negativeColor

  if set the is the color to use if Number is negative.

### _positiveColor

    String _positiveColor

  if set this is the color to render if number is positive

Constructor Detail

### NumericCellRenderer

    public NumericCellRenderer()

Method Detail

### getCellValue

    public String getCellValue(WebTable table,
                               Object data,
                               int row,
                               int col)

  Description copied from class: `AbstractCellRenderer`
  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

  Specified by:
    `getCellValue` in class `AbstractCellRenderer`

### setFormatString

    public void setFormatString(String format)

### setNegativeColor

    public void setNegativeColor(String color)

### setPositiveColor

    public void setPositiveColor(String color)

### processNumber

    protected void processNumber(StringBuffer buf,
                                 String color,
                                 double cellValue)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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