Class XSSFConditionalFormattingRule
- All Implemented Interfaces:
ConditionalFormattingRule
,DifferentialStyleProvider
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new border formatting structure if it does not exist, otherwise just return existing object.createDataBarFormatting
(XSSFColor color) Create a new font formatting structure if it does not exist, otherwise just return existing object.Create a new pattern formatting structure if it does not exist, otherwise just return existing object.byte
The comparison function used when the type of conditional formatting is set toConditionType.CELL_VALUE_IS
Will return null ifgetConditionType()
!=ConditionType.FILTER
Type of conditional formatting rule.This is null ifThe formula used to evaluate the first operand for the conditional formatting rule.The formula used to evaluate the second operand of the comparison when comparison type isConditionType.CELL_VALUE_IS
and operator is eitherComparisonOperator.BETWEEN
orComparisonOperator.NOT_BETWEEN
Return the number format from the dxf style record if present, null if notint
The priority of the rule, if defined, otherwise 0.boolean
Always true for HSSF rules, optional flag for XSSF rules.int
Conditional format rules don't define stripes, so always 0getText()
XSSF rules store textual condition values as an attribute and also as a formula that needs shifting.
-
Method Details
-
getPriority
public int getPriority()Description copied from interface:ConditionalFormattingRule
The priority of the rule, if defined, otherwise 0.If priority is 0, just use definition order, as that's how older HSSF rules are evaluated.
For XSSF, this should always be set. For HSSF, only newer style rules have this set, older ones will return 0.
If a rule is created but not yet added to a sheet, this value may not be valid.
- Specified by:
getPriority
in interfaceConditionalFormattingRule
- Returns:
- rule priority
-
getStopIfTrue
public boolean getStopIfTrue()Description copied from interface:ConditionalFormattingRule
Always true for HSSF rules, optional flag for XSSF rules. See Excel help for more.- Specified by:
getStopIfTrue
in interfaceConditionalFormattingRule
- Returns:
- true if conditional formatting rule processing stops when this one is true, false if not
- See Also:
-
createBorderFormatting
Create a new border formatting structure if it does not exist, otherwise just return existing object.- Specified by:
createBorderFormatting
in interfaceConditionalFormattingRule
- Returns:
- - border formatting object, never returns
null
.
-
getBorderFormatting
- Specified by:
getBorderFormatting
in interfaceConditionalFormattingRule
- Specified by:
getBorderFormatting
in interfaceDifferentialStyleProvider
- Returns:
- - border formatting object if defined,
null
otherwise
-
createFontFormatting
Create a new font formatting structure if it does not exist, otherwise just return existing object.- Specified by:
createFontFormatting
in interfaceConditionalFormattingRule
- Returns:
- - font formatting object, never returns
null
.
-
getFontFormatting
- Specified by:
getFontFormatting
in interfaceConditionalFormattingRule
- Specified by:
getFontFormatting
in interfaceDifferentialStyleProvider
- Returns:
- - font formatting object if defined,
null
otherwise
-
createPatternFormatting
Create a new pattern formatting structure if it does not exist, otherwise just return existing object.- Specified by:
createPatternFormatting
in interfaceConditionalFormattingRule
- Returns:
- - pattern formatting object, never returns
null
.
-
getPatternFormatting
- Specified by:
getPatternFormatting
in interfaceConditionalFormattingRule
- Specified by:
getPatternFormatting
in interfaceDifferentialStyleProvider
- Returns:
- - pattern formatting object if defined,
null
otherwise
-
createDataBarFormatting
- Parameters:
color
-- Returns:
- data bar formatting
-
getDataBarFormatting
- Specified by:
getDataBarFormatting
in interfaceConditionalFormattingRule
- Returns:
- - databar / data-bar formatting object if defined,
null
otherwise
-
createMultiStateFormatting
public XSSFIconMultiStateFormatting createMultiStateFormatting(IconMultiStateFormatting.IconSet iconSet) -
getMultiStateFormatting
- Specified by:
getMultiStateFormatting
in interfaceConditionalFormattingRule
- Returns:
- - icon / multi-state formatting object if defined,
null
otherwise
-
createColorScaleFormatting
-
getColorScaleFormatting
- Specified by:
getColorScaleFormatting
in interfaceConditionalFormattingRule
- Returns:
- color scale / color grate formatting object if defined,
null
otherwise
-
getNumberFormat
Return the number format from the dxf style record if present, null if not- Specified by:
getNumberFormat
in interfaceConditionalFormattingRule
- Specified by:
getNumberFormat
in interfaceDifferentialStyleProvider
- Returns:
- number format defined for this rule, or null if the cell default should be used
- See Also:
-
getConditionType
Type of conditional formatting rule.- Specified by:
getConditionType
in interfaceConditionalFormattingRule
- Returns:
- the type of condition
-
getConditionFilterType
Will return null ifgetConditionType()
!=ConditionType.FILTER
- Specified by:
getConditionFilterType
in interfaceConditionalFormattingRule
- Returns:
- filter type for filter rules, or null if not a filter rule.
- See Also:
-
getFilterConfiguration
Description copied from interface:ConditionalFormattingRule
This is null ifConditionalFormattingRule.getConditionFilterType()
== nullThis means it is always null for HSSF, which does not define the extended condition types.
This object contains the additional configuration information for XSSF filter conditions.
- Specified by:
getFilterConfiguration
in interfaceConditionalFormattingRule
- Returns:
- the Filter Configuration Data, or null if there isn't any
-
getComparisonOperation
public byte getComparisonOperation()The comparison function used when the type of conditional formatting is set toConditionType.CELL_VALUE_IS
MUST be a constant from
ComparisonOperator
- Specified by:
getComparisonOperation
in interfaceConditionalFormattingRule
- Returns:
- the conditional format operator
-
getFormula1
The formula used to evaluate the first operand for the conditional formatting rule.If the condition type is
ConditionType.CELL_VALUE_IS
, this field is the first operand of the comparison. If type isConditionType.FORMULA
, this formula is used to determine if the conditional formatting is applied.If comparison type is
ConditionType.FORMULA
the formula MUST be a Boolean function- Specified by:
getFormula1
in interfaceConditionalFormattingRule
- Returns:
- the first formula
-
getFormula2
The formula used to evaluate the second operand of the comparison when comparison type isConditionType.CELL_VALUE_IS
and operator is eitherComparisonOperator.BETWEEN
orComparisonOperator.NOT_BETWEEN
- Specified by:
getFormula2
in interfaceConditionalFormattingRule
- Returns:
- the second formula
-
getText
Description copied from interface:ConditionalFormattingRule
XSSF rules store textual condition values as an attribute and also as a formula that needs shifting. Using the attribute is simpler/faster. HSSF rules don't have this and return null. We can fall back on the formula for those (AFAIK).- Specified by:
getText
in interfaceConditionalFormattingRule
- Returns:
- condition text if it exists, or null
-
getStripeSize
public int getStripeSize()Conditional format rules don't define stripes, so always 0- Specified by:
getStripeSize
in interfaceDifferentialStyleProvider
- Returns:
- number of rows/columns in a stripe for stripe styles, 0 for all others
- See Also:
-