Class BasicStyles


  • public final class BasicStyles
    extends Object
    Factory class with the most important predefined styles
    Author:
    Raphael stoeckli
    • Constructor Detail

      • BasicStyles

        public BasicStyles()
    • Method Detail

      • Bold

        public static Style Bold()
        Gets the bold style
        Returns:
        Style object
      • Italic

        public static Style Italic()
        Gets the italic style
        Returns:
        Style object
      • BoldItalic

        public static Style BoldItalic()
        Gets the bold and italic style
        Returns:
        Style object
      • Underline

        public static Style Underline()
        Gets the underline style
        Returns:
        Style object
      • DoubleUnderline

        public static Style DoubleUnderline()
        Gets the double underline style
        Returns:
        Style object
      • Strike

        public static Style Strike()
        Gets the strike style
        Returns:
        Style object
      • DateFormat

        public static Style DateFormat()
        Gets the date format style
        Returns:
        Style object
      • TimeFormat

        public static Style TimeFormat()
        Gets the time format style
        Returns:
        Style object
      • RoundFormat

        public static Style RoundFormat()
        Gets the round format style
        Returns:
        Style object
      • BorderFrame

        public static Style BorderFrame()
        Gets the border frame style
        Returns:
        Style object
      • BorderFrameHeader

        public static Style BorderFrameHeader()
        Gets the border style for header cells
        Returns:
        Style object
      • DottedFill_0_125

        public static Style DottedFill_0_125()
        Gets the special pattern fill style (for compatibility)
        Returns:
        Style object
      • MergeCellStyle

        public static Style MergeCellStyle()
        Gets the style used when merging cells
        Returns:
        Style object
      • colorizedText

        public static Style colorizedText​(String rgb)
        Gets a style to colorize the text of a cell
        Parameters:
        rgb - RGB code in hex format (e.g. FF00AC). Alpha will be set to full opacity (FF)
        Returns:
        Style with Font color definition
      • colorizedBackground

        public static Style colorizedBackground​(String rgb)
        Gets a style to colorize the background of a cell
        Parameters:
        rgb - RGB code in hex format (e.g. FF00AC). Alpha will be set to full opacity (FF)
        Returns:
        Style with background color definition
      • font

        public static Style font​(String fontName)
        Gets a style with a user defined Font (Font size 11)
        Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error
        Parameters:
        fontName - Name of the Font
        Returns:
        Style with Font definition
      • font

        public static Style font​(String fontName,
                                 int fontSize)
        Gets a style with a user defined Font
        Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error
        Parameters:
        fontName - Name of the Font
        fontSize - Size of the Font in points
        Returns:
        Style with Font definition
      • font

        public static Style font​(String fontName,
                                 int fontSize,
                                 boolean isBold)
        Gets a style with a user defined Font
        Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error
        Parameters:
        fontName - Name of the Font
        fontSize - Size of the Font in points
        isBold - If true, the Font will be bold
        Returns:
        Style with Font definition
      • font

        public static Style font​(String fontName,
                                 int fontSize,
                                 boolean isBold,
                                 boolean isItalic)
        Gets a style with a user defined Font
        Note: The Font name as well as the availability of bold and italic on the Font cannot be validated by PicoXLSX4j. The generated file may be corrupt or rendered with a fall-back Font in case of an error
        Parameters:
        fontName - Name of the Font
        fontSize - Size of the Font in points
        isBold - If true, the Font will be bold
        isItalic - If true, the Font will be italic
        Returns:
        Style with Font definition