[]
        
(Showing Draft Content)

ColorDataIndex

Enum Class ColorDataIndex

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

public enum ColorDataIndex extends Enum<ColorDataIndex>
Represents special color index values available for color index properties of borders, fonts, or fills.

Use this enum to apply built-in color index meanings instead of a palette-based numeric index. For example, Automatic specifies automatic color, and None indicates that the target color is not set or has no color.


 IRange cell = worksheet.getRange("A1");
 cell.setValue("ColorDataIndex example");
 cell.getInterior().setPattern(Pattern.Solid);
 cell.getInterior().setPatternColorIndex(ColorDataIndex.Automatic.getValue());
 ColorDataIndex patternColorIndex =
         ColorDataIndex.forValue(cell.getInterior().getPatternColorIndex());
 
  • Enum Constant Details

    • None

      public static final ColorDataIndex None
      Specifies no fill.
    • Automatic

      public static final ColorDataIndex Automatic
      Specifies an automatic color.
  • Method Details

    • values

      public static ColorDataIndex[] 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 ColorDataIndex 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()
      Gets the integer value of the color data index.
      Returns:
      The integer value of the color data index.
    • forValue

      public static ColorDataIndex forValue(int value)
      Returns the color data index associated with the specified integer value.
      Parameters:
      value - The integer value of the color data index.
      Returns:
      The ColorDataIndex enum constant associated with the specified value.
      Throws:
      IllegalArgumentException - if value does not match a defined color data index.