JIDE 3.5.15

com.jidesoft.pivot
Class PivotField

java.lang.Object
  extended by com.jidesoft.grid.Field
      extended by com.jidesoft.pivot.PivotField
All Implemented Interfaces:
PivotConstants, Serializable, Cloneable, Comparable<PivotField>

public class PivotField
extends Field
implements Comparable<PivotField>, PivotConstants, Cloneable

PivotField represents a field in Pivot Table. Those fields can be row fields, column fields, data fields or filter fields.

See Also:
Serialized Form

Field Summary
static int LOCATION_AFTER
           
static int LOCATION_BEFORE
           
static String PROPERTY_AREA_INDEX
           
static String PROPERTY_AREA_TYPE
           
static String PROPERTY_CUSTOM_SUBTOTALS
           
static String PROPERTY_FILTER_ON_SUMMARY
           
static String PROPERTY_GRAND_TOTAL_SUMMARY_TYPE
           
static String PROPERTY_RUNNING_SUMMARY_LIST
           
static String PROPERTY_SORT_BY
           
static String PROPERTY_SUBTOTAL_LOCATION
           
static String PROPERTY_SUBTOTAL_TYPE
           
static String PROPERTY_SUMMARY_TYPE
           
 
Fields inherited from class com.jidesoft.grid.Field
_converterContext, _editorContext, _isConverterContextSet, _isEditorContextSet, _modelIndex, _sortOrder, _tableModel, changeSupport, PROPERTY_ASCENDING, PROPERTY_CONVERTER_CONTEXT, PROPERTY_CUSTOMIZABLE, PROPERTY_DESCRIPTION, PROPERTY_DESELECTED_POSSIBLE_VALUES, PROPERTY_EDITOR_CONTEXT, PROPERTY_EXPANDABLE, PROPERTY_FILTER, PROPERTY_FILTERABLE, PROPERTY_ICON, PROPERTY_NAME, PROPERTY_PREFER_SELECTED_VALUES, PROPERTY_SELECTED_POSSIBLE_VALUES, PROPERTY_SORT_ORDER, PROPERTY_SORTABLE, PROPERTY_TITLE, PROPERTY_TYPE, PROPERTY_VISIBLE, SORT_ORDER_ASCENDING, SORT_ORDER_DESCENDING, SORT_ORDER_UNSORTED
 
Fields inherited from interface com.jidesoft.pivot.PivotConstants
AREA_COLUMN, AREA_DATA, AREA_FILTER, AREA_NAMES, AREA_NOT_ASSIGNED, AREA_ROW, COMPARE_TO_NEXT, COMPARE_TO_PREVIOUS, HEADER_SELECTION_DATA_TABLE_ONLY, HEADER_SELECTION_HEADER_TABLE_ONLY, RANGE_IN_TOTAL, RUNNING_SUMMARY_DIFFERENCE, RUNNING_SUMMARY_PERCENTAGE_FROM, RUNNING_SUMMARY_PERCENTAGE_OF, RUNNING_SUMMARY_PERCENTAGE_TOTAL, RUNNING_SUMMARY_TOTAL, STATISTICS_CALCULATION_DEFAULT, STATISTICS_CALCULATION_RUNNING, STATISTICS_CALCULATION_RUNNING_IN_COLUMN, STATISTICS_CALCULATION_RUNNING_LEAF, SUBTOTAL_AUTOMATIC, SUBTOTAL_CUSTOM, SUBTOTAL_NONE, SUMMARY_COUNT, SUMMARY_CUSTOM, SUMMARY_MAX, SUMMARY_MEAN, SUMMARY_MIN, SUMMARY_NAMES, SUMMARY_NONE, SUMMARY_RESERVED_MAX, SUMMARY_STDDEV, SUMMARY_SUM, SUMMARY_VAR
 
Constructor Summary
PivotField()
          Default constructor.
PivotField(PivotDataSource dataSource, int modelIndex)
          Creates the PivotField.
PivotField(TableModel tableModel, int modelIndex)
          Creates the PivotField.
 
