com.extentech.ExtenXLS
Class ConditionalFormatHandle

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

public class ConditionalFormatHandle
extends Object
implements Handle

 ConditionalFormatHandle allows for manipulation of the ConditionalFormat cells in Excel
 
 Using the ConditionalFormatHandle, the affected range of ConditionalFormats can be modified, 
 along with the formatting applied to the cells when the condition is true.
 
 Each ConditionalFormatHandle represents a range of cells and can have a number
 of formatting rules and formats (ConditionalFormatRule) applied.
 
 The ConditionalFormatHandle affected range can either be a contiguous range, or a series of cells and ranges.
 
 Each ConditionalFormatRule contains one rule and corresponding format data.
 
 
 Many of these calls are very self-explanatory and can be found in the api.
 

Author:
john :: [ Oct 18, 2009 ] :: Copyright ©2006 Extentech Inc.

Method Summary
 void addCell(CellHandle cellHandle)
          Add a cell to this conditional format record
 boolean contains(CellHandle cellHandle)
          Determine if the conditional format contains/affects the cell handle passed in
 boolean contains(String celladdy)
          Determines if the ConditionalFormatHandle contains the cell address passed in
 ConditionalFormatRule evaluate(CellHandle refcell)
          evaluates the criteria for this Conditional Format
if the criteria involves a comparison i.e.
 String[] getAllAffectedRanges()
          Return a string representing all ranges that this conditional format handle can affect
 String getEncompassingRange()
          Return the range of data this ConditionalFormatHandle refers to as a string This location is the largest bounding rectangle that all cells utilized in this conditional format can be contained in.
 ConditionalFormatRule[] getRules()
          Get all the rules assocated with this conditional format record
 WorkSheetHandle getWorkSheetHandle()
          get the WorkSheetHandle for this ConditionalFormat ConditionalFormats are bound to a specific worksheet and cannot be applied to multiple worksheets
 String getXML()
          Return an xml representation of the ConditionalFormatHandle
 void setRange(String range)
          Set the range this ConditionalFormatHandle refers to.
 String toString()
          return a string representation of this Conditional Format This method is still incomplete as it only returns data for one rule, and only refers to one range
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

evaluate

public ConditionalFormatRule evaluate(CellHandle refcell)
evaluates the criteria for this Conditional Format
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 If there are multiple rules in the ConditionalFormat then the first rule that passes will be returned. If no valid rules pass then a null result is given

Parameters:
CellHandle - refcell - the cell to obtain a value from in order for evaluation to occur
Returns:
the ConditionalFormatRule that passes.
See Also:
Cf.evaluate(com.extentech.formats.XLS.formulas.Ptg)

getRules

public ConditionalFormatRule[] getRules()
Get all the rules assocated with this conditional format record

Returns:

getWorkSheetHandle

public WorkSheetHandle getWorkSheetHandle()
get the WorkSheetHandle for this ConditionalFormat ConditionalFormats are bound to a specific worksheet and cannot be applied to multiple worksheets

Returns:
the WorkSheetHandle for this ConditionalFormat

getEncompassingRange

public String getEncompassingRange()
Return the range of data this ConditionalFormatHandle refers to as a string This location is the largest bounding rectangle that all cells utilized in this conditional format can be contained in.

Returns:
Encompassing range in the format "A2:B12"

getAllAffectedRanges

public String[] getAllAffectedRanges()
Return a string representing all ranges that this conditional format handle can affect

Returns:
range in the format "A2:B3";

contains

public boolean contains(CellHandle cellHandle)
Determine if the conditional format contains/affects the cell handle passed in

Parameters:
cellHandle -
Returns:

setRange

public void setRange(String range)
Set the range this ConditionalFormatHandle refers to. Pass in a range string, sans worksheet. This range will overwrite all other ranges this ConditionalFormatHandle refers to. In order to handle multiple ranges, use the addRange(String range) method

Parameters:
range - = standard excel range without worksheet information ("A1" or "A1:A10")

contains

public boolean contains(String celladdy)
Determines if the ConditionalFormatHandle contains the cell address passed in

Parameters:
cellAddress - a cell address in the format "A1"
Returns:
if the ce

getXML

public String getXML()
Return an xml representation of the ConditionalFormatHandle

Returns:

toString

public String toString()
return a string representation of this Conditional Format This method is still incomplete as it only returns data for one rule, and only refers to one range

Overrides:
toString in class Object

addCell

public void addCell(CellHandle cellHandle)
Add a cell to this conditional format record

Parameters:
cellHandle -


Copyright © 2011 Extentech Inc. All Rights Reserved.