Class CFRuleBase

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    CFRule12Record, CFRuleRecord

    public abstract class CFRuleBase
    extends StandardRecord
    implements java.lang.Cloneable
    Conditional Formatting Rules. This can hold old-style rules

    This is for the older-style Excel conditional formattings, new-style (Excel 2007+) also make use of CFRule12Record for their rules.

    • Method Detail

      • getConditionType

        public byte getConditionType()
      • setComparisonOperation

        public void setComparisonOperation​(byte operation)
      • getComparisonOperation

        public byte getComparisonOperation()
      • containsFontFormattingBlock

        public boolean containsFontFormattingBlock()
      • setFontFormatting

        public void setFontFormatting​(FontFormatting fontFormatting)
      • containsAlignFormattingBlock

        public boolean containsAlignFormattingBlock()
      • setAlignFormattingUnchanged

        public void setAlignFormattingUnchanged()
      • containsBorderFormattingBlock

        public boolean containsBorderFormattingBlock()
      • setBorderFormatting

        public void setBorderFormatting​(BorderFormatting borderFormatting)
      • containsPatternFormattingBlock

        public boolean containsPatternFormattingBlock()
      • setPatternFormatting

        public void setPatternFormatting​(PatternFormatting patternFormatting)
      • containsProtectionFormattingBlock

        public boolean containsProtectionFormattingBlock()
      • setProtectionFormattingUnchanged

        public void setProtectionFormattingUnchanged()
      • getOptions

        public int getOptions()
        get the option flags
        Returns:
        bit mask
      • isLeftBorderModified

        public boolean isLeftBorderModified()
      • setLeftBorderModified

        public void setLeftBorderModified​(boolean modified)
      • isRightBorderModified

        public boolean isRightBorderModified()
      • setRightBorderModified

        public void setRightBorderModified​(boolean modified)
      • isTopBorderModified

        public boolean isTopBorderModified()
      • setTopBorderModified

        public void setTopBorderModified​(boolean modified)
      • isBottomBorderModified

        public boolean isBottomBorderModified()
      • setBottomBorderModified

        public void setBottomBorderModified​(boolean modified)
      • isTopLeftBottomRightBorderModified

        public boolean isTopLeftBottomRightBorderModified()
      • setTopLeftBottomRightBorderModified

        public void setTopLeftBottomRightBorderModified​(boolean modified)
      • isBottomLeftTopRightBorderModified

        public boolean isBottomLeftTopRightBorderModified()
      • setBottomLeftTopRightBorderModified

        public void setBottomLeftTopRightBorderModified​(boolean modified)
      • isPatternStyleModified

        public boolean isPatternStyleModified()
      • setPatternStyleModified

        public void setPatternStyleModified​(boolean modified)
      • isPatternColorModified

        public boolean isPatternColorModified()
      • setPatternColorModified

        public void setPatternColorModified​(boolean modified)
      • isPatternBackgroundColorModified

        public boolean isPatternBackgroundColorModified()
      • setPatternBackgroundColorModified

        public void setPatternBackgroundColorModified​(boolean modified)
      • getParsedExpression1

        public Ptg[] getParsedExpression1()
        get the stack of the 1st 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!
      • setParsedExpression1

        public void setParsedExpression1​(Ptg[] ptgs)
      • getParsedExpression2

        public Ptg[] getParsedExpression2()
        get the stack of the 2nd expression as a list
        Returns:
        array of Ptgs, possibly null
      • setParsedExpression2

        public void setParsedExpression2​(Ptg[] ptgs)
      • parseFormula

        public static Ptg[] parseFormula​(java.lang.String formula,
                                         HSSFSheet sheet)
        TODO - parse conditional format formulas properly i.e. produce tRefN and tAreaN instead of tRef and tArea this call will produce the wrong results if the formula contains any cell references One approach might be to apply the inverse of SharedFormulaRecord.convertSharedFormulas(Stack, int, int) Note - two extra parameters (rowIx & colIx) will be required. They probably come from one of the Region objects.
        Parameters:
        formula - The formula to parse, excluding the leading equals sign.
        sheet - The sheet that the formula is on.
        Returns:
        null if formula was null.