- java.lang.Object
-
- org.jline.prompt.impl.DefaultPrompterConfig
-
- All Implemented Interfaces:
PrompterConfig
public class DefaultPrompterConfig extends java.lang.Object implements PrompterConfig
Default implementation of PrompterConfig interface.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancancellableFirstPrompt()Whether the first prompt can be cancelled.java.lang.StringcheckedBox()Get the checked box character/string.static DefaultPrompterConfigcustom(java.lang.String indicator, java.lang.String uncheckedBox, java.lang.String checkedBox, java.lang.String unavailable)Create a configuration with default styling support.static DefaultPrompterConfigcustom(java.lang.String indicator, java.lang.String uncheckedBox, java.lang.String checkedBox, java.lang.String unavailable, org.jline.utils.StyleResolver resolver, boolean cancellableFirstPrompt)Create a custom configuration with style resolver support.static DefaultPrompterConfigcustom(org.jline.utils.StyleResolver styleResolver)static DefaultPrompterConfigdefaults()Create a configuration with platform-specific defaults.java.lang.Stringindicator()Get the indicator character/string.org.jline.utils.StyleResolverstyleResolver()Get the style resolver for this configuration.java.lang.Stringunavailable()Get the unavailable item character/string.java.lang.StringuncheckedBox()Get the unchecked box character/string.static DefaultPrompterConfigunix()Create a configuration with Unix/Linux-specific defaults.static DefaultPrompterConfigunix(org.jline.utils.StyleResolver styleResolver)static DefaultPrompterConfigwindows()Create a configuration with Windows-specific defaults.static DefaultPrompterConfigwindows(org.jline.utils.StyleResolver styleResolver)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jline.prompt.PrompterConfig
footerMaxRows, style, withCancellableFirstPrompt
-
-
-
-
Method Detail
-
defaults
public static DefaultPrompterConfig defaults()
Description copied from interface:PrompterConfigCreate a configuration with platform-specific defaults.- Returns:
- a configuration with platform defaults
-
windows
public static DefaultPrompterConfig windows()
Description copied from interface:PrompterConfigCreate a configuration with Windows-specific defaults.- Returns:
- a configuration with Windows defaults
-
unix
public static DefaultPrompterConfig unix()
Description copied from interface:PrompterConfigCreate a configuration with Unix/Linux-specific defaults.- Returns:
- a configuration with Unix defaults
-
custom
public static DefaultPrompterConfig custom(org.jline.utils.StyleResolver styleResolver)
-
windows
public static DefaultPrompterConfig windows(org.jline.utils.StyleResolver styleResolver)
-
unix
public static DefaultPrompterConfig unix(org.jline.utils.StyleResolver styleResolver)
-
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/stringuncheckedBox- the unchecked box character/stringcheckedBox- the checked box character/stringunavailable- 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:PrompterConfigCreate a custom configuration with style resolver support.- Parameters:
indicator- the indicator character/stringuncheckedBox- the unchecked box character/stringcheckedBox- the checked box character/stringunavailable- the unavailable item character/stringresolver- the style resolver for applying styles- Returns:
- a custom configuration with styling support
-
cancellableFirstPrompt
public boolean cancellableFirstPrompt()
Description copied from interface:PrompterConfigWhether the first prompt can be cancelled.- Specified by:
cancellableFirstPromptin interfacePrompterConfig- Returns:
- true if the first prompt can be cancelled
-
styleResolver
public org.jline.utils.StyleResolver styleResolver()
Description copied from interface:PrompterConfigGet the style resolver for this configuration.- Specified by:
styleResolverin interfacePrompterConfig- Returns:
- the style resolver, or null if not available
-
indicator
public java.lang.String indicator()
Description copied from interface:PrompterConfigGet the indicator character/string.- Specified by:
indicatorin interfacePrompterConfig- Returns:
- the indicator
-
uncheckedBox
public java.lang.String uncheckedBox()
Description copied from interface:PrompterConfigGet the unchecked box character/string.- Specified by:
uncheckedBoxin interfacePrompterConfig- Returns:
- the unchecked box
-
checkedBox
public java.lang.String checkedBox()
Description copied from interface:PrompterConfigGet the checked box character/string.- Specified by:
checkedBoxin interfacePrompterConfig- Returns:
- the checked box
-
unavailable
public java.lang.String unavailable()
Description copied from interface:PrompterConfigGet the unavailable item character/string.- Specified by:
unavailablein interfacePrompterConfig- Returns:
- the unavailable item
-
-