Enum CommandLine.Help.Ansi.Style

    • Method Detail

      • values

        public static CommandLine.Help.Ansi.Style[] 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 (CommandLine.Help.Ansi.Style c : CommandLine.Help.Ansi.Style.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CommandLine.Help.Ansi.Style 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
      • on

        public static java.lang.String on​(CommandLine.Help.Ansi.IStyle... styles)
        Returns the concatenated ANSI escape codes for turning all specified styles on.
        Parameters:
        styles - the styles to generate ANSI escape codes for
        Returns:
        the concatenated ANSI escape codes for turning all specified styles on
      • off

        public static java.lang.String off​(CommandLine.Help.Ansi.IStyle... styles)
        Returns the concatenated ANSI escape codes for turning all specified styles off.
        Parameters:
        styles - the styles to generate ANSI escape codes for
        Returns:
        the concatenated ANSI escape codes for turning all specified styles off
      • fg

        public static CommandLine.Help.Ansi.IStyle fg​(java.lang.String str)
        Parses the specified style markup and returns the associated style. The markup may be one of the Style enum value names, or it may be one of the Style enum value names when "fg_" is prepended, or it may be one of the indexed colors in the 256 color palette.
        Parameters:
        str - the case-insensitive style markup to convert, e.g. "blue" or "fg_blue", or "46" (indexed color) or "0;5;0" (RGB components of an indexed color)
        Returns:
        the IStyle for the specified converter
      • bg

        public static CommandLine.Help.Ansi.IStyle bg​(java.lang.String str)
        Parses the specified style markup and returns the associated style. The markup may be one of the Style enum value names, or it may be one of the Style enum value names when "bg_" is prepended, or it may be one of the indexed colors in the 256 color palette.
        Parameters:
        str - the case-insensitive style markup to convert, e.g. "blue" or "bg_blue", or "46" (indexed color) or "0;5;0" (RGB components of an indexed color)
        Returns:
        the IStyle for the specified converter
      • parse

        public static CommandLine.Help.Ansi.IStyle[] parse​(java.lang.String commaSeparatedCodes)
        Parses the specified comma-separated sequence of style descriptors and returns the associated styles. For each markup, strings starting with "bg(" are delegated to bg(String), others are delegated to bg(String).
        Parameters:
        commaSeparatedCodes - one or more descriptors, e.g. "bg(blue),underline,red"
        Returns:
        an array with all styles for the specified descriptors