|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.poi.hssf.usermodel.HSSFSheetConditionalFormatting
public final class HSSFSheetConditionalFormatting
The 'Conditional Formatting' facet of HSSFSheet
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(CellRangeAddress[] regions,
HSSFConditionalFormattingRule rule1)
|
int |
addConditionalFormatting(CellRangeAddress[] regions,
HSSFConditionalFormattingRule[] cfRules)
Allows to add a new Conditional Formatting set to the sheet. |
int |
addConditionalFormatting(CellRangeAddress[] regions,
HSSFConditionalFormattingRule rule1,
HSSFConditionalFormattingRule rule2)
|
int |
addConditionalFormatting(ConditionalFormatting cf)
Adds a copy of a ConditionalFormatting object to the sheet |
int |
addConditionalFormatting(HSSFConditionalFormatting cf)
Adds a copy of HSSFConditionalFormatting object to the sheet |
int |
addConditionalFormatting(Region[] regions,
HSSFConditionalFormattingRule[] cfRules)
Deprecated. use CellRangeAddress instead of Region |
HSSFConditionalFormattingRule |
createConditionalFormattingColorScaleRule()
Create a Color Scale / Color Gradient conditional formatting rule. |
HSSFConditionalFormattingRule |
createConditionalFormattingRule(byte comparisonOperation,
java.lang.String formula1)
Create a conditional formatting rule that compares a cell value to a formula calculated result, using an operator * |
HSSFConditionalFormattingRule |
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 |
HSSFConditionalFormattingRule |
createConditionalFormattingRule(ExtendedColor color)
Create a Databar conditional formatting rule. |
HSSFConditionalFormattingRule |
createConditionalFormattingRule(HSSFExtendedColor color)
Create a Databar conditional formatting rule. |
HSSFConditionalFormattingRule |
createConditionalFormattingRule(IconMultiStateFormatting.IconSet iconSet)
A factory method allowing the creation of conditional formatting rules using an Icon Set / Multi-State formatting. |
HSSFConditionalFormattingRule |
createConditionalFormattingRule(java.lang.String formula)
A factory method allowing to create a conditional formatting rule with a formula. The formatting rules are applied by Excel when the value of the formula not equal to 0. TODO - formulas containing cell references are currently not parsed properly |
HSSFConditionalFormatting |
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 HSSFConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, java.lang.String formula1, java.lang.String formula2)
createConditionalFormattingRule
in interface SheetConditionalFormatting
comparisonOperation
- - a constant value from
CFRuleBase.ComparisonOperator
:
formula1
- - formula for the valued, compared with the cellformula2
- - second formula (only used with
CFRuleBase.ComparisonOperator.BETWEEN
) and
CFRuleBase.ComparisonOperator.NOT_BETWEEN
operations)public HSSFConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation, java.lang.String formula1)
SheetConditionalFormatting
The type of the created condition is ConditionType.CELL_VALUE_IS
createConditionalFormattingRule
in interface SheetConditionalFormatting
comparisonOperation
- MUST be a constant value from
ComparisonOperator
except BETWEEN and NOT_BETWEENformula1
- the formula to determine if the conditional formatting is appliedpublic HSSFConditionalFormattingRule createConditionalFormattingRule(java.lang.String formula)
createConditionalFormattingRule
in interface SheetConditionalFormatting
formula
- - formula for the valued, compared with the cellpublic HSSFConditionalFormattingRule createConditionalFormattingRule(IconMultiStateFormatting.IconSet iconSet)
HSSFConditionalFormattingRule.getMultiStateFormatting()
then
HSSFIconMultiStateFormatting.getThresholds()
createConditionalFormattingRule
in interface SheetConditionalFormatting
public HSSFConditionalFormattingRule createConditionalFormattingRule(HSSFExtendedColor color)
The thresholds and colour for it will be created, but will be
empty and require configuring with
HSSFConditionalFormattingRule.getDataBarFormatting()
then
HSSFDataBarFormatting.getMinThreshold()
and
HSSFDataBarFormatting.getMaxThreshold()
public HSSFConditionalFormattingRule createConditionalFormattingRule(ExtendedColor color)
SheetConditionalFormatting
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()
createConditionalFormattingRule
in interface SheetConditionalFormatting
public HSSFConditionalFormattingRule createConditionalFormattingColorScaleRule()
The thresholds and colours for it will be created, but will be
empty and require configuring with
HSSFConditionalFormattingRule.getColorScaleFormatting()
then
HSSFColorScaleFormatting.getThresholds()
and
HSSFColorScaleFormatting.getColors()
createConditionalFormattingColorScaleRule
in interface SheetConditionalFormatting
public int addConditionalFormatting(HSSFConditionalFormatting 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);
cf
- HSSFConditionalFormatting object
public int addConditionalFormatting(ConditionalFormatting cf)
SheetConditionalFormatting
This method could be used to copy ConditionalFormatting object from one sheet to another. For example:
ConditionalFormatting cf = sheet.getConditionalFormattingAt(index); newSheet.addConditionalFormatting(cf);
addConditionalFormatting
in interface SheetConditionalFormatting
cf
- the Conditional Formatting to clone
public int addConditionalFormatting(Region[] regions, HSSFConditionalFormattingRule[] cfRules)
public int addConditionalFormatting(CellRangeAddress[] regions, HSSFConditionalFormattingRule[] cfRules)
regions
- - list of rectangular regions to apply conditional formatting rulescfRules
- - set of up to three conditional formatting rules
public 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 conditional formatting rules (max 3 for Excel pre-2007)
public int addConditionalFormatting(CellRangeAddress[] regions, HSSFConditionalFormattingRule rule1)
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, HSSFConditionalFormattingRule rule1, HSSFConditionalFormattingRule rule2)
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 HSSFConditionalFormatting 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 |