Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.poi.hssf.usermodel
Class HSSFSheetConditionalFormatting

    java.lang.Object
      org.apache.poi.hssf.usermodel.HSSFSheetConditionalFormatting

    public final class HSSFSheetConditionalFormatting

extends java.lang.Object

The 'Conditional Formatting' facet of `HSSFSheet`

Author:
  Dmitriy Kumshayev

Method Summary
`int` | `addConditionalFormatting(CellRangeAddress[] regions, HSSFConditionalFormattingRule rule1)`
`int` | `addConditionalFormatting(CellRangeAddress[] regions, HSSFConditionalFormattingRule[] cfRules)` Allows to add a new Conditional Formatting set to the sheet.
`int` | `addConditionalFormatting(CellRangeAddress[] regions, HSSFConditionalFormattingRule rule1, HSSFConditionalFormattingRule rule2)`
`int` | `addConditionalFormatting(HSSFConditionalFormatting cf)` Adds a copy of HSSFConditionalFormatting object to the sheet
`int` | `addConditionalFormatting(Region[] regions, HSSFConditionalFormattingRule[] cfRules)` Deprecated. use `CellRangeAddress` instead of `Region`
`HSSFConditionalFormattingRule` | `createConditionalFormattingRule(byte comparisonOperation, java.lang.String formula1, java.lang.String formula2)` A factory method allowing to create a conditional formatting rule with a cell comparison operator TODO - formulas containing cell references are currently not parsed properly
`HSSFConditionalFormattingRule` | `createConditionalFormattingRule(java.lang.String formula)` A factory method allowing to create a conditional formatting rule with a formula. The formatting rules are applied by Excel when the value of the formula not equal to 0. TODO - formulas containing cell references are currently not parsed properly
`HSSFConditionalFormatting` | `getConditionalFormattingAt(int index)` gets Conditional Formatting object at a particular index
`int` | `getNumConditionalFormattings()`
`void` | `removeConditionalFormatting(int index)` removes a Conditional Formatting object by index

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Method Detail

### createConditionalFormattingRule

    public HSSFConditionalFormattingRule createConditionalFormattingRule(byte comparisonOperation,
                                                                         java.lang.String formula1,
                                                                         java.lang.String formula2)

  A factory method allowing to create a conditional formatting rule with a cell comparison operator

  TODO - formulas containing cell references are currently not parsed properly

  Parameters:
    `comparisonOperation` - - a constant value from ``CFRuleRecord.ComparisonOperator``:

    - BETWEEN
    - NOT_BETWEEN
    - EQUAL
    - NOT_EQUAL
    - GT
    - LT
    - GE
    - LE
    `formula1` - - formula for the valued, compared with the cell
    `formula2` - - second formula (only used with `CFRuleRecord.ComparisonOperator.BETWEEN`) and `CFRuleRecord.ComparisonOperator.NOT_BETWEEN` operations)

### createConditionalFormattingRule

    public HSSFConditionalFormattingRule createConditionalFormattingRule(java.lang.String formula)

  A factory method allowing to create a conditional formatting rule with a formula.
  The formatting rules are applied by Excel when the value of the formula not equal to 0.

  TODO - formulas containing cell references are currently not parsed properly

  Parameters:
    `formula` - - formula for the valued, compared with the cell

### addConditionalFormatting

    public int addConditionalFormatting(HSSFConditionalFormatting cf)

  Adds a copy of HSSFConditionalFormatting object to the sheet

  This method could be used to copy HSSFConditionalFormatting object from one sheet to another. For example:

       HSSFConditionalFormatting cf = sheet.getConditionalFormattingAt(index);
       newSheet.addConditionalFormatting(cf);

  Parameters:
    `cf` - HSSFConditionalFormatting object
  Returns:
    index of the new Conditional Formatting object

### addConditionalFormatting

    public int addConditionalFormatting(Region[] regions,
                                        HSSFConditionalFormattingRule[] cfRules)

  Deprecated. use `CellRangeAddress` instead of `Region`

### addConditionalFormatting

    public int addConditionalFormatting(CellRangeAddress[] regions,
                                        HSSFConditionalFormattingRule[] cfRules)

  Allows to add a new Conditional Formatting set to the sheet.

  Parameters:
    `regions` - - list of rectangular regions to apply conditional formatting rules
    `cfRules` - - set of up to three conditional formatting rules
  Returns:
    index of the newly created Conditional Formatting object

### addConditionalFormatting

    public int addConditionalFormatting(CellRangeAddress[] regions,
                                        HSSFConditionalFormattingRule rule1)

### addConditionalFormatting

    public int addConditionalFormatting(CellRangeAddress[] regions,
                                        HSSFConditionalFormattingRule rule1,
                                        HSSFConditionalFormattingRule rule2)

### getConditionalFormattingAt

    public HSSFConditionalFormatting getConditionalFormattingAt(int index)

  gets Conditional Formatting object at a particular index

  Parameters:
    `index` - of the Conditional Formatting object to fetch
  Returns:
    Conditional Formatting object

### getNumConditionalFormattings

    public int getNumConditionalFormattings()

  Returns:
    number of Conditional Formatting objects of the sheet

### removeConditionalFormatting

    public void removeConditionalFormatting(int index)

  removes a Conditional Formatting object by index

  Parameters:
    `index` - of a Conditional Formatting object to remove

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2010 The Apache Software Foundation or its licensors, as applicable.