Method Summary
protected  Object clone()
           
 int compareTo(PivotField o)
           
 int getAreaIndex()
          Gets the index in its area.
 int getAreaType()
          Gets the area type.
 int[] getCustomSubtotals()
          Gets the custom subtotals.
 int[] getCustomSubtotalsForColumn()
          Gets the custom subtotals for row fields.
 int[] getCustomSubtotalsForRow()
          Gets the custom subtotals for row fields.
 Summary getCustomSummary()
           
 int getGrandTotalSummaryType()
          Gets the summary type for the grand total.
 List<RunningSummary> getRunningSummaryList()
          Get the running summary list.
 Values getSortByColumnKeys()
          Gets the sort-by column key.
 int getSortByDataFieldModelIndex()
          Gets the sort-by data field index.
 int getSortBySummaryType()
          Gets the summary type of the sort-by.
 int getStatisticsCalculationType()
          Gets the statistics calculation type.
 int getSubtotalLocation()
          Gets the subtotal display location.
 int getSubtotalType()
          Gets the subtotal type.
 int getSubtotalTypeForColumn()
          Gets the subtotal type for row fields.
 int getSubtotalTypeForRow()
          Gets the subtotal type for row fields.
 Class<?> getSummaryClass(int type)
          Gets the summary class.
 int getSummaryType()
          Gets the summary type.
 boolean isAllowedAsColumnField()
           
 boolean isAllowedAsDataField()
           
 boolean isAllowedAsField(int areaType)
           
 boolean isAllowedAsFilterField()
           
 boolean isAllowedAsRowField()
           
 boolean isAllowedAsUnassignedField()
           
 boolean isDataFieldFilterOnSummary()
           
 boolean isHideOriginalData()
          Get the flag indicating if the original calculated data columns should be hidden if there is any running summary.
 boolean isNumericType()
          Checks if the type of the PivotField is numeric type.
 boolean isSeparateSubtotalSettings()
          Checks if the subtotal settings are separately for row fields and column fields.
 boolean isSortByAscending()
          Gets the sort order of the sort-by.
 void setAllowedAsColumnField(boolean allowedAsColumnField)
           
 void setAllowedAsDataField(boolean allowedAsDataField)
           
 void setAllowedAsFilterField(boolean allowedAsFilterField)
           
 void setAllowedAsRowField(boolean allowedAsRowField)
           
 void setAllowedAsUnassignedField(boolean allowedAsUnassignedField)
           
 void setAreaIndex(int areaIndex)
          Sets the index in its area.
 void setAreaType(int areaType)
          Sets the area type.
 void setCustomSubtotals(int[] customSubtotals)
          Sets the custom subtotals.
 void setCustomSubtotalsForColumn(int[] customSubtotalsForColumn)
          Sets the custom subtotals.
 void setCustomSubtotalsForRow(int[] customSubtotalsForRow)
          Sets the custom subtotals.
 void setCustomSummary(Summary customSummary)
           
 void setDataFieldFilterOnSummary(boolean dataFieldFilterOnSummary)
           
 void setFilteredPossibleValues(Object[] filteredPossibleValues)
          Sets the filtered possible values for this field.
 void setGrandTotalSummaryType(int grandTotalSummaryType)
          Sets the summary type for the grand total.
 void setHideOriginalData(boolean hideOriginalData)
          Set the flag indicating if the original calculated data columns should be hidden if there is any running summary.
 void setRunningSummaryList(List<RunningSummary> runningSummaryList)
          Set the running summary list.
 void setSelectedPossibleValues(Object[] selectedPossibleValues)
          Sets the selected possible values for this field.
 void setSeparateSubtotalSettings(boolean separateSubtotalSettings)
          Sets the flag of separateSubtotalSettings.
 void setSortByAscending(boolean sortByAscending)
          Sets the sort order of the sort-by.
 void setSortByColumnKeys(Values sortByColumnKeys)
          Sets the sort-by column key.
 void setSortByDataFieldModelIndex(int sortByDataFieldModelIndex)
          Sets the sort-by data field index.
 void setSortBySummaryType(int sortBySummaryType)
          Sets the summary type of the sort-by.
 void setSortOrder(int sortOrder)
          Sets the sort order.
 void setStatisticsCalculationType(int statisticsCalculationType)
          Sets the statistics calculation type.
 void setSubtotalLocation(int subtotalLocation)
          Sets the subtotal display location.
 void setSubtotalType(int subtotalType)
          Sets the subtotal types.
 void setSubtotalTypeForColumn(int subtotalTypeForColumn)
          Sets the subtotal types for column fields.
 void setSubtotalTypeForRow(int subtotalTypeForRow)
          Sets the subtotal types for row fields.
 void setSummaryType(int summaryType)
          Sets the summary type.
 void setTitle(String title)
           
 
