com.extentech.ExtenXLS
Class ConditionalFormatRule

java.lang.Object
  extended by com.extentech.ExtenXLS.ConditionalFormatRule
All Implemented Interfaces:
Handle

public class ConditionalFormatRule
extends Object
implements Handle

ConditionalFormatRule defines a single rule for manipulation of the ConditionalFormat cells in Excel Each ConditionalFormatRule contains one rule and corresponding format data.

Author:
John McMahon :: Aug 30, 2010 :: Copyright ©2011Extentech Inc.
See Also:
ConditionalFormatHandle, Handle

Field Summary
static byte CONDITION_BETWEEN
           
static byte CONDITION_EQUAL
           
static byte CONDITION_GREATER_OR_EQUAL
           
static byte CONDITION_GREATER_THAN
           
static byte CONDITION_LESS_OR_EQUAL
           
static byte CONDITION_LESS_THAN
           
static byte CONDITION_NOT_BETWEEN
           
static byte CONDITION_NOT_EQUAL
           
static byte ERROR_INFO
           
static byte ERROR_STOP
           
static byte ERROR_WARN
           
static String[] OPERATORS
           
static byte VALUE_ANY
           
static byte VALUE_DATE
           
static byte VALUE_DECIMAL
           
static byte VALUE_FORMULA
           
static byte VALUE_INTEGER
           
static byte VALUE_TEXT_LENGTH
           
static byte VALUE_TIME
           
static String[] VALUE_TYPE
           
static byte VALUE_USER_DEFINED_LIST
           
 
Method Summary
 boolean evaluate(CellHandle refcell)
          evaluates the criteria for this Conditional Format Rule
if the criteria involves a comparison i.e.
 Color[] getBorderColors()
          retrieves the border colors for the current Conditional Format
 int getBorderLineColorBottom()
          returns the bottom border line color for the current Conditional Format
 int getBorderLineColorLeft()
          returns the left border line color for the current Conditional Format
 int getBorderLineColorRight()
          returns the right border line color for the current Conditional Format
 int getBorderLineColorTop()
          returns the top border line color for the current Conditional Format
 int getBorderLineStylesBottom()
          returns the bottom border line style for the current Conditional Format
 int getBorderLineStylesLeft()
           
 int getBorderLineStylesRight()
           
 int getBorderLineStylesTop()
           
 int[] getBorderSizes()
           
 int[] getBorderStyles()
           
 int getConditionalFormatType()
           
static byte getConditionNumber(String conditionType)
          Get the byte representing the condition type string passed in.
 String getFirstCondition()
          Get the first condition of the ConditionalFormat as a string representation
 com.extentech.formats.XLS.Font getFont()
           
 int getFontColorIndex()
           
 int getFontEscapement()
           
 int getFontHeight()
           
 int getFontOptsCancellation()
           
 int getFontOptsPosture()
           
 int getFontUnderlineStyle()
           
 int getFontWeight()
           
 int getForegroundColor()
           
 String getFormatPattern()
           
 com.extentech.formats.XLS.Formula getFormula1()
           
 com.extentech.formats.XLS.Formula getFormula2()
           
 String getOperator()
          returns the operator for this Conditional Format Rule
e.g.
 int getPatternFillColor()
           
 int getPatternFillColorBack()
           
 int getPatternFillStyle()
           
 String getSecondCondition()
          Get the second condition of the ConditionalFormat as a string representation
 String getType()
          returns the type of this Conditional Format
e.g.
 byte getTypeOperator()
          Get the type operator of this ConditionalFormat as a byte.
