Enum Class TableStyleType

java.lang.Object
java.lang.Enum<TableStyleType>
org.apache.poi.ss.usermodel.TableStyleType
All Implemented Interfaces:
Serializable, Comparable<TableStyleType>, Constable

public enum TableStyleType extends Enum<TableStyleType>
Ordered list of table style elements, for both data tables and pivot tables. Some elements only apply to pivot tables, but any style definition can omit any number, so having them in one list should not be a problem.

The order is the specification order of application, with later elements overriding previous ones, if style properties conflict.

Processing could iterate bottom-up if looking for specific properties, and stop when the first style is found defining a value for that property.

Enum names match the OOXML spec values exactly, so valueOf(String) will work.

Since:
3.17 beta 1
  • Enum Constant Details

  • Method Details

    • values

      public static TableStyleType[] 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 TableStyleType 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
    • appliesTo

      public CellRangeAddressBase appliesTo(Table table, Cell cell)
      A range is returned only for the part of the table matching this enum instance and containing the given cell. Null is returned for all other cases, such as:
      • Cell on a different sheet than the table
      • Cell outside the table
      • this Enum part is not included in the table (i.e. no header/totals row)
      • this Enum is for a table part not yet implemented in POI, such as pivot table elements
      The returned range can be used to determine how style options may or may not apply to this cell. For example, wholeTable borders only apply to the outer boundary of a table, while the rest of the styling, such as font and color, could apply to all the interior cells as well.
      Parameters:
      table - table to evaluate
      cell - to evaluate
      Returns:
      range in the table representing this class of cells, if it contains the given cell, or null if not applicable. Stripe style types return only the stripe range containing the given cell, or null.
    • appliesTo

      public CellRangeAddressBase appliesTo(Table table, CellReference cell)
      A range is returned only for the part of the table matching this enum instance and containing the given cell reference. Null is returned for all other cases, such as:
      • Cell on a different sheet than the table
      • Cell outside the table
      • this Enum part is not included in the table (i.e. no header/totals row)
      • this Enum is for a table part not yet implemented in POI, such as pivot table elements
      The returned range can be used to determine how style options may or may not apply to this cell. For example, wholeTable borders only apply to the outer boundary of a table, while the rest of the styling, such as font and color, could apply to all the interior cells as well.
      Parameters:
      table - table to evaluate
      cell - CellReference to evaluate
      Returns:
      range in the table representing this class of cells, if it contains the given cell, or null if not applicable. Stripe style types return only the stripe range containing the given cell, or null.
    • getRange

      public final CellRangeAddressBase getRange(Table table, Cell cell)
      Calls getRange(Table, CellReference). Use that instead for performance.
      Parameters:
      table -
      cell -
      Returns:
      default is unimplemented/null
      See Also:
    • getRange

      public CellRangeAddressBase getRange(Table table, CellReference cell)
      Parameters:
      table -
      cell -
      Returns:
      default is unimplemented/null