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

EditorValueType

Enum Class EditorValueType

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

public enum EditorValueType extends Enum<EditorValueType>
指定当用户从支持多选的单元格类型中选择项时写入数据模型的内容。

使用此枚举可以控制存储所选项的显示文本、从零开始的索引或底层项值。此枚举通常与 ComboBoxCellType 一起使用。


 ComboBoxCellType cellType = new ComboBoxCellType();
 ComboBoxCellItem item1 = new ComboBoxCellItem();
 item1.setText("United States");
 item1.setValue("US");
 cellType.getItems().add(item1);
 ComboBoxCellItem item2 = new ComboBoxCellItem();
 item2.setText("China");
 item2.setValue("CN");
 cellType.getItems().add(item2);
 cellType.setEditorValueType(EditorValueType.Value);
 
 worksheet.getRange("A1").setCellType(cellType);
 worksheet.getRange("A1").setValue("CN");
 
  • Enum Constant Details

    • Text

      public static final EditorValueType Text
      将选定项的文本值写入模型。
    • Index

      public static final EditorValueType Index
      将选定项的索引写入模型。
    • Value

      public static final EditorValueType Value
      将所选项目的对应数据值写入模型。
  • Method Details

    • values

      public static EditorValueType[] 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 EditorValueType 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
    • getValue

      public int getValue()
    • forValue

      public static EditorValueType forValue(int value)