[]
        
首页
开发者学堂
文档
论坛
市场
生态机会
活动
立即试用
(Showing Draft Content)

FormatConditionType

Enum Class FormatConditionType

java.lang.Object
java.lang.Enum<FormatConditionType>
com.grapecity.documents.excel.FormatConditionType
All Implemented Interfaces:
Serializable, Comparable<FormatConditionType>, Constable

public enum FormatConditionType extends Enum<FormatConditionType>
指定条件格式规则的类型。

使用此枚举可以指示条件格式的计算或显示方式,例如单元格值规则、表达式规则、色阶、数据条、前 10 项规则、图标集或其他受支持的条件格式类型。


 worksheet.getRange("A1:A4").setValue(new Object[][] {
     {10},
     {20},
     {30},
     {40}
 });
 worksheet.getRange("A1:A4").getFormatConditions()
     .add(FormatConditionType.CellValue, FormatConditionOperator.Greater, "25", null);
 
  • Enum Constant Details

    • CellValue

      public static final FormatConditionType CellValue
      指定条件格式基于单元格值。

      将此值用于使用 FormatConditionOperator 将应用区域中每个单元格的值与一个或两个指定值比较的规则。

    • Expression

      public static final FormatConditionType Expression
      指定条件格式基于表达式。

      将此值用于计算公式表达式以确定是否应用条件格式的规则。

    • ColorScale

      public static final FormatConditionType ColorScale
      指定色阶条件格式规则。

      将此值用于向单元格应用颜色渐变的条件格式,以根据定义的阈值指示其值的相对差异。

    • Databar

      public static final FormatConditionType Databar
      指定数据条条件格式规则。

      将此值用于在每个单元格中显示条形的条件格式,以表示该单元格的值相对于应用区域中其他值的大小。

    • Top10

      public static final FormatConditionType Top10
      指定顶部或底部排名条件格式规则,包括 Top 10、Top 10%、Bottom 10 和 Bottom 10% 计算。
    • IconSets

      public static final FormatConditionType IconSets
      指定图标集条件格式规则。

      将此值用于根据单元格值和阈值条件显示图标的条件格式。

    • UniqueValues

      public static final FormatConditionType UniqueValues
      指定条件格式的唯一值条件。
    • TextString

      public static final FormatConditionType TextString
      指定条件格式的文本字符串条件。
    • BlanksCondition

      public static final FormatConditionType BlanksCondition
      指定应用于空白单元格的条件格式规则。
    • TimePeriod

      public static final FormatConditionType TimePeriod
      指定应用于日期值落在指定时间段内的单元格的条件格式规则。
    • AboveAverageCondition

      public static final FormatConditionType AboveAverageCondition
      指定高于平均值条件格式规则。

      将此值用于条件格式,将应用区域中的每个数值单元格与该区域的平均值比较,并对值高于平均值的单元格应用格式。

    • NoBlanksCondition

      public static final FormatConditionType NoBlanksCondition
      指定对非空白单元格应用格式的条件格式规则。
    • ErrorsCondition

      public static final FormatConditionType ErrorsCondition
      指定应用于包含错误的单元格的条件格式规则条件。
    • NoErrorsCondition

      public static final FormatConditionType NoErrorsCondition
      指定应用于不包含错误的单元格的条件格式条件。
  • Method Details

    • values

      public static FormatConditionType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static FormatConditionType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null