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

IconPosition

Enum Class IconPosition

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

public enum IconPosition extends Enum<IconPosition>
指定图标相对于单元格的位置。

将此枚举与 CellDecorationIcon 一起使用,可以控制单元格装饰图标显示在单元格左侧还是右侧、单元格文本任一侧,或者单元格边界之外。通过 IRange.setDecoration(ICellDecoration) 应用装饰时会使用此设置。


 worksheet.getRange("A1").setValue("Status");
 ICellDecorationIcon icon = new CellDecorationIcon(
     "data:image/svg+xml;base64,PHN2Zz4=",
     12, 12, IconPosition.LeftOfText);
 CellDecoration decoration = new CellDecoration(Arrays.asList(icon));
 worksheet.getRange("A1").setDecoration(decoration);
 
  • Enum Constant Details

    • Left

      public static final IconPosition Left
      表示图标在单元格左侧。
    • LeftOfText

      public static final IconPosition LeftOfText
      表示图标在单元格文本左侧。
    • RightOfText

      public static final IconPosition RightOfText
      表示图标在单元格文本右侧。
    • OutsideLeft

      public static final IconPosition OutsideLeft
      表示图标在单元格左侧外部。
    • OutsideRight

      public static final IconPosition OutsideRight
      表示图标在单元格右侧外部。
  • Method Details

    • values

      public static IconPosition[] 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 IconPosition 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 IconPosition forValue(int value)