Package org.zkoss.pivot.impl
Class SimplePivotField
- java.lang.Object
-
- org.zkoss.pivot.impl.SimplePivotField
-
- All Implemented Interfaces:
PivotField
- Direct Known Subclasses:
TabularPivotField
public class SimplePivotField extends Object implements PivotField
A simple pivot field implementation.- Author:
- jumperchen, dennischen
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.zkoss.pivot.PivotField
PivotField.Type
-
-
Field Summary
Fields Modifier and Type Field Description protected GroupHandler
_groupHandler
protected String
_name
protected Calculator[]
_subtotals
protected Calculator
_summary
protected String
_title
protected PivotField.Type
_type
-
Constructor Summary
Constructors Constructor Description SimplePivotField()
SimplePivotField(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFieldDataListener(FieldDataListener f)
Adds a field data listener to the pivot field.protected void
fireEvent(String type, Object original, Object current)
String
getFieldName()
Returns the field name which indicates the name within the data modelGroupHandler
getGroupHandler()
Returns the group handler.Calculator
getSubtotal(int index)
Returns the ith subtotal calculator on the field.Calculator[]
getSubtotals()
Returns a set of subtotal calculator in order.Calculator
getSummary()
Returns the summary calculatorString
getTitle()
Returns the title of the field.PivotField.Type
getType()
Returns the area type.void
removeFieldDataListener(FieldDataListener f)
Removes the specified field data listener from the pivot field.void
setFieldName(String fieldName)
Set field namevoid
setGroupHandler(GroupHandler groupHandler)
Sets the group handler.protected void
setSubtotals(Calculator[] subtotals)
protected void
setSummary(Calculator summary)
void
setTitle(String title)
Sets the title of the field that is used to display on the UI, like Data area type.
-
-
-
Field Detail
-
_name
protected String _name
-
_title
protected String _title
-
_type
protected PivotField.Type _type
-
_groupHandler
protected GroupHandler _groupHandler
-
_subtotals
protected Calculator[] _subtotals
-
_summary
protected Calculator _summary
-
-
Constructor Detail
-
SimplePivotField
public SimplePivotField()
-
SimplePivotField
public SimplePivotField(String name)
-
-
Method Detail
-
setTitle
public void setTitle(String title)
Sets the title of the field that is used to display on the UI, like Data area type.
-
getTitle
public String getTitle()
Description copied from interface:PivotField
Returns the title of the field.- Specified by:
getTitle
in interfacePivotField
-
getType
public PivotField.Type getType()
Description copied from interface:PivotField
Returns the area type.- Specified by:
getType
in interfacePivotField
- See Also:
PivotField.Type
-
getFieldName
public String getFieldName()
Description copied from interface:PivotField
Returns the field name which indicates the name within the data model- Specified by:
getFieldName
in interfacePivotField
-
setFieldName
public void setFieldName(String fieldName)
Set field name
-
setGroupHandler
public void setGroupHandler(GroupHandler groupHandler)
Sets the group handler.- See Also:
GroupHandler
-
getGroupHandler
public GroupHandler getGroupHandler()
Description copied from interface:PivotField
Returns the group handler.- Specified by:
getGroupHandler
in interfacePivotField
-
addFieldDataListener
public void addFieldDataListener(FieldDataListener f)
Description copied from interface:PivotField
Adds a field data listener to the pivot field.- Specified by:
addFieldDataListener
in interfacePivotField
-
removeFieldDataListener
public void removeFieldDataListener(FieldDataListener f)
Description copied from interface:PivotField
Removes the specified field data listener from the pivot field.- Specified by:
removeFieldDataListener
in interfacePivotField
-
setSubtotals
protected void setSubtotals(Calculator[] subtotals)
-
getSubtotals
public Calculator[] getSubtotals()
Description copied from interface:PivotField
Returns a set of subtotal calculator in order.- Specified by:
getSubtotals
in interfacePivotField
-
getSubtotal
public Calculator getSubtotal(int index)
Description copied from interface:PivotField
Returns the ith subtotal calculator on the field.- Specified by:
getSubtotal
in interfacePivotField
-
setSummary
protected void setSummary(Calculator summary)
-
getSummary
public Calculator getSummary()
Description copied from interface:PivotField
Returns the summary calculator- Specified by:
getSummary
in interfacePivotField
-
-