Methods inherited from class com.jidesoft.grid.Field
addPropertyChangeListener, addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, getActualFilter, getComparatorContext, getConverterContext, getDescription, getEditorContext, getFilter, getFilteredPossibleValues, getIcon, getModelIndex, getName, getPreferredWidth, getPropertyChangeListeners, getPropertyChangeListeners, getSelectedPossibleValues, getSortOrder, getTableModel, getTitle, getType, isAscending, isCustomFilterAllowed, isCustomizable, isDuplicated, isExpandable, isFilterable, isNullValueAllowed, isPreferSelectedPossibleValues, isSortable, isVisible, removePropertyChangeListener, removePropertyChangeListener, setAscending, setComparatorContext, setConverterContext, setCustomFilterAllowed, setCustomizable, setDescription, setDuplicated, setEditorContext, setExpandable, setFilter, setFilterable, setIcon, setName, setNullValueAllowed, setPreferredWidth, setPreferSelectedPossibleValues, setSortable, setType, setVisible, toggleAscending, updateFromTableModel
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCATION_AFTER

public static final int LOCATION_AFTER
See Also:
Constant Field Values

LOCATION_BEFORE

public static final int LOCATION_BEFORE
See Also:
Constant Field Values

PROPERTY_SUMMARY_TYPE

public static final String PROPERTY_SUMMARY_TYPE
See Also:
Constant Field Values

PROPERTY_GRAND_TOTAL_SUMMARY_TYPE

public static final String PROPERTY_GRAND_TOTAL_SUMMARY_TYPE
See Also:
Constant Field Values

PROPERTY_SUBTOTAL_TYPE

public static final String PROPERTY_SUBTOTAL_TYPE
See Also:
Constant Field Values

PROPERTY_SUBTOTAL_LOCATION

public static final String PROPERTY_SUBTOTAL_LOCATION
See Also:
Constant Field Values

PROPERTY_CUSTOM_SUBTOTALS

public static final String PROPERTY_CUSTOM_SUBTOTALS
See Also:
Constant Field Values

PROPERTY_AREA_TYPE

public static final String PROPERTY_AREA_TYPE
See Also:
Constant Field Values

PROPERTY_AREA_INDEX

public static final String PROPERTY_AREA_INDEX
See Also:
Constant Field Values

PROPERTY_SORT_BY

public static final String PROPERTY_SORT_BY
See Also:
Constant Field Values

PROPERTY_FILTER_ON_SUMMARY

public static final String PROPERTY_FILTER_ON_SUMMARY
See Also:
Constant Field Values

PROPERTY_RUNNING_SUMMARY_LIST

public static final String PROPERTY_RUNNING_SUMMARY_LIST
See Also:
Constant Field Values
Constructor Detail

PivotField

public PivotField()
Default constructor.


PivotField

public PivotField(TableModel tableModel,
                  int modelIndex)
Creates the PivotField.

Parameters:
tableModel - the table model.
modelIndex - the model index.

PivotField

public PivotField(PivotDataSource dataSource,
                  int modelIndex)
Creates the PivotField.

Parameters:
dataSource - the data source
modelIndex - the model index.
Method Detail

getAreaType

public int getAreaType()
Gets the area type.

The valid values are PivotConstants.AREA_ROW, PivotConstants.AREA_COLUMN, PivotConstants.AREA_DATA, PivotConstants.AREA_FILTER and PivotConstants.AREA_NOT_ASSIGNED.

Returns:
the area type.

isNumericType

public boolean isNumericType()
Checks if the type of the PivotField is numeric type.

