|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.xssf.usermodel.XSSFSheetConditionalFormatting
public class XSSFSheetConditionalFormatting
Method Summary | |
---|---|
int |
addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule rule1)
Add a new Conditional Formatting to the sheet. |
int |
addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule[] cfRules)
Add a new Conditional Formatting set to the sheet. |
int |
addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule rule1,
ConditionalFormattingRule rule2)
Add a new Conditional Formatting consisting of two rules. |
int |
addConditionalFormatting(ConditionalFormatting cf)
Adds a copy of HSSFConditionalFormatting object to the sheet |
XSSFConditionalFormattingRule |
createConditionalFormattingRule(byte comparisonOperation,
java.lang.String formula)
Create a conditional formatting rule that compares a cell value to a formula calculated result, using an operator * |
XSSFConditionalFormattingRule |
createConditionalFormattingRule(byte comparisonOperation,
java.lang.String formula1,
java.lang.String formula2)
A factory method allowing to create a conditional formatting rule with a cell comparison operator TODO - formulas containing cell references are currently not parsed properly |
XSSFConditionalFormattingRule |
createConditionalFormattingRule(java.lang.String formula)
A factory method allowing to create a conditional formatting rule with a formula. |
XSSFConditionalFormatting |
getConditionalFormattingAt(int index)
gets Conditional Formatting object at a particular index |
int |
getNumConditionalFormattings()
|
void |
removeConditionalFormatting(int index)
removes a Conditional Formatting object by index |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public XSSFConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, java.lang.String formula1, java.lang.String formula2)
createConditionalFormattingRule
in interface SheetConditionalFormatting
comparisonOperation
- - a constant value from
CFRuleRecord.ComparisonOperator
:
formula1
- - formula for the valued, compared with the cellformula2
- - second formula (only used with
ComparisonOperator.BETWEEN
) and
ComparisonOperator.NOT_BETWEEN
operations)public XSSFConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, java.lang.String formula)
SheetConditionalFormatting
The type of the created condition is ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS
createConditionalFormattingRule
in interface SheetConditionalFormatting
comparisonOperation
- MUST be a constant value from
ComparisonOperator
except BETWEEN and NOT_BETWEENformula
- the formula to determine if the conditional formatting is appliedpublic XSSFConditionalFormattingRule createConditionalFormattingRule(java.lang.String formula)
createConditionalFormattingRule
in interface SheetConditionalFormatting
formula
- - formula for the valued, compared with the cellpublic int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule[] cfRules)
SheetConditionalFormatting
addConditionalFormatting
in interface SheetConditionalFormatting
regions
- - list of rectangular regions to apply conditional formatting rulescfRules
- - set of up to three conditional formatting rules
public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1)
SheetConditionalFormatting
addConditionalFormatting
in interface SheetConditionalFormatting
regions
- - list of rectangular regions to apply conditional formatting rulesrule1
- - the rule to apply
public int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1, ConditionalFormattingRule rule2)
SheetConditionalFormatting
addConditionalFormatting
in interface SheetConditionalFormatting
regions
- - list of rectangular regions to apply conditional formatting rulesrule1
- - the first rulerule2
- - the second rule
public int addConditionalFormatting(ConditionalFormatting cf)
This method could be used to copy HSSFConditionalFormatting object from one sheet to another. For example:
HSSFConditionalFormatting cf = sheet.getConditionalFormattingAt(index); newSheet.addConditionalFormatting(cf);
addConditionalFormatting
in interface SheetConditionalFormatting
cf
- HSSFConditionalFormatting object
public XSSFConditionalFormatting getConditionalFormattingAt(int index)
getConditionalFormattingAt
in interface SheetConditionalFormatting
index
- of the Conditional Formatting object to fetch
public int getNumConditionalFormattings()
getNumConditionalFormattings
in interface SheetConditionalFormatting
public void removeConditionalFormatting(int index)
removeConditionalFormatting
in interface SheetConditionalFormatting
index
- of a Conditional Formatting object to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |