Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate


com.aspose.cells
Class FormatCondition

java.lang.Object
  extended by com.aspose.cells.FormatCondition

public class FormatCondition
extends java.lang.Object

Represents conditional formatting condition.


Method Summary
 AboveAverage getAboveAverage()
          Gets the conditional formatting's "AboveAverage" instance.
 ColorScale getColorScale()
          Gets the conditional formatting's "ColorScale" instance.
 DataBar getDataBar()
          Gets the conditional formatting's "DataBar" instance.
 java.lang.String getFormula1()
          Gets the value or expression associated with conditional formatting.
 java.lang.String getFormula2()
          Gets the value or expression associated with conditional formatting.
 IconSet getIconSet()
          Gets the conditional formatting's "IconSet" instance.
 int getOperator()
          Gets the conditional format operator.
 int getPriority()
          Gets the priority of this conditional formatting rule.
 Style getStyle()
          Gets style of conditional formatted cell range.
 java.lang.String getText()
          Gets the text value in a "text contains" conditional formatting rule.
 byte getTimePeriodType()
          Gets the applicable time period in a "date occurring" conditional formatting rule.
 Top10 getTop10()
          Gets the conditional formatting's "Top10" instance.
 int getType()
          Gets the conditional format's type.
 boolean isStopIfTrue()
          Checks the "Stop If True" flag.
 void setFormula1(java.lang.String formula1)
          Sets the value or expression associated with conditional formatting.
 void setFormula2(java.lang.String formula2)
          Gets the value or expression associated with conditional formatting.
 void setOperator(int operator)
          Sets the conditional format operator.
 void setStopIfTrue(boolean flag)
          Sets the "Stop If True" flag.
 void setStyle(Style style)
          Sets style of conditional formatted cell range.
 void setText(java.lang.String text)
          Sets the text value in a "text contains" conditional formatting rule.
 void setTimePeriodType(byte type)
          Sets the applicable time period in a "date occurringâ€? conditional formatting rule.
 void setType(int type)
          Sets the conditional format's type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFormula1

public java.lang.String getFormula1()
Gets the value or expression associated with conditional formatting.

Returns:
the value or expression associated with conditional formatting.
Throws:
CellsException - if conditonal formattings hava been removed from the sheet.

setFormula1

public void setFormula1(java.lang.String formula1)
Sets the value or expression associated with conditional formatting. If Cell reference in formula is relative, the base Cell is the top-left corner of the first range in the effected ranges list(FormatConditions.getCellArea(0)).

Parameters:
formula1 - the value or expression associated with conditional formatting.
Throws:
CellsException - if conditonal formattings hava been removed from the sheet.

getFormula2

public java.lang.String getFormula2()
Gets the value or expression associated with conditional formatting. If Cell reference in formula is relative, the base Cell is the top-left corner of the first range in the effected ranges list(FormatConditions.getCellArea(0)).

Returns:
the value or expression associated with conditional formatting.
Throws:
CellsException - if conditonal formattings hava been removed from the sheet.

setFormula2

public void setFormula2(java.lang.String formula2)
Gets the value or expression associated with conditional formatting.

Parameters:
formula2 - the value or expression associated with conditional formatting.
Throws:
CellsException - if conditonal formattings hava been removed from the sheet.

getOperator

public int getOperator()
Gets the conditional format operator.

Returns:
the conditional format comparison operator.
Throws:
CellsException - if conditonal formattings hava been removed from the sheet.
See Also:
OperatorType

setOperator

public void setOperator(int operator)
Sets the conditional format operator.

Parameters:
operator - the conditional format comparison operator type.It could be one of the members of OperatorType.
Throws:
CellsException - if conditonal formattings hava been removed from the sheet.
java.lang.IllegalArgumentException - if operator type is invalid.
See Also:
OperatorType

getStyle

public Style getStyle()
Gets style of conditional formatted cell range.

Returns:
style of conditional formatted cell range.
Throws:
CellsException - if conditonal formattings hava been removed from the sheet.

setStyle

public void setStyle(Style style)
Sets style of conditional formatted cell range.