Returns:
true if it is numeric type including all subclasses of Number, double, int, float, short and long.

setAreaType

public void setAreaType(int areaType)
Sets the area type.

The valid values are PivotConstants.AREA_ROW, PivotConstants.AREA_COLUMN, PivotConstants.AREA_DATA, PivotConstants.AREA_FILTER and PivotConstants.AREA_NOT_ASSIGNED.

This is a bounded property. Property change event will be fired if the name is changed.

Parameters:
areaType - the area type.

getAreaIndex

public int getAreaIndex()
Gets the index in its area.

Returns:
the index in its area.

setAreaIndex

public void setAreaIndex(int areaIndex)
Sets the index in its area. In normal, the index should be 2 * n + 1, where n is the column number in its area type. That means, the area index should be unique in the same area type. When the field order is changed, the area index will have a temporary even number as 2 * n + 2, it's for internal use. If you get an event changing index from even number 2 * n + 2 to 2 * n + 1, you can just ignore it.

This is a bounded property. Property change event will be fired if the name is changed.

Parameters:
areaIndex - the area index.

compareTo

public int compareTo(PivotField o)
Specified by:
compareTo in interface Comparable<PivotField>

getCustomSummary

public Summary getCustomSummary()

setCustomSummary

public void setCustomSummary(Summary customSummary)

getSummaryType

public int getSummaryType()
Gets the summary type.

Returns:
the summary type.

setSummaryType

public void setSummaryType(int summaryType)
Sets the summary type. This is only valid for data field. Valid summary types are defined in PivotConstants starting with "SUMMARY_".

Parameters:
summaryType - the new summary type.

getGrandTotalSummaryType

public int getGrandTotalSummaryType()
Gets the summary type for the grand total.

Returns:
the summary type for the grand total.

setGrandTotalSummaryType

public void setGrandTotalSummaryType(int grandTotalSummaryType)
Sets the summary type for the grand total. This is only valid for data field. Valid summary types are defined in PivotConstants starting with "SUMMARY_".

Parameters:
grandTotalSummaryType - the new summary type for the grand total.

getSubtotalType

public int getSubtotalType()
Gets the subtotal type.

The valid values are PivotConstants.SUBTOTAL_NONE, PivotConstants.SUBTOTAL_AUTOMATIC and PivotConstants.SUBTOTAL_CUSTOM. If it is PivotConstants.SUBTOTAL_CUSTOM, the actual subtotal types are defined in getCustomSubtotals().

This is a bounded property. Property change event will be fired if the name is changed.

Returns:
the subtotal type.

setSubtotalType

public void setSubtotalType(int subtotalType)
Sets the subtotal types. Calling this method will trigger a call #setSeparateSubtotalSettings(false).

The valid values are PivotConstants.SUBTOTAL_NONE, PivotConstants.SUBTOTAL_AUTOMATIC and PivotConstants.SUBTOTAL_CUSTOM. If you set it as PivotConstants.SUBTOTAL_CUSTOM, you also need to define the actual subtotal types using setCustomSubtotals(int[]).

This is a bounded property. Property change event will be fired if the name is changed.

Parameters:
subtotalType - the subtotal type.

getSubtotalLocation

public int getSubtotalLocation()
Gets the subtotal display location. It could be LOCATION_AFTER so that the subtotal is displayed after the actual data that produces the subtotal. Or it could be be LOCATION_BEFORE which is the opposite.

Returns:
the subtotal display location.

setSubtotalLocation

public void setSubtotalLocation(int subtotalLocation)
Sets the subtotal display location. Valid locations are LOCATION_AFTER and LOCATION_BEFORE.

This is a bounded property. Property change event will be fired if the name is changed.

Parameters:
subtotalLocation - the subtotal display location

getCustomSubtotals

public int[] getCustomSubtotals()
Gets the custom subtotals.

Returns:
the custom subtotals.

setCustomSubtotals

public void setCustomSubtotals(int[] customSubtotals)
Sets the custom subtotals. This is only used when subtotal type is SUBTOTAL_CUSTOM.

This is a bounded property. Property change event will be fired if the name is changed.

