Package org.apache.poi.xssf.usermodel
Class XSSFConditionalFormatting
- java.lang.Object
-
- org.apache.poi.xssf.usermodel.XSSFConditionalFormatting
-
- All Implemented Interfaces:
ConditionalFormatting
public class XSSFConditionalFormatting extends java.lang.Object implements ConditionalFormatting
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addRule(ConditionalFormattingRule cfRule)
Add a Conditional Formatting rule.CellRangeAddress[]
getFormattingRanges()
int
getNumberOfRules()
XSSFConditionalFormattingRule
getRule(int idx)
void
setFormattingRanges(CellRangeAddress[] ranges)
Sets the cell ranges the rule conditional formatting must be applied to.void
setRule(int idx, ConditionalFormattingRule cfRule)
Replaces an existing Conditional Formatting rule at position idx.java.lang.String
toString()
-
-
-
Method Detail
-
getFormattingRanges
public CellRangeAddress[] getFormattingRanges()
- Specified by:
getFormattingRanges
in interfaceConditionalFormatting
- Returns:
- array of
CellRangeAddress
s. Nevernull
-
setFormattingRanges
public void setFormattingRanges(CellRangeAddress[] ranges)
Description copied from interface:ConditionalFormatting
Sets the cell ranges the rule conditional formatting must be applied to.- Specified by:
setFormattingRanges
in interfaceConditionalFormatting
- Parameters:
ranges
- non-null array ofCellRangeAddress
s
-
setRule
public void setRule(int idx, ConditionalFormattingRule cfRule)
Replaces an existing Conditional Formatting rule at position idx. Excel allows to create up to 3 Conditional Formatting rules. This method can be useful to modify existing Conditional Formatting rules.- Specified by:
setRule
in interfaceConditionalFormatting
- Parameters:
idx
- position of the rule. Should be between 0 and 2.cfRule
- - Conditional Formatting rule
-
addRule
public void addRule(ConditionalFormattingRule cfRule)
Add a Conditional Formatting rule. Excel allows to create up to 3 Conditional Formatting rules.- Specified by:
addRule
in interfaceConditionalFormatting
- Parameters:
cfRule
- - Conditional Formatting rule
-
getRule
public XSSFConditionalFormattingRule getRule(int idx)
- Specified by:
getRule
in interfaceConditionalFormatting
- Returns:
- the Conditional Formatting rule at position idx.
-
getNumberOfRules
public int getNumberOfRules()
- Specified by:
getNumberOfRules
in interfaceConditionalFormatting
- Returns:
- number of Conditional Formatting rules.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-