public interface SheetConditionalFormatting
| Modifier and Type | Method and Description |
|---|---|
int |
addConditionalFormatting(CellRangeAddress[] regions,
ConditionalFormattingRule rule)
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 a ConditionalFormatting object to the sheet
|
ConditionalFormattingRule |
createConditionalFormattingRule(byte comparisonOperation,
String formula)
Create a conditional formatting rule that compares a cell value
to a formula calculated result, using an operator *
|
ConditionalFormattingRule |
createConditionalFormattingRule(byte comparisonOperation,
String formula1,
String formula2)
A factory method allowing to create a conditional formatting rule
with a cell comparison operator
|
ConditionalFormattingRule |
createConditionalFormattingRule(String formula)
Create a conditional formatting rule based on a Boolean formula.
|
ConditionalFormatting |
getConditionalFormattingAt(int index)
Gets Conditional Formatting object at a particular index
|
int |
getNumConditionalFormattings() |
void |
removeConditionalFormatting(int index)
Removes a Conditional Formatting object by index
|
int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule)
regions - - list of rectangular regions to apply conditional formatting rulesrule - - the rule to applyint addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1, ConditionalFormattingRule rule2)
regions - - list of rectangular regions to apply conditional formatting rulesrule1 - - the first rulerule2 - - the second ruleint addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule[] cfRules)
regions - - list of rectangular regions to apply conditional formatting rulescfRules - - set of up to three conditional formatting rulesint addConditionalFormatting(ConditionalFormatting cf)
This method could be used to copy ConditionalFormatting object from one sheet to another. For example:
ConditionalFormatting cf = sheet.getConditionalFormattingAt(index); newSheet.addConditionalFormatting(cf);
cf - the Conditional Formatting to cloneConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, String formula1, String formula2)
The created conditional formatting rule compares a cell value
to a formula calculated result, using the specified operator.
The type of the created condition is ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS
comparisonOperation - - MUST be a constant value from
ComparisonOperator:
formula1 - - formula for the valued, compared with the cellformula2 - - second formula (only used with
ComparisonOperator.BETWEEN) and ComparisonOperator.NOT_BETWEEN operations)ConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, String formula)
The type of the created condition is ConditionalFormattingRule.CONDITION_TYPE_CELL_VALUE_IS
comparisonOperation - MUST be a constant value from
ComparisonOperator except BETWEEN and NOT_BETWEENformula - the formula to determine if the conditional formatting is appliedConditionalFormattingRule createConditionalFormattingRule(String formula)
The type of the created format condition is ConditionalFormattingRule.CONDITION_TYPE_FORMULA
formula - the formula to evaluate. MUST be a Boolean function.ConditionalFormatting getConditionalFormattingAt(int index)
index - 0-based index of the Conditional Formatting object to fetchnull if not foundIllegalArgumentException - if the index is outside of the allowable range (0 ... numberOfFormats-1)int getNumConditionalFormattings()
void removeConditionalFormatting(int index)
index - 0-based index of the Conditional Formatting object to removeIllegalArgumentException - if the index is outside of the allowable range (0 ... numberOfFormats-1)Copyright © 2020. All rights reserved.