org.apache.poi.hssf.record
Class CFRule12Record

java.lang.Object
  extended by org.apache.poi.hssf.record.RecordBase
      extended by org.apache.poi.hssf.record.Record
          extended by org.apache.poi.hssf.record.StandardRecord
              extended by org.apache.poi.hssf.record.CFRuleBase
                  extended by org.apache.poi.hssf.record.CFRule12Record
All Implemented Interfaces:
java.lang.Cloneable, FutureRecord

public final class CFRule12Record
extends CFRuleBase
implements FutureRecord, java.lang.Cloneable

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 is CFRuleBase.CONDITION_TYPE_CELL_VALUE_IS or CFRuleBase.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
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, logger, 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
CFRule12Record(RecordInputStream in)
           
 
Method Summary
 CFRule12Record clone()
           
 boolean containsColorGradientBlock()
           
 boolean containsDataBarBlock()
           
 boolean containsMultiStateBlock()
           
static CFRule12Record create(HSSFSheet sheet, byte comparisonOperation, java.lang.String formulaText1, java.lang.String formulaText2)
          Creates a new comparison operation rule
static CFRule12Record create(HSSFSheet sheet, byte comparisonOperation, java.lang.String formulaText1, java.lang.String formulaText2, java.lang.String formulaTextScale)
          Creates a new comparison operation rule
static CFRule12Record create(HSSFSheet sheet, ExtendedColor color)
          Creates a new Data Bar formatting
static CFRule12Record create(HSSFSheet sheet, IconMultiStateFormatting.IconSet iconSet)
          Creates a new Icon Set / Multi-State formatting
static CFRule12Record create(HSSFSheet sheet, java.lang.String formulaText)
          Creates a new comparison operation rule
 ColorGradientFormatting createColorGradientFormatting()
           
static CFRule12Record createColorScale(HSSFSheet sheet)
          Creates a new Color Scale / Color Gradient formatting
 DataBarFormatting createDataBarFormatting()
           
 IconMultiStateFormatting createMultiStateFormatting()
           
 CellRangeAddress getAssociatedRange()
           
 ColorGradientFormatting getColorGradientFormatting()
           
 DataBarFormatting getDataBarFormatting()
           
protected  int getDataSize()
           
 FtrHeader getFutureHeader()
           
 short getFutureRecordType()
           
 IconMultiStateFormatting getMultiStateFormatting()
           
 Ptg[] getParsedExpressionScale()
          get the stack of the scale expression as a list
 int getPriority()
           
 short getSid()
          return the non static version of the id for this record.
 void serialize(LittleEndianOutput out)
          called by the class that is responsible for writing this sucker.
 void setParsedExpressionScale(Ptg[] ptgs)
           
 void setPriority(int priority)
           
 java.lang.String toString()
          get a string representation of the record (for biffview/debugging)
 
Methods inherited from class org.apache.poi.hssf.record.CFRuleBase
containsAlignFormattingBlock, containsBorderFormattingBlock, containsFontFormattingBlock, containsPatternFormattingBlock, containsProtectionFormattingBlock, copyTo, 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
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sid

public static final short sid
See Also:
Constant Field Values
Constructor Detail

CFRule12Record

public CFRule12Record(RecordInputStream in)
Method Detail

create

public static CFRule12Record create(HSSFSheet sheet,
                                    java.lang.String formulaText)
Creates a new comparison operation rule

Parameters:
sheet - the sheet
formulaText - the first formula text
Returns:
a new comparison operation rule

create

public static CFRule12Record create(HSSFSheet sheet,
                                    byte comparisonOperation,
                                    java.lang.String formulaText1,
                                    java.lang.String formulaText2)
Creates a new comparison operation rule

Parameters:
sheet - the sheet
comparisonOperation - the comparison operation
formulaText1 - the first formula text
formulaText2 - the second formula text
Returns:
a new comparison operation rule

create

public static CFRule12Record create(HSSFSheet sheet,
                                    byte comparisonOperation,
                                    java.lang.String formulaText1,
                                    java.lang.String formulaText2,
                                    java.lang.String formulaTextScale)
Creates a new comparison operation rule

Parameters:
sheet - the sheet
comparisonOperation - the comparison operation
formulaText1 - the first formula text
formulaText2 - the second formula text
formulaTextScale - 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 sheet
color - 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 sheet
iconSet - 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.

Specified by:
getSid in class Record
Returns:
he 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 class StandardRecord
Parameters:
out - the stream to write to

getDataSize

protected int getDataSize()
Specified by:
getDataSize in class StandardRecord

toString

public java.lang.String toString()
Description copied from class: Record
get a string representation of the record (for biffview/debugging)

Overrides:
toString in class Record

clone

public CFRule12Record clone()
Specified by:
clone in class CFRuleBase

getFutureRecordType

public short getFutureRecordType()
Specified by:
getFutureRecordType in interface FutureRecord

getFutureHeader

public FtrHeader getFutureHeader()
Specified by:
getFutureHeader in interface FutureRecord

getAssociatedRange

public CellRangeAddress getAssociatedRange()
Specified by:
getAssociatedRange in interface FutureRecord