Home  Products  Purchase  Downloads  Demos  Forums  Blogs  Ticket  Wiki  API  Corporate

com.aspose.cells
Class FormatConditions

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

public class FormatConditions
extends java.lang.Object

Represents conditional formatting. The FormatConditions can contain up to three conditional formats.


Method Summary
 int addArea(CellArea cellArea)
          Adds a conditional formatted cell range.
 int[] addFormatCondition(CellArea cellArea, int type, int operator, java.lang.String formula1, java.lang.String formula2)
          Adds a formatting condition and effected cell rang to the FormatConditions.
 int addFormatCondition(int type, int operator, java.lang.String formula1, java.lang.String formula2)
          Adds a formatting condition.
 void deleteFormatCondition(int index)
          Removes the formatting condition by index.
 FormatCondition getFormatCondition(int index)
          Gets the formatting conidition by index.
 int sizeOfConditionList()
          Gets size of formatting conditions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addFormatCondition

public int[] addFormatCondition(CellArea cellArea,
                                int type,
                                int operator,
                                java.lang.String formula1,
                                java.lang.String formula2)
Adds a formatting condition and effected cell rang to the FormatConditions. The FormatConditions can contain up to three conditional formats. References to the other sheets are not allowed in the formulas of conditional formatting.

Parameters:
cellArea - conditional formatted cell range.
type - type of conditional formatting.It could be one of the members of FormatConditionType.
operator - comparison operator.It could be one of the members of OperatorType.
formula1 - the value or expression associated with conditional formatting.
formula2 - the value or expression associated with conditional formatting.
Returns:
[0]:formatting condition object index;[1] effected cell rang index.
Throws:
ExcelException - if conditional formattings have bean removed from the sheet.
java.lang.IllegalArgumentException - if operator type is invalid.
java.lang.IllegalArgumentException - if type of conditional formatting is invalid.
java.lang.IllegalArgumentException - if number of formatting conditions is greater than 3.
See Also:
FormatCondition.setType(int), OperatorType

addArea

public int addArea(CellArea cellArea)
Adds a conditional formatted cell range.

Parameters:
cellArea - conditional formatted cell range.
Throws:
ExcelException - if conditional formattings have bean removed from the sheet.

addFormatCondition

public int addFormatCondition(int type,
                              int operator,
                              java.lang.String formula1,
                              java.lang.String formula2)
Adds a formatting condition.

Parameters:
type - type of conditinal formatting.
operator - comparison operator.
formula1 - the value or expression associated with conditinal formatting.
formula2 - the value or expression associated with conditinal formatting.
Throws:
ExcelException - if conditional formattings have bean removed from the sheet.
java.lang.IllegalArgumentException - if number of formatting conditions is greater than 3.
See Also:
addFormatCondition(CellArea, int, int, String, String)

getFormatCondition

public FormatCondition getFormatCondition(int index)
Gets the formatting conidition by index.

Parameters:
index - the index of the formatting conidition to return.
Throws:
ExcelException - if conditional formattings have bean removed from the sheet.
java.lang.IllegalArgumentException - if the index is out of range.

sizeOfConditionList

public int sizeOfConditionList()
Gets size of formatting conditions.

Returns:
size of formatting conditions.

deleteFormatCondition

public void deleteFormatCondition(int index)
Removes the formatting condition by index.

Parameters:
index - the index of the formatting condition to removed.
Throws:
ExcelException - if conditional formattings have bean removed from the sheet.
java.lang.IllegalArgumentException - if the index is out of range.