-
- All Superinterfaces:
Prompt
- All Known Implementing Classes:
DefaultTogglePrompt
public interface TogglePrompt extends Prompt
Interface for toggle prompts. A toggle prompt presents a binary on/off switch with labeled states (e.g., "Yes / No", "Enable / Disable"). The user toggles with arrow keys or Tab.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetActiveLabel()Get the label for the active (on) state.booleangetDefaultValue()Get the default value.java.lang.StringgetInactiveLabel()Get the label for the inactive (off) state.-
Methods inherited from interface org.jline.prompt.Prompt
getFilter, getMessage, getName, getTransformer
-
-
-
-
Method Detail
-
getActiveLabel
java.lang.String getActiveLabel()
Get the label for the active (on) state.- Returns:
- the active state label
-
getInactiveLabel
java.lang.String getInactiveLabel()
Get the label for the inactive (off) state.- Returns:
- the inactive state label
-
getDefaultValue
boolean getDefaultValue()
Get the default value.- Returns:
- true if the default is the active state, false for inactive
-
-