static byte getValueNumber(String valueType)
          Get the byte representing the value type string passed in.
 void setBorderLineColorBottom(int borderLineColorBottom)
           
 void setBorderLineColorLeft(int borderLineColorLeft)
           
 void setBorderLineColorTop(int borderLineColorTop)
           
 void setBorderLineStylesBottom(int borderLineStylesBottom)
           
 void setBorderLineStylesLeft(int borderLineStylesLeft)
           
 void setBorderLineStylesRight(int borderLineStylesRight)
           
 void setBorderLineStylesTop(int borderLineStylesTop)
           
 void setFirstCondition(Object firstCond)
          Set the first condition of the ConditionalFormat This value must conform to the Value Type of this ConditionalFormat or unexpected results may occur.
 void setFontColorIndex(int fontColorIndex)
           
 void setFontEscapement(int fontEscapementFlag)
           
 void setFontHeight(int fontHeight)
           
 void setFontOptsCancellation(int fontOptsCancellation)
           
 void setFontOptsPosture(int fontOptsPosture)
           
 void setFontUnderlineStyle(int fontUnderlineStyle)
           
 void setFontWeight(int fontWeight)
           
 void setPatternFillColor(int patternFillColor)
           
 void setPatternFillColorBack(int patternFillColorBack)
           
 void setPatternFillStyle(int patternFillStyle)
           
 void setSecondCondition(Object secondCond)
          Set the second condition of the ConditionalFormat utilizing a string.
 void setTypeOperator(byte typOperator)
          set the type operator of this ConditionalFormat as a byte.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALUE_ANY

public static final byte VALUE_ANY
See Also:
Constant Field Values

VALUE_INTEGER

public static final byte VALUE_INTEGER
See Also:
Constant Field Values

VALUE_DECIMAL

public static final byte VALUE_DECIMAL
See Also:
Constant Field Values

VALUE_USER_DEFINED_LIST

public static final byte VALUE_USER_DEFINED_LIST
See Also:
Constant Field Values

VALUE_DATE

public static final byte VALUE_DATE
See Also:
Constant Field Values

VALUE_TIME

public static final byte VALUE_TIME
See Also:
Constant Field Values

VALUE_TEXT_LENGTH

public static final byte VALUE_TEXT_LENGTH
See Also:
Constant Field Values

VALUE_FORMULA

public static final byte VALUE_FORMULA
See Also:
Constant Field Values

ERROR_STOP

public static byte ERROR_STOP

ERROR_WARN

public static byte ERROR_WARN

ERROR_INFO

public static byte ERROR_INFO

CONDITION_BETWEEN

public static final byte CONDITION_BETWEEN
See Also:
Constant Field Values

CONDITION_NOT_BETWEEN

public static final byte CONDITION_NOT_BETWEEN
See Also:
Constant Field Values

CONDITION_EQUAL

public static final byte CONDITION_EQUAL
See Also:
Constant Field Values

CONDITION_NOT_EQUAL

public static final byte CONDITION_NOT_EQUAL
See Also:
Constant Field Values

CONDITION_GREATER_THAN

public static final byte CONDITION_GREATER_THAN
See Also:
Constant Field Values

CONDITION_LESS_THAN

public static final byte CONDITION_LESS_THAN
See Also:
Constant Field Values

CONDITION_GREATER_OR_EQUAL

public static final byte CONDITION_GREATER_OR_EQUAL
See Also:
Constant Field Values

CONDITION_LESS_OR_EQUAL

public static final byte CONDITION_LESS_OR_EQUAL
See Also:
Constant Field Values

OPERATORS

public static String[] OPERATORS

VALUE_TYPE

public static String[] VALUE_TYPE
Method Detail

getConditionNumber

public static byte getConditionNumber(String conditionType)
Get the byte representing the condition type string passed in. Options are' "between", "notBetween", "equal", "notEqual", "greaterThan", "lessThan", "greaterOrEqual", "lessOrEqual"

Returns:

getValueNumber

public static byte getValueNumber(String valueType)
Get the byte representing the value type string passed in. Options are' "any", "integer", "decimal", "userDefinedList", "date", "time", "textLength", "formula"

Returns:

evaluate

public boolean evaluate(CellHandle refcell)
evaluates the criteria for this Conditional Format Rule
if the criteria involves a comparison i.e. equals, less than, etc., it uses the value from the passed in referenced cell to compare with

Parameters:
Ptg - refcell - the Ptg location to obtain cell value from
Returns:
boolean true if evaluation of criteria passes
See Also:
Cf.evaluate(com.extentech.formats.XLS.formulas.Ptg)

getTypeOperator

public byte getTypeOperator()
Get the type operator of this ConditionalFormat as a byte. These bytes map to the CONDITION_* static values in ConditionalFormatHandle

Returns:

setTypeOperator

public void setTypeOperator(byte typOperator)
set the type operator of this ConditionalFormat as a byte. These bytes map to the CONDITION_* static values in ConditionalFormatHandle


getSecondCondition

public String getSecondCondition()
Get the second condition of the ConditionalFormat as a string representation

