Class Styles


  • public class Styles
    extends java.lang.Object
    Provides styling utilities for JLine applications.

    This class contains methods and constants for working with terminal styles and colors. It supports various style formats including:

    • LS_COLORS format for file listings
    • Help text styling
    • Print styling
    • Syntax highlighting

    The class provides parsers for different style formats and resolvers to apply styles to text in the terminal.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  Styles.StyleCompiler  
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.util.List<java.lang.String> ANSI_STYLES  
      static java.lang.String NANORC_THEME  
    • Constructor Summary

      Constructors 
      Constructor Description
      Styles()  
    • Field Detail

      • ANSI_STYLES

        protected static final java.util.List<java.lang.String> ANSI_STYLES
    • Constructor Detail

      • Styles

        public Styles()
    • Method Detail

      • lsStyle

        public static StyleResolver lsStyle()
        Gets a StyleResolver for file listings using LS_COLORS format.

        This method creates a StyleResolver that applies styles to file listings based on the LS_COLORS environment variable or default styles if not set.

        Returns:
        a StyleResolver for file listings
      • helpStyle

        public static StyleResolver helpStyle()
        Gets a StyleResolver for help text using HELP_COLORS format.

        This method creates a StyleResolver that applies styles to help text based on the HELP_COLORS environment variable or default styles if not set.

        Returns:
        a StyleResolver for help text
      • prntStyle

        public static StyleResolver prntStyle()
        Gets a StyleResolver for print output using PRNT_COLORS format.

        This method creates a StyleResolver that applies styles to print output based on the PRNT_COLORS environment variable or default styles if not set.

        Returns:
        a StyleResolver for print output
      • isStylePattern

        public static boolean isStylePattern​(java.lang.String style)
      • style

        public static StyleResolver style​(java.lang.String name,
                                          java.lang.String defStyle)
      • style

        public static StyleResolver style​(java.lang.String style)