[]
        
(Showing Draft Content)

IIconCriterion

Interface IIconCriterion


public interface IIconCriterion
Represents the criterion for an individual icon in an icon set.

The criterion specifies the range of values and the threshold type associated with the icon in an icon set conditional formatting rule. Each IIconCriterion defines the threshold settings for one icon, including its icon, comparison operator, threshold type, threshold value, and position within the icon set.


 IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
 condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
 IIconCriterion criterion = condition.getIconCriteria().get(1);
 criterion.setType(ConditionValueTypes.Number);
 criterion.setValue(50);
 
  • Method Details

    • getIcon

      IconType getIcon()
      Gets the icon for a criterion in an icon set conditional formatting rule.

      Use this method to retrieve the icon currently assigned to a specific threshold in an icon set rule.

      
       IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
       condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
       IIconCriterion criterion = condition.getIconCriteria().get(1);
       IconType icon = criterion.getIcon();
       
      Returns:
      The IconType value assigned to the criterion.
    • setIcon

      void setIcon(IconType value)
      Sets the icon for a criterion in an icon set conditional formatting rule.

      Use this method to change the icon assigned to a specific threshold in an icon set rule.

      
       IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
       condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
       IIconCriterion criterion = condition.getIconCriteria().get(1);
       criterion.setIcon(IconType.RedCross);
       
      Parameters:
      value - The IconType value to assign to the criterion.
    • getIndex

      int getIndex()
      Gets a value that indicates which threshold the criteria represents.

      Use this property to identify the position of an icon criterion within an icon set conditional formatting rule.

      
       IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
       condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
       IIconCriterion criterion = condition.getIconCriteria().get(1);
       int index = criterion.getIndex();
       
      Returns:
      The zero-based index of this criterion in its parent IIconCriteria collection.
    • getOperator

      Returns one of the constants of the FormatConditionOperator enumeration, which specifies whether the threshold is "greater than" or "greater than or equal to" the threshold value.

      For an icon set conditional formatting rule, the returned value indicates how this criterion compares cell values against its threshold.

      
       IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
       condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
       IIconCriterion criterion = condition.getIconCriteria().get(1);
       criterion.setOperator(FormatConditionOperator.GreaterEqual);
       FormatConditionOperator operator = criterion.getOperator();
       
      Returns:
      The threshold comparison operator for this icon criterion. Typically FormatConditionOperator.Greater or FormatConditionOperator.GreaterEqual.
    • setOperator

      void setOperator(FormatConditionOperator value)
      Sets one of the constants of the FormatConditionOperator enumeration, which specifies whether the threshold is greater than or greater than or equal to the threshold value.

      For an icon set conditional formatting rule, this property can be set only to FormatConditionOperator.Greater or FormatConditionOperator.GreaterEqual.

      
       IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
       condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
       IIconCriterion criterion = condition.getIconCriteria().get(1);
       criterion.setOperator(FormatConditionOperator.GreaterEqual);
       
      Parameters:
      value - The comparison operator for the icon threshold. Use FormatConditionOperator.Greater or FormatConditionOperator.GreaterEqual.
    • getType

      Returns one of the constants of the ConditionValueTypes enumeration, which specifies how the threshold value for an icon set is determined.

      Use this method to inspect whether the criterion threshold is interpreted as a number, percent, percentile, formula, or another supported condition value type.

      
       IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
       condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
       IIconCriterion criterion = condition.getIconCriteria().get(1);
       criterion.setType(ConditionValueTypes.Percent);
       ConditionValueTypes type = criterion.getType();
       
      Returns:
      One of the constants of the ConditionValueTypes enumeration that indicates how the threshold value for the icon criterion is determined.
    • setType

      void setType(ConditionValueTypes value)
      Sets one of the constants of the ConditionValueTypes enumeration, which specifies how the threshold value for an icon set is determined.

      Use this method to control how the icon criterion interprets its threshold value, such as a fixed number, percentage, percentile, formula, or range-based minimum or maximum.

      
       worksheet.getRange("A1:A5").setValue(new Object[][] {{10}, {30}, {50}, {70}, {90}});
       IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
       condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
       IIconCriterion criterion = condition.getIconCriteria().get(1);
       criterion.setType(ConditionValueTypes.Percent);
       criterion.setValue(60);
       
      Parameters:
      value - The ConditionValueTypes constant that specifies how the threshold value for the icon criterion is determined.
    • getValue

      Object getValue()
      Gets the threshold value for an icon in a conditional format.

      The returned value corresponds to the threshold configured for this icon criterion, such as a number, percentage, percentile, or formula value, depending on the criterion type.

      
       IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
       condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
       IIconCriterion criterion = condition.getIconCriteria().get(1);
       criterion.setType(ConditionValueTypes.Percent);
       criterion.setValue(50);
       Object value = criterion.getValue();
       
      Returns:
      The threshold value for the icon criterion.
    • setValue

      void setValue(Object value)
      Sets the threshold value for an icon in a conditional format.

      The specified value becomes the threshold for this icon criterion, such as a number, percentage, percentile, or formula value, depending on the criterion type.

      
       IIconSetCondition condition = worksheet.getRange("A1:A5").getFormatConditions().addIconSetCondition();
       condition.setIconSet(workbook.getIconSets().get(IconSetType.Icon3Symbols));
       IIconCriterion criterion = condition.getIconCriteria().get(1);
       criterion.setType(ConditionValueTypes.Percent);
       criterion.setValue(50);
       
      Parameters:
      value - The threshold value for the icon criterion.