Parameters:
customSubtotals - the custom subtotals.

getSubtotalTypeForRow

public int getSubtotalTypeForRow()
Gets the subtotal type for row fields. This method will get the subtotal for row fields only if isSeparateSubtotalSettings() return true. If it returns false, this method will return the value of getSubtotalType().

The valid values are PivotConstants.SUBTOTAL_NONE, PivotConstants.SUBTOTAL_AUTOMATIC and PivotConstants.SUBTOTAL_CUSTOM. If it is PivotConstants.SUBTOTAL_CUSTOM, the actual subtotal types are defined in getCustomSubtotals().

This is a bounded property. Property change event will be fired if the value is changed.

Returns:
the subtotal type.

setSubtotalTypeForRow

public void setSubtotalTypeForRow(int subtotalTypeForRow)
Sets the subtotal types for row fields. Calling this method will trigger a call #setSeparateSubtotalSettings(true).

The valid values are PivotConstants.SUBTOTAL_NONE, PivotConstants.SUBTOTAL_AUTOMATIC and PivotConstants.SUBTOTAL_CUSTOM. If you set it as PivotConstants.SUBTOTAL_CUSTOM, you also need to define the actual subtotal types using setCustomSubtotals(int[]).

This is a bounded property. Property change event will be fired if the value is changed.

Parameters:
subtotalTypeForRow - the subtotal type for row

setSeparateSubtotalSettings

public void setSeparateSubtotalSettings(boolean separateSubtotalSettings)
Sets the flag of separateSubtotalSettings. If true, the subtotal could have different settings for row fields and column fields.

Parameters:
separateSubtotalSettings - true or false.

isSeparateSubtotalSettings

public boolean isSeparateSubtotalSettings()
Checks if the subtotal settings are separately for row fields and column fields.

Returns:
true if separated.

getCustomSubtotalsForRow

public int[] getCustomSubtotalsForRow()
Gets the custom subtotals for row fields. This method will set the custom subtotal for row fields only. If you use setCustomSubtotals(int[]) method, it will set for both row fields and column fields.

Returns:
the custom subtotals.

setCustomSubtotalsForRow

public void setCustomSubtotalsForRow(int[] customSubtotalsForRow)
Sets the custom subtotals. This is only used when subtotal type is SUBTOTAL_CUSTOM.

This is a bounded property. Property change event will be fired if the name is changed.

Parameters:
customSubtotalsForRow - the custom subtotals for the row.

getSubtotalTypeForColumn

public int getSubtotalTypeForColumn()
Gets the subtotal type for row fields. This method will get the subtotal for column fields only if isSeparateSubtotalSettings() return true. If it returns false, this method will return the value of getSubtotalType().

The valid values are PivotConstants.SUBTOTAL_NONE, PivotConstants.SUBTOTAL_AUTOMATIC and PivotConstants.SUBTOTAL_CUSTOM. If it is PivotConstants.SUBTOTAL_CUSTOM, the actual subtotal types are defined in getCustomSubtotals().

This is a bounded property. Property change event will be fired if the name is changed.

Returns:
the subtotal type.

setSubtotalTypeForColumn

public void setSubtotalTypeForColumn(int subtotalTypeForColumn)
Sets the subtotal types for column fields. Calling this method will trigger a call #setSeparateSubtotalSettings(true).

The valid values are PivotConstants.SUBTOTAL_NONE, PivotConstants.SUBTOTAL_AUTOMATIC and PivotConstants.SUBTOTAL_CUSTOM. If you set it as PivotConstants.SUBTOTAL_CUSTOM, you also need to define the actual subtotal types using setCustomSubtotals(int[]).

This is a bounded property. Property change event will be fired if the name is changed.

Parameters:
subtotalTypeForColumn - the subtotal types for the column.

getCustomSubtotalsForColumn

public int[] getCustomSubtotalsForColumn()
Gets the custom subtotals for row fields. This method will set the custom subtotal for row fields only. If you use setCustomSubtotals(int[]) method, it will set for both row fields and column fields.

Returns:
the custom subtotals.

setCustomSubtotalsForColumn

