Class DefaultPrompterConfig

  • All Implemented Interfaces:
    PrompterConfig

    public class DefaultPrompterConfig
    extends java.lang.Object
    implements PrompterConfig
    Default implementation of PrompterConfig interface.
    • Method Detail

      • defaults

        public static DefaultPrompterConfig defaults()
        Description copied from interface: PrompterConfig
        Create a configuration with platform-specific defaults.
        Returns:
        a configuration with platform defaults
      • windows

        public static DefaultPrompterConfig windows()
        Description copied from interface: PrompterConfig
        Create a configuration with Windows-specific defaults.
        Returns:
        a configuration with Windows defaults
      • unix

        public static DefaultPrompterConfig unix()
        Description copied from interface: PrompterConfig
        Create a configuration with Unix/Linux-specific defaults.
        Returns:
        a configuration with Unix defaults
      • custom

        public static DefaultPrompterConfig custom​(java.lang.String indicator,
                                                   java.lang.String uncheckedBox,
                                                   java.lang.String checkedBox,
                                                   java.lang.String unavailable)
        Create a configuration with default styling support.

        This method creates a configuration similar to UiConfig, with default color styling based on environment variables or built-in defaults. The style keys used are:

        • .cu - cursor/indicator style
        • .be - box element style (checked/unchecked boxes)
        • .bd - disabled/unavailable item style
        • .fo - footer/description style (dimmed)
        Parameters:
        indicator - the indicator character/string
        uncheckedBox - the unchecked box character/string
        checkedBox - the checked box character/string
        unavailable - the unavailable item character/string
        Returns:
        a configuration with default styling support
      • custom

        public static DefaultPrompterConfig custom​(java.lang.String indicator,
                                                   java.lang.String uncheckedBox,
                                                   java.lang.String checkedBox,
                                                   java.lang.String unavailable,
                                                   org.jline.utils.StyleResolver resolver,
                                                   boolean cancellableFirstPrompt)
        Description copied from interface: PrompterConfig
        Create a custom configuration with style resolver support.
        Parameters:
        indicator - the indicator character/string
        uncheckedBox - the unchecked box character/string
        checkedBox - the checked box character/string
        unavailable - the unavailable item character/string
        resolver - the style resolver for applying styles
        Returns:
        a custom configuration with styling support
      • cancellableFirstPrompt

        public boolean cancellableFirstPrompt()
        Description copied from interface: PrompterConfig
        Whether the first prompt can be cancelled.
        Specified by:
        cancellableFirstPrompt in interface PrompterConfig
        Returns:
        true if the first prompt can be cancelled
      • styleResolver

        public org.jline.utils.StyleResolver styleResolver()
        Description copied from interface: PrompterConfig
        Get the style resolver for this configuration.
        Specified by:
        styleResolver in interface PrompterConfig
        Returns:
        the style resolver, or null if not available
      • indicator

        public java.lang.String indicator()
        Description copied from interface: PrompterConfig
        Get the indicator character/string.
        Specified by:
        indicator in interface PrompterConfig
        Returns:
        the indicator
      • uncheckedBox

        public java.lang.String uncheckedBox()
        Description copied from interface: PrompterConfig
        Get the unchecked box character/string.
        Specified by:
        uncheckedBox in interface PrompterConfig
        Returns:
        the unchecked box
      • checkedBox

        public java.lang.String checkedBox()
        Description copied from interface: PrompterConfig
        Get the checked box character/string.
        Specified by:
        checkedBox in interface PrompterConfig
        Returns:
        the checked box
      • unavailable

        public java.lang.String unavailable()
        Description copied from interface: PrompterConfig
        Get the unavailable item character/string.
        Specified by:
        unavailable in interface PrompterConfig
        Returns:
        the unavailable item