Parameters:
style - style of conditional formatted cell range.
Throws:
CellsException - if conditonal formattings hava been removed from the sheet.

getType

public int getType()
Gets the conditional format's type.

Returns:
type of the conditional format.
Throws:
CellsException - if conditonal formattings hava been removed from the sheet.
See Also:
setType(int)

setType

public void setType(int type)
Sets the conditional format's type. If type is changed from FormatConditionType.CELL_VALUE to FormatConditionType.EXPRESSION, operator type would become OperatorType.NONE and fomula2 would be set to null automatically.

Parameters:
type - It could be one of the following values:
FormatConditionType.CELL_VALUE
FormatConditionType.EXPRESSION
FormatConditionType.COLOR_SCALE
FormatConditionType.DATA_BAR
FormatConditionType.ICON_SET
FormatConditionType.TOP_10
FormatConditionType.UNIQUE_VALUES
FormatConditionType.DUPLICATE_VALUES
FormatConditionType.CONTAINS_TEXT
FormatConditionType.NOT_CONTAINS_TEXT
FormatConditionType.BEGINS_WITH
FormatConditionType.ENDS_WITH
FormatConditionType.CONTAINS_BLANKS
FormatConditionType.NOT_CONTAINS_BLANKS
FormatConditionType.CONTAINS_ERRORS
FormatConditionType.NOT_CONTAINS_ERRORS
FormatConditionType.TIME_PERIOD
FormatConditionType.ABOVE_AVERAGE
Throws:
java.lang.IllegalArgumentException - if type of conditional formatting is invalid.
CellsException - if conditonal formattings hava been removed from the sheet.

getIconSet

public IconSet getIconSet()
Gets the conditional formatting's "IconSet" instance. The default instance's IconSetType is TrafficLights31. Valid only for type = IconSet.


getDataBar

public DataBar getDataBar()
Gets the conditional formatting's "DataBar" instance. The default instance's color is blue. Valid only for type = DataBar.


getColorScale

public ColorScale getColorScale()
Gets the conditional formatting's "ColorScale" instance. The default instance is a "green-yellow-red" 3ColorScale. Valid only for type = ColorScale.


getTop10

public Top10 getTop10()
Gets the conditional formatting's "Top10" instance. The default instance's rule highlights cells whose values fall in the top 10 bracket. Valid only for type = Top10.


getAboveAverage

public AboveAverage getAboveAverage()
Gets the conditional formatting's "AboveAverage" instance. The default instance's rule highlights cells that are above the average for all values in the range. Valid only for type = AboveAverage.


getText

public java.lang.String getText()
Gets the text value in a "text contains" conditional formatting rule. Valid only for type = containsText, notContainsText, beginsWith and endsWith. The default value is null.

Returns:
text the text value in a "text contains" conditional formatting rule.

setText

public void setText(java.lang.String text)
Sets the text value in a "text contains" conditional formatting rule. Valid only for type = containsText, notContainsText, beginsWith and endsWith. The default value is null.

Parameters:
text -

getTimePeriodType

public byte getTimePeriodType()
Gets the applicable time period in a "date occurring" conditional formatting rule. Valid only for type = timePeriod. The default value is TimePeriodType.Today.


setTimePeriodType

public void setTimePeriodType(byte type)
Sets the applicable time period in a "date occurring� conditional formatting rule. Valid only for type = timePeriod. The default value is TimePeriodType.TODAY.

Parameters:
type - time period type
See Also:
TimePeriodType

isStopIfTrue

public boolean isStopIfTrue()
Checks the "Stop If True" flag. When this flag is true and this rule is true, no rules with lower priority may be applied over this rule.

Returns:
"Stop If True" flag for this condition.

setStopIfTrue

public void setStopIfTrue(boolean flag)
Sets the "Stop If True" flag. When this flag is true and this rule is true, no rules with lower priority may be applied over this rule.

Parameters:
flag - "Stop If True" flag.

getPriority

public int getPriority()
Gets the priority of this conditional formatting rule. This value is used to determine which format should be evaluated and rendered. Lower numeric values are higher priority than higher numeric values, where '1' is the highest priority.

Returns:
the priority of this conditional formatting rule.