public void setCustomSubtotalsForColumn(int[] customSubtotalsForColumn)
Sets the custom subtotals. This is only used when subtotal type is SUBTOTAL_CUSTOM.

This is a bounded property. Property change event will be fired if the name is changed.

Parameters:
customSubtotalsForColumn - the custom subtotals for the column.

getSummaryClass

public Class<?> getSummaryClass(int type)
Gets the summary class. By default it will return null if the type is the same as the data itself. For example, if the data is a double, sum of it will still be double. Thus getSummaryClass(SUMMARY_SUM) will return null. However getSummaryClass(SUMMARY_COUNT) will return Long.class.

Parameters:
type - the new summary type.
Returns:
the summary class.

setSortOrder

public void setSortOrder(int sortOrder)
Description copied from class: Field
Sets the sort order.

Overrides:
setSortOrder in class Field
Parameters:
sortOrder - the sort order. It can be Field.SORT_ORDER_ASCENDING, Field.SORT_ORDER_DESCENDING, or Field.SORT_ORDER_UNSORTED.

getStatisticsCalculationType

public int getStatisticsCalculationType()
Gets the statistics calculation type. It will determine how the statistics is calculated. The default type is PivotConstants.STATISTICS_CALCULATION_DEFAULT. It will accumulate the values from original table model and calculate statistics on them. There is also a type called PivotConstants.STATISTICS_CALCULATION_RUNNING. It will accumulate the values from the cells as seen in the next level on the UI and calculate statistics on them. One more type called PivotConstants.STATISTICS_CALCULATION_RUNNING_LEAF is used to accumulate the values from the cells as seen in the leaf level on the UI and calculate statistics on them.

For example, let's say we have two cells - one for the sales data in October, the other is for sales data in November. In October, there are actual two transactions - one is $200, the other is $300. So the October cell will display $500. There is only one transaction is November which is $400 so the November cell will display $400. Now we want to calculate Max statistics on these two cells. If using PivotConstants.STATISTICS_CALCULATION_DEFAULT, the Max will be $400 because that's the maximum sales in a single transaction in October and November. However if we use STATISTICS_CALCULATION_RUNNING, the Max will be $500 because that's the maximum value of October cell and November cell.

Please be noted that this flag takes effect only if the CalculatedPivotDataModel is in use.

Returns:
the statistics calculation type.

setStatisticsCalculationType

public void setStatisticsCalculationType(int statisticsCalculationType)
Sets the statistics calculation type.

Parameters:
statisticsCalculationType - the statistics calculation type. It could be PivotConstants.STATISTICS_CALCULATION_DEFAULT or PivotConstants.STATISTICS_CALCULATION_RUNNING OR PivotConstants.STATISTICS_CALCULATION_RUNNING_LEAF.

isAllowedAsDataField

public boolean isAllowedAsDataField()

setAllowedAsDataField

public void setAllowedAsDataField(boolean allowedAsDataField)

isAllowedAsFilterField

public boolean isAllowedAsFilterField()

setAllowedAsFilterField

public void setAllowedAsFilterField(boolean allowedAsFilterField)

isAllowedAsRowField

public boolean isAllowedAsRowField()

setAllowedAsRowField

public void setAllowedAsRowField(boolean allowedAsRowField)

isAllowedAsColumnField

public boolean isAllowedAsColumnField()

setAllowedAsColumnField

public void setAllowedAsColumnField(boolean allowedAsColumnField)

isAllowedAsUnassignedField

public boolean isAllowedAsUnassignedField()

setAllowedAsUnassignedField

public void setAllowedAsUnassignedField(boolean allowedAsUnassignedField)

isAllowedAsField

public boolean isAllowedAsField(int areaType)

getSortByColumnKeys

public Values getSortByColumnKeys()
Gets the sort-by column key.

Returns:
the sort-by column keys.

setSortByColumnKeys

public void setSortByColumnKeys(Values sortByColumnKeys)
Sets the sort-by column key. This is to support sorting the row fields by a certain column. When user right clicks on the data table, there will be a context menu with menu items like "sort ascending" or "sort descending".

Parameters:
sortByColumnKeys - the sort-by column keys.

