From: Josh Micich Date: Tue, 25 Mar 2008 06:18:33 +0000 (+0000) Subject: Added class javadoc. Patch 30311 from Dmtriy. X-Git-Tag: REL_3_0_3_BETA1~74 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=80b0f9f6b88d99541099ddce094074b4e57b4702;p=poi.git Added class javadoc. Patch 30311 from Dmtriy. git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@640711 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java b/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java index e5fbb1d300..db7b0cb7aa 100644 --- a/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java +++ b/src/java/org/apache/poi/hssf/usermodel/HSSFConditionalFormatting.java @@ -25,6 +25,51 @@ import org.apache.poi.hssf.record.aggregates.CFRecordsAggregate; import org.apache.poi.hssf.record.cf.CellRange; import org.apache.poi.hssf.util.Region; +/** + * HSSFConditionalFormatting class encapsulates all settings of Conditional Formatting. + * The class is not intended to be used explicitly except cases when there is a need + * to make a copy HSSFConditionalFormatting settings for some reason. + * + * For example: + *
+ * HSSFConditionalFormatting cf = sheet.getConditionalFormattingAt(index);
+ * newSheet.addConditionalFormatting(cf);
+ * 
+ * + * To create a new Conditional Formatting set use the following approach: + *
+ * // Create pattern with red background
+ * HSSFPatternFormatting patternFormatting = new HSSFPatternFormatting();
+ * patternFormatting.setFillBackgroundColor(HSSFColor.RED.index);
+ * 
+ * Region [] regions =
+ * {
+ *     // Define a region containing first column
+ *     new Region(1,(short)1,-1,(short)1)
+ * };
+ *     
+ * HSSFConditionalFormattingRule[] rules = 
+ * {
+ *     // Define a Conditional Formatting rule, which triggers formatting
+ *     // when cell's value is greater or equal than 100.0 and
+ *     // applies patternFormatting defined above.
+ *         
+ *     sheet.createConditionalFormattingRule(
+ *             HSSFConditionalFormattingRule.COMPARISON_OPERATOR_GE, 
+ *             "100.0", // 1st formula 
+ *             null,    // 2nd formula is not used for comparison operator GE
+ *             null,    // do not override Font Formatting
+ *             null,    // do not override Border Formatting
+ *             patternFormatting
+ *     )
+ * };
+ *     
+ * // Apply Conditional Formatting rules defined above to the regions  
+ * sheet.addConditionalFormatting(regions, rules);
+ * 
+ * + * @author Dmitriy Kumshayev + */ public class HSSFConditionalFormatting { HSSFSheet sheet;