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
 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.
 int getOperator()
          Gets the conditional format operator.
 Style getStyle()
          Gets style of conditional formatted cell range.
 int getType()
          Gets whether the conditional format is based on a cell value or an expression.
 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 setStyle(Style style)
          Sets style of conditional formatted cell range.
 void setType(int type)
          Sets whether the conditional format is based on a cell value or an expression.If type is changed to FormatConditionType.EXPRESSION, operator type would become OperatorType.NONE and fomula2 would be set null automatically.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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:
ExcelException - 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.

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

getFormula2

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

Returns:
the value or expression associated with conditional formatting.
Throws:
ExcelException - 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:
ExcelException - 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:
ExcelException - 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:
ExcelException - 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:
ExcelException - 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:
ExcelException - if conditonal formattings hava been removed from the sheet.

getType

public int getType()
Gets whether the conditional format is based on a cell value or an expression.

Returns:
whether the conditional format is based on a cell value or an expression.
Throws:
ExcelException - if conditonal formattings hava been removed from the sheet.
See Also:
setType(int)

setType

public void setType(int type)
Sets whether the conditional format is based on a cell value or an expression.If type is changed to FormatConditionType.EXPRESSION, operator type would become OperatorType.NONE and fomula2 would be set null automatically.

Parameters:
type - whether the conditional format is based on a cell value or an expression.It could be one of the following values:
FormatConditionType.CELL_VALUE
FormatConditionType.EXPRESSION
Throws:
java.lang.IllegalArgumentException - if type of conditional formatting is invalid.
ExcelException - if conditonal formattings hava been removed from the sheet.