Returns:

setSecondCondition

public void setSecondCondition(Object secondCond)
Set the second condition of the ConditionalFormat utilizing a string. This value must conform to the Value Type of this ConditionalFormat or unexpected results may occur. For example, entering a string representation of a date here will not work if your ConditionalFormat is an integer... String passed in should be a vaild XLS formula. Does not need to include the "=" Types of conditions Integer values Decimal values User defined list Date Time Text length Formula Be sure that your ConditionalFormat type (getConditionalFormatType()) matches the type of data.


getBorderColors

public Color[] getBorderColors()
retrieves the border colors for the current Conditional Format

Returns:
java.awt.Color array of Color objects for each border side (Top, Left, Bottom, Right)
See Also:
Cf.getBorderColors()

getBorderLineColorBottom

public int getBorderLineColorBottom()
returns the bottom border line color for the current Conditional Format

Returns:
int bottom border line color constant
See Also:
Cf.getBorderLineColorBottom(), constants

getBorderLineColorLeft

public int getBorderLineColorLeft()
returns the left border line color for the current Conditional Format

Returns:
int left border line color constant
See Also:
Cf.getBorderLineColorLeft(), constants

getBorderLineColorRight

public int getBorderLineColorRight()
returns the right border line color for the current Conditional Format

Returns:
int right border line color constant
See Also:
Cf.getBorderLineColorRight(), constants

getBorderLineColorTop

public int getBorderLineColorTop()
returns the top border line color for the current Conditional Format

Returns:
int top border line color constant
See Also:
Cf.getBorderLineColorTop(), constants

getBorderLineStylesBottom

public int getBorderLineStylesBottom()
returns the bottom border line style for the current Conditional Format

Returns:
int bottom border line style constant
See Also:
Cf.getBorderLineStylesBottom(), line style constants

getBorderLineStylesLeft

public int getBorderLineStylesLeft()
Returns:
See Also:
Cf.getBorderLineStylesLeft()

getBorderLineStylesRight

public int getBorderLineStylesRight()
Returns:
See Also:
Cf.getBorderLineStylesRight()

getBorderLineStylesTop

public int getBorderLineStylesTop()
Returns:
See Also:
Cf.getBorderLineStylesTop()

getBorderSizes

public int[] getBorderSizes()
Returns:
See Also:
Cf.getBorderSizes()

getBorderStyles

public int[] getBorderStyles()
Returns:
See Also:
Cf.getBorderStyles()

getFont

public com.extentech.formats.XLS.Font getFont()
Returns:
See Also:
Cf.getFont()

getFontColorIndex

public int getFontColorIndex()
Returns:
See Also:
Cf.getFontColorIndex()

getFontEscapement

public int getFontEscapement()
Returns:
See Also:
Cf.getFontEscapement()

getFontHeight

public int getFontHeight()
Returns:
See Also:
Cf.getFontHeight()

getFontOptsCancellation

public int getFontOptsCancellation()
Returns:
See Also:
Cf.getFontOptsCancellation()

getFontOptsPosture

public int getFontOptsPosture()
Returns:
See Also:
Cf.getFontOptsPosture()

getFontUnderlineStyle

public int getFontUnderlineStyle()
Returns:
See Also:
Cf.getFontUnderlineStyle()

getFontWeight

public int getFontWeight()
Returns:
See Also:
Cf.getFontWeight()

getForegroundColor

public int getForegroundColor()
Returns:
See Also:
Cf.getForegroundColor()

getFormatPattern

public String getFormatPattern()
Returns:
See Also:
XLSRecord.getFormatPattern()

getFormula1

public com.extentech.formats.XLS.Formula getFormula1()
Returns:
See Also:
Cf.getFormula1()

getFormula2

public com.extentech.formats.XLS.Formula getFormula2()
Returns:
See Also:
Cf.getFormula2()

getOperator

public String getOperator()
returns the operator for this Conditional Format Rule
e.g. "bewteen", "greater than" ...

Returns:

getType

public String getType()
returns the type of this Conditional Format
e.g. "Cell value is" or "Formula value is"

Returns:
String Conditional Format Type

getPatternFillColor

public int getPatternFillColor()
Returns:
See Also:
Cf.getPatternFillColor()

getPatternFillColorBack

