Enum TableStyleType

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<TableStyleType>

    public enum TableStyleType
    extends java.lang.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
    • Method Detail

      • values

        public static TableStyleType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TableStyleType c : TableStyleType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TableStyleType valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.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.