Package org.apache.poi.hssf.record
Class CFRule12Record
- java.lang.Object
-
- org.apache.poi.hssf.record.RecordBase
-
- org.apache.poi.hssf.record.Record
-
- org.apache.poi.hssf.record.StandardRecord
-
- org.apache.poi.hssf.record.CFRuleBase
-
- org.apache.poi.hssf.record.CFRule12Record
-
- All Implemented Interfaces:
Duplicatable
,GenericRecord
,FutureRecord
public final class CFRule12Record extends CFRuleBase implements FutureRecord
Conditional Formatting v12 Rule Record (0x087A).This is for newer-style Excel conditional formattings, from Excel 2007 onwards.
CFRuleRecord
is used where the condition type isCFRuleBase.CONDITION_TYPE_CELL_VALUE_IS
orCFRuleBase.CONDITION_TYPE_FORMULA
, this is only used for the other types
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.poi.hssf.record.CFRuleBase
CFRuleBase.ComparisonOperator
-
-
Field Summary
Fields Modifier and Type Field Description static short
sid
-
Fields inherited from class org.apache.poi.hssf.record.CFRuleBase
_borderFormatting, _fontFormatting, _patternFormatting, CONDITION_TYPE_CELL_VALUE_IS, CONDITION_TYPE_COLOR_SCALE, CONDITION_TYPE_DATA_BAR, CONDITION_TYPE_FILTER, CONDITION_TYPE_FORMULA, CONDITION_TYPE_ICON_SET, formatting_not_used, formatting_options, LOG, TEMPLATE_ABOVE_AVERAGE, TEMPLATE_ABOVE_OR_EQUAL_TO_AVERAGE, TEMPLATE_BELOW_AVERAGE, TEMPLATE_BELOW_OR_EQUAL_TO_AVERAGE, TEMPLATE_CELL_VALUE, TEMPLATE_COLOR_SCALE_FORMATTING, TEMPLATE_CONTAINS_BLANKS, TEMPLATE_CONTAINS_ERRORS, TEMPLATE_CONTAINS_NO_BLANKS, TEMPLATE_CONTAINS_NO_ERRORS, TEMPLATE_CONTAINS_TEXT, TEMPLATE_DATA_BAR_FORMATTING, TEMPLATE_DUPLICATE_VALUES, TEMPLATE_FILTER, TEMPLATE_FORMULA, TEMPLATE_ICON_SET_FORMATTING, TEMPLATE_LAST_7_DAYS, TEMPLATE_LAST_MONTH, TEMPLATE_LAST_WEEK, TEMPLATE_NEXT_MONTH, TEMPLATE_NEXT_WEEK, TEMPLATE_THIS_MONTH, TEMPLATE_THIS_WEEK, TEMPLATE_TODAY, TEMPLATE_TOMORROW, TEMPLATE_UNIQUE_VALUES, TEMPLATE_YESTERDAY
-
-
Constructor Summary
Constructors Constructor Description CFRule12Record(CFRule12Record other)
CFRule12Record(RecordInputStream in)
-
Method Summary
-
Methods inherited from class org.apache.poi.hssf.record.CFRuleBase
containsAlignFormattingBlock, containsBorderFormattingBlock, containsFontFormattingBlock, containsPatternFormattingBlock, containsProtectionFormattingBlock, getBorderFormatting, getComparisonOperation, getConditionType, getFontFormatting, getFormattingBlockSize, getFormula1, getFormula2, getFormulaSize, getOptions, getParsedExpression1, getParsedExpression2, getPatternFormatting, isBottomBorderModified, isBottomLeftTopRightBorderModified, isLeftBorderModified, isPatternBackgroundColorModified, isPatternColorModified, isPatternStyleModified, isRightBorderModified, isTopBorderModified, isTopLeftBottomRightBorderModified, parseFormula, readFormatOptions, serializeFormattingBlock, setAlignFormattingUnchanged, setBorderFormatting, setBottomBorderModified, setBottomLeftTopRightBorderModified, setComparisonOperation, setConditionType, setFontFormatting, setFormula1, setFormula2, setLeftBorderModified, setParsedExpression1, setParsedExpression2, setPatternBackgroundColorModified, setPatternColorModified, setPatternFormatting, setPatternStyleModified, setProtectionFormattingUnchanged, setRightBorderModified, setTopBorderModified, setTopLeftBottomRightBorderModified
-
Methods inherited from class org.apache.poi.hssf.record.StandardRecord
getRecordSize, serialize
-
Methods inherited from class org.apache.poi.hssf.record.Record
cloneViaReserialise, serialize, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.poi.common.usermodel.GenericRecord
getGenericChildren
-
-
-
-
Field Detail
-
sid
public static final short sid
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CFRule12Record
public CFRule12Record(CFRule12Record other)
-
CFRule12Record
public CFRule12Record(RecordInputStream in)
-
-
Method Detail
-
create
public static CFRule12Record create(HSSFSheet sheet, String formulaText)
Creates a new comparison operation rule- Parameters:
sheet
- the sheetformulaText
- the first formula text- Returns:
- a new comparison operation rule
-
create
public static CFRule12Record create(HSSFSheet sheet, byte comparisonOperation, String formulaText1, String formulaText2)
Creates a new comparison operation rule- Parameters:
sheet
- the sheetcomparisonOperation
- the comparison operationformulaText1
- the first formula textformulaText2
- the second formula text- Returns:
- a new comparison operation rule
-
create
public static CFRule12Record create(HSSFSheet sheet, byte comparisonOperation, String formulaText1, String formulaText2, String formulaTextScale)
Creates a new comparison operation rule- Parameters:
sheet
- the sheetcomparisonOperation
- the comparison operationformulaText1
- the first formula textformulaText2
- the second formula textformulaTextScale
- the scale to apply for the comparison- Returns:
- a new comparison operation rule
-
create
public static CFRule12Record create(HSSFSheet sheet, ExtendedColor color)
Creates a new Data Bar formatting- Parameters:
sheet
- the sheetcolor
- the data bar color- Returns:
- a new Data Bar formatting
-
create
public static CFRule12Record create(HSSFSheet sheet, IconMultiStateFormatting.IconSet iconSet)
Creates a new Icon Set / Multi-State formatting- Parameters:
sheet
- the sheeticonSet
- the icon set- Returns:
- a new Icon Set / Multi-State formatting
-
createColorScale
public static CFRule12Record createColorScale(HSSFSheet sheet)
Creates a new Color Scale / Color Gradient formatting- Parameters:
sheet
- the sheet- Returns:
- a new Color Scale / Color Gradient formatting
-
containsDataBarBlock
public boolean containsDataBarBlock()
-
getDataBarFormatting
public DataBarFormatting getDataBarFormatting()
-
createDataBarFormatting
public DataBarFormatting createDataBarFormatting()
-
containsMultiStateBlock
public boolean containsMultiStateBlock()
-
getMultiStateFormatting
public IconMultiStateFormatting getMultiStateFormatting()
-
createMultiStateFormatting
public IconMultiStateFormatting createMultiStateFormatting()
-
containsColorGradientBlock
public boolean containsColorGradientBlock()
-
getColorGradientFormatting
public ColorGradientFormatting getColorGradientFormatting()
-
createColorGradientFormatting
public ColorGradientFormatting createColorGradientFormatting()
-
getParsedExpressionScale
public Ptg[] getParsedExpressionScale()
get the stack of the scale expression as a list- Returns:
- list of tokens (casts stack to a list and returns it!) this method can return null is we are unable to create Ptgs from existing excel file callers should check for null!
-
setParsedExpressionScale
public void setParsedExpressionScale(Ptg[] ptgs)
-
getPriority
public int getPriority()
-
setPriority
public void setPriority(int priority)
-
getSid
public short getSid()
Description copied from class:Record
return the non static version of the id for this record.
-
serialize
public void serialize(LittleEndianOutput out)
called by the class that is responsible for writing this sucker. Subclasses should implement this so that their data is passed back in a byte array.- Specified by:
serialize
in classStandardRecord
- Parameters:
out
- the stream to write to
-
getDataSize
protected int getDataSize()
- Specified by:
getDataSize
in classStandardRecord
-
copy
public CFRule12Record copy()
- Specified by:
copy
in interfaceDuplicatable
- Specified by:
copy
in classCFRuleBase
- Returns:
- a deep copy of the implementing class / instance
-
getFutureRecordType
public short getFutureRecordType()
- Specified by:
getFutureRecordType
in interfaceFutureRecord
-
getFutureHeader
public FtrHeader getFutureHeader()
- Specified by:
getFutureHeader
in interfaceFutureRecord
-
getAssociatedRange
public CellRangeAddress getAssociatedRange()
- Specified by:
getAssociatedRange
in interfaceFutureRecord
-
getGenericRecordType
public HSSFRecordTypes getGenericRecordType()
- Specified by:
getGenericRecordType
in interfaceGenericRecord
- Specified by:
getGenericRecordType
in classRecord
-
getGenericProperties
public Map<String,Supplier<?>> getGenericProperties()
- Specified by:
getGenericProperties
in interfaceGenericRecord
- Overrides:
getGenericProperties
in classCFRuleBase
-
-