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
(将 ConditionalFormatting 对象的副本添加到工作表)
|
ConditionalFormattingRule |
createConditionalFormattingColorScaleRule()
Create a Color Scale / Color Gradient conditional formatting rule.
(创建色标/颜色渐变条件格式规则。)
|
ConditionalFormattingRule |
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 *
(创建条件格式规则,将单元格值与公式计算结果进行比较,使用运算符 *)
|
ConditionalFormattingRule |
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
(允许使用单元格比较运算符创建条件格式规则的工厂方法)
|
ConditionalFormattingRule |
createConditionalFormattingRule(ExtendedColor color)
Create a Databar conditional formatting rule.
(创建数据栏条件格式规则。)
|
ConditionalFormattingRule |
createConditionalFormattingRule(IconMultiStateFormatting.IconSet iconSet)
Create an Icon Set / Multi-State conditional formatting rule.
(创建图标集/多状态条件格式规则。)
|
ConditionalFormattingRule |
createConditionalFormattingRule(java.lang.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 rules
(区域 - 应用条件格式规则的矩形区域列表)
rule
- - the rule to apply
(rule - - 要应用的规则)
int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule rule1, ConditionalFormattingRule rule2)
regions
- - list of rectangular regions to apply conditional formatting rules
(区域 - 应用条件格式规则的矩形区域列表)
rule1
- - the first rule
(rule1 - - 第一条规则)
rule2
- - the second rule
(rule2 - - 第二条规则)
int addConditionalFormatting(CellRangeAddress[] regions, ConditionalFormattingRule[] cfRules)
regions
- - list of rectangular regions to apply conditional formatting rules
(区域 - 应用条件格式规则的矩形区域列表)
cfRules
- - set of up to conditional formatting rules (max 3 for Excel pre-2007)
(cfRules - - 最多设置条件格式规则(Excel pre-2007 最多 3 个))
int 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);(将 ConditionalFormatting 对象的副本添加到工作表 此方法可用于将 ConditionalFormatting 对象从一个工作表复制到另一个工作表。例如:ConditionalFormatting cf = sheet.getConditionalFormattingAt(index); newSheet.addConditionalFormatting(cf);)
cf
- the Conditional Formatting to clone
(cf - 要克隆的条件格式)
ConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, java.lang.String formula1, java.lang.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 ConditionType.CELL_VALUE_IS
comparisonOperation
- - MUST be a constant value from
ComparisonOperator
:
formula1
- - formula for the valued, compared with the cell
(formula1 - - 值的公式,与单元格比较)
formula2
- - second formula (only used with
ComparisonOperator.BETWEEN
) and
ComparisonOperator.NOT_BETWEEN
operations)
(formula2 - - 第二个公式(仅与ComparisonOperator.BETWEEN 和ComparisonOperator.NOT_BETWEEN 操作一起使用))
ConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, java.lang.String formula)
The type of the created condition is ConditionType.CELL_VALUE_IS
comparisonOperation
- MUST be a constant value from
ComparisonOperator
except BETWEEN and NOT_BETWEEN
(compareOperation - 必须是来自 ComparisonOperator 的常量值,除了 BETWEEN 和 NOT_BETWEEN)
formula
- the formula to determine if the conditional formatting is applied
(公式 - 确定是否应用条件格式的公式)
ConditionalFormattingRule createConditionalFormattingRule(java.lang.String formula)
The type of the created format condition is ConditionType.FORMULA
formula
- the formula to evaluate. MUST be a Boolean function.
(公式 - 要评估的公式。必须是布尔函数。)
ConditionalFormattingRule createConditionalFormattingRule(ExtendedColor color)
The thresholds and colour for it will be created, but will be empty and require configuring with ConditionalFormattingRule.getDataBarFormatting()
then DataBarFormatting.getMinThreshold()
and DataBarFormatting.getMaxThreshold()
ConditionalFormattingRule createConditionalFormattingRule(IconMultiStateFormatting.IconSet iconSet)
The thresholds for it will be created, but will be empty and require configuring with ConditionalFormattingRule.getMultiStateFormatting()
then IconMultiStateFormatting.getThresholds()
ConditionalFormattingRule createConditionalFormattingColorScaleRule()
The thresholds and colours for it will be created, but will be empty and require configuring with ConditionalFormattingRule.getColorScaleFormatting()
then ColorScaleFormatting.getThresholds()
and ColorScaleFormatting.getColors()
ConditionalFormatting getConditionalFormattingAt(int index)
index
- 0-based index of the Conditional Formatting object to fetch
(index - 要获取的条件格式对象的从 0 开始的索引)
null
if not found
(条件格式对象或 null 如果未找到)
java.lang.IllegalArgumentException
- if the index is outside of the allowable range (0 ... numberOfFormats-1)
(java.lang.IllegalArgumentException - 如果索引超出允许范围 (0 ... numberOfFormats-1))
int getNumConditionalFormattings()
void removeConditionalFormatting(int index)
index
- 0-based index of the Conditional Formatting object to remove
(index - 要删除的条件格式对象的从 0 开始的索引)
java.lang.IllegalArgumentException
- if the index is outside of the allowable range (0 ... numberOfFormats-1)
(java.lang.IllegalArgumentException - 如果索引超出允许范围 (0 ... numberOfFormats-1))
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.