[]
        
(Showing Draft Content)

LabelVisibility

Enum Class LabelVisibility

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

public enum LabelVisibility extends Enum<LabelVisibility>
Specifies the visibility of a cell label watermark.

Use this enum with IRange.getLabelOptions() and ILabelOptions.setVisibility(LabelVisibility) to control whether a watermark is shown in the padding area, the cell area, or automatically based on whether the cell has a value. Use visible to always show the watermark in the padding area, hidden to show it in the cell area based on the cell value, or auto to switch between the two behaviors automatically.


 IRange range = worksheet.getRange("A3");
 range.setWatermark("OTHER INFORMATION");
 range.setCellPadding(new CellPadding(20, 0, 0, 0));
 range.getLabelOptions().setVisibility(LabelVisibility.visible);
 range.getLabelOptions().setForeColor(Color.FromArgb(51, 51, 51));
 range.getLabelOptions().setMargin(new Margin(2, 0, 0, 0));
 range.getLabelOptions().getFont().setSize(7);
 LabelVisibility visibility = range.getLabelOptions().getVisibility();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Specifies that the watermark is shown in the padding area when the cell contains a value, and is shown in the cell area when the cell is empty.
    Specifies that the watermark is not shown in the padding area, and is shown in the cell area based on whether the cell has a value.
    Specifies that the watermark is always shown in the padding area and is not shown in the cell area, regardless of whether the cell has a value.
  • Method Summary

    Modifier and Type
    Method
    Description
    getLabelVisibility(int value)
    Gets the LabelVisibility constant that corresponds to the specified integer value.
    int
    Gets the integer value associated with this LabelVisibility constant.
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • visible

      public static final LabelVisibility visible
      Specifies that the watermark is always shown in the padding area and is not shown in the cell area, regardless of whether the cell has a value.
    • hidden

      public static final LabelVisibility hidden
      Specifies that the watermark is not shown in the padding area, and is shown in the cell area based on whether the cell has a value.
    • auto

      public static final LabelVisibility auto
      Specifies that the watermark is shown in the padding area when the cell contains a value, and is shown in the cell area when the cell is empty.
  • Method Details

    • values

      public static LabelVisibility[] 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 LabelVisibility 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 associated with this LabelVisibility constant.
      Returns:
      The integer value of this LabelVisibility constant.
    • getLabelVisibility

      public static LabelVisibility getLabelVisibility(int value)
      Gets the LabelVisibility constant that corresponds to the specified integer value.
      Parameters:
      value - The integer value to convert.
      Returns:
      The matching LabelVisibility constant, or null if no matching constant is found.