Package org.zkoss.pivot.impl
Class SimplePivotRenderer
- java.lang.Object
-
- org.zkoss.pivot.impl.SimplePivotRenderer
-
- All Implemented Interfaces:
PivotRenderer,PivotRendererExt
public class SimplePivotRenderer extends Object implements PivotRendererExt
A basic implementation of PivotRenderer.- Author:
- simonpai
-
-
Constructor Summary
Constructors Constructor Description SimplePivotRenderer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetColumnSize(Pivottable table, PivotHeaderContext colc, PivotField field)Returns the column size in pixel.intgetRowSize(Pivottable table, PivotHeaderContext rowc, PivotField field)Returns the row size in pixel.StringrenderCell(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)Renders the content of each cell.StringrenderCellSClass(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)Specify a CSS class on the cell.StringrenderCellStyle(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)Specify the CSS style on the cell.StringrenderDataField(PivotField field)Renders the label of a data field, shown when there are multiple data fields.StringrenderField(Object data, Pivottable table, PivotField field)Renders the label of a header field in columns and rows.StringrenderGrandTotalField(Pivottable table, PivotField field)Renders the title of a grand total field.StringrenderSubtotalField(Object data, Pivottable table, PivotField field, Calculator calculator)Renders the label of a subtotal field.
-
-
-
Method Detail
-
renderCell
public String renderCell(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)
Description copied from interface:PivotRendererRenders the content of each cell. (excluding row fields, column fields)- Specified by:
renderCellin interfacePivotRenderer- Parameters:
data- data objectrowContext- row header context objectcolumnContext- column header context object- See Also:
PivotHeaderContext
-
getColumnSize
public int getColumnSize(Pivottable table, PivotHeaderContext colc, PivotField field)
Description copied from interface:PivotRendererReturns the column size in pixel.Note that the cell field always from 0 to m, and the returned value is never negative.
- Specified by:
getColumnSizein interfacePivotRenderer- Parameters:
table- the Pivottablecolc- information of the corresponding columnfield- the field corresponds to the leaf column cell. Can be row, column, data field, or null (only in the case of grand total)
-
getRowSize
public int getRowSize(Pivottable table, PivotHeaderContext rowc, PivotField field)
Description copied from interface:PivotRendererReturns the row size in pixel.Note that the cell field always from 0 to m, and the returned value is never negative.
- Specified by:
getRowSizein interfacePivotRenderer- Parameters:
table- the Pivottablerowc- information of the corresponding rowfield- the field corresponds to the leaf row cell. Can be row, column, data field, or null (only in the case of grand total)
-
renderField
public String renderField(Object data, Pivottable table, PivotField field)
Description copied from interface:PivotRendererRenders the label of a header field in columns and rows.- Specified by:
renderFieldin interfacePivotRenderer- Parameters:
data- data objectfield- PivotField- See Also:
PivotField
-
renderGrandTotalField
public String renderGrandTotalField(Pivottable table, PivotField field)
Description copied from interface:PivotRendererRenders the title of a grand total field.- Specified by:
renderGrandTotalFieldin interfacePivotRendererfield- a data PivotField
-
renderSubtotalField
public String renderSubtotalField(Object data, Pivottable table, PivotField field, Calculator calculator)
Description copied from interface:PivotRendererRenders the label of a subtotal field.- Specified by:
renderSubtotalFieldin interfacePivotRenderer- Parameters:
data- data objectfield- PivotFieldcalculator- the subtotal calculator- See Also:
PivotField,Calculator
-
renderDataField
public String renderDataField(PivotField field)
Description copied from interface:PivotRendererRenders the label of a data field, shown when there are multiple data fields.- Specified by:
renderDataFieldin interfacePivotRenderer
-
renderCellSClass
public String renderCellSClass(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)
Description copied from interface:PivotRendererExtSpecify a CSS class on the cell.- Specified by:
renderCellSClassin interfacePivotRendererExt- Parameters:
data- data objectrowContext- row header context objectcolumnContext- column header context object- Returns:
- a CSS class name, or null to ignore
- See Also:
PivotHeaderContext
-
renderCellStyle
public String renderCellStyle(Number data, Pivottable table, PivotHeaderContext rowContext, PivotHeaderContext columnContext, PivotField dataField)
Description copied from interface:PivotRendererExtSpecify the CSS style on the cell.- Specified by:
renderCellStylein interfacePivotRendererExt- Parameters:
data- data objectrowContext- row header context objectcolumnContext- column header context object- Returns:
- a CSS style string, or null to ignore
- See Also:
PivotHeaderContext
-
-