public int getPatternFillColorBack()
Returns:
See Also:
Cf.getPatternFillColorBack()

getPatternFillStyle

public int getPatternFillStyle()
Returns:
See Also:
Cf.getPatternFillStyle()

setBorderLineColorBottom

public void setBorderLineColorBottom(int borderLineColorBottom)
Parameters:
borderLineColorBottom -
See Also:
Cf.setBorderLineColorBottom(int)

setBorderLineColorLeft

public void setBorderLineColorLeft(int borderLineColorLeft)
Parameters:
borderLineColorLeft -
See Also:
Cf.setBorderLineColorLeft(int)

setBorderLineColorTop

public void setBorderLineColorTop(int borderLineColorTop)
Parameters:
borderLineColorTop -
See Also:
Cf.setBorderLineColorTop(int)

setBorderLineStylesBottom

public void setBorderLineStylesBottom(int borderLineStylesBottom)
Parameters:
borderLineStylesBottom -
See Also:
Cf.setBorderLineStylesBottom(int)

setBorderLineStylesLeft

public void setBorderLineStylesLeft(int borderLineStylesLeft)
Parameters:
borderLineStylesLeft -
See Also:
Cf.setBorderLineStylesLeft(int)

setBorderLineStylesRight

public void setBorderLineStylesRight(int borderLineStylesRight)
Parameters:
borderLineStylesRight -
See Also:
Cf.setBorderLineStylesRight(int)

setBorderLineStylesTop

public void setBorderLineStylesTop(int borderLineStylesTop)
Parameters:
borderLineStylesTop -
See Also:
Cf.setBorderLineStylesTop(int)

setFontColorIndex

public void setFontColorIndex(int fontColorIndex)
Parameters:
fontColorIndex -
See Also:
Cf.setFontColorIndex(int)

setFontEscapement

public void setFontEscapement(int fontEscapementFlag)
Parameters:
fontEscapementFlag -
See Also:
Cf.setFontEscapement(int)

setFontHeight

public void setFontHeight(int fontHeight)
Parameters:
fontHeight -
See Also:
Cf.setFontHeight(int)

setFontOptsCancellation

public void setFontOptsCancellation(int fontOptsCancellation)
Parameters:
fontOptsCancellation -
See Also:
com.extentech.formats.XLS.Cf#setFontOptsCancellation(int)

setFontOptsPosture

public void setFontOptsPosture(int fontOptsPosture)
Parameters:
fontOptsPosture -
See Also:
Cf.setFontOptsPosture(int)

setFontUnderlineStyle

public void setFontUnderlineStyle(int fontUnderlineStyle)
Parameters:
fontUnderlineStyle -
See Also:
Cf.setFontUnderlineStyle(int)

setFontWeight

public void setFontWeight(int fontWeight)
Parameters:
fontWeight -
See Also:
Cf.setFontWeight(int)

setPatternFillColor

public void setPatternFillColor(int patternFillColor)
Parameters:
patternFillColor -
See Also:
Cf.setPatternFillColor(int)

setPatternFillColorBack

public void setPatternFillColorBack(int patternFillColorBack)
Parameters:
patternFillColorBack -
See Also:
Cf.setPatternFillColorBack(int)

setPatternFillStyle

public void setPatternFillStyle(int patternFillStyle)
Parameters:
patternFillStyle -
See Also:
Cf.setPatternFillStyle(int)

getFirstCondition

public String getFirstCondition()
Get the first condition of the ConditionalFormat as a string representation

Returns:

setFirstCondition

public void setFirstCondition(Object firstCond)
Set the first condition of the ConditionalFormat This value must conform to the Value Type of this ConditionalFormat or unexpected results may occur. For example, entering a string representation of a date here will not work if your ConditionalFormat is an integer... A java.util.Date object can also be passed in. This value will be translated into an integer as excel stores dates. If you need to manipulate/retrieve this value later utilize the DateConverter tool to transform the value String passed in should be a vaild XLS formula. Does not need to include the "=" Types of conditions Integer values Decimal values User defined list Date Time Text length Formula Be sure that your ConditionalFormat type (getConditionalFormatType()) matches the type of data.

Parameters:
firstCond - = the first condition for the ConditionalFormat

getConditionalFormatType

public int getConditionalFormatType()


Copyright © 2011 Extentech Inc. All Rights Reserved.