getSortByDataFieldModelIndex

public int getSortByDataFieldModelIndex()
Gets the sort-by data field index.

Returns:
the sort-by data field index.

setSortByDataFieldModelIndex

public void setSortByDataFieldModelIndex(int sortByDataFieldModelIndex)
Sets the sort-by data field index.

Parameters:
sortByDataFieldModelIndex - a new sort-by data field index.

isSortByAscending

public boolean isSortByAscending()
Gets the sort order of the sort-by.

Returns:
the sort order of the sort-by.

setSortByAscending

public void setSortByAscending(boolean sortByAscending)
Sets the sort order of the sort-by.

Parameters:
sortByAscending - the sort order of the sort-by

getSortBySummaryType

public int getSortBySummaryType()
Gets the summary type of the sort-by.

Returns:
the summary type of the sort-by.

setSortBySummaryType

public void setSortBySummaryType(int sortBySummaryType)
Sets the summary type of the sort-by. It is usually the summary type of the particular row where user right clicks to show the context menu. If the row is not a summary row, it will be the summary type of the row field.

Parameters:
sortBySummaryType - the summary type of the sort-by.

setSelectedPossibleValues

public void setSelectedPossibleValues(Object[] selectedPossibleValues)
Sets the selected possible values for this field. Please note, you have to call this method after PivotTablePane for this PivotDataModel is created.

The method will update the table automatically. But you can call PivotDataModel.setAdjusting(boolean) to false if you want to disable the auto-update when you need to set selected possible values on several fields. If so, remember to call calculate() and bothHeaderUpdated() after you finished the changes.

Please note, this method has a lower priority than Field.setFilter(com.jidesoft.filter.Filter) method. In the other word, if setFilter is called with a valid filter, the (Custom...) item will be selected in the drop down list and the selected possible values will be ignored.

Overrides:
setSelectedPossibleValues in class Field
Parameters:
selectedPossibleValues - new selected possible values.

setFilteredPossibleValues

public void setFilteredPossibleValues(Object[] filteredPossibleValues)
Sets the filtered possible values for this field. Please note, you have to call this method after PivotTablePane for this PivotDataModel is created.

The method will update the table automatically. But you can call PivotDataModel.setAdjusting(boolean) to false if you want to disable the auto-update when you need to set filtered possible values on several fields. If so, remember to call calculate() and bothHeaderUpdated() after you finished the changes.

Please note, this method has a lower priority than Field.setFilter(com.jidesoft.filter.Filter) method. In the other word, if setFilter is called with a valid filter, the (Custom...) item will be selected in the drop down list and the filtered possible values will be ignored.

Overrides:
setFilteredPossibleValues in class Field
Parameters:
filteredPossibleValues - new deselected possible values.

isDataFieldFilterOnSummary

public boolean isDataFieldFilterOnSummary()

setDataFieldFilterOnSummary

public void setDataFieldFilterOnSummary(boolean dataFieldFilterOnSummary)

getRunningSummaryList

public List<RunningSummary> getRunningSummaryList()
Get the running summary list.

Returns:
the running summary list.

setRunningSummaryList

public void setRunningSummaryList(List<RunningSummary> runningSummaryList)
Set the running summary list.

Parameters:
runningSummaryList - the running summary list

isHideOriginalData

public boolean isHideOriginalData()
Get the flag indicating if the original calculated data columns should be hidden if there is any running summary.

By default the flag is false. If you want to hide the original data, you could set it to false.

This flag will only be evaluated if the running summary list configuration is not null.

Returns:
true if the original calculated data columns should be hidden. Otherwise false.
See Also:
setRunningSummaryList(java.util.List)

setHideOriginalData

public void setHideOriginalData(boolean hideOriginalData)
Set the flag indicating if the original calculated data columns should be hidden if there is any running summary.

Parameters:
hideOriginalData - the flag
See Also:
isHideOriginalData()

clone

protected Object clone()
                throws CloneNotSupportedException
Overrides:
clone in class Object
Throws:
CloneNotSupportedException

setTitle

public void setTitle(String title)
Overrides:
setTitle in class Field

JIDE 3.5.15