- java.lang.Object
-
- org.jline.prompt.impl.DefaultCheckboxItem
-
- All Implemented Interfaces:
CheckboxItem,PromptItem
public class DefaultCheckboxItem extends java.lang.Object implements CheckboxItem
Default implementation of CheckboxItem interface.
-
-
Constructor Summary
Constructors Constructor Description DefaultCheckboxItem(java.lang.String name, java.lang.String text)DefaultCheckboxItem(java.lang.String name, java.lang.String text, boolean checked)DefaultCheckboxItem(java.lang.String name, java.lang.String text, boolean checked, boolean disabled, java.lang.String disabledText)DefaultCheckboxItem(java.lang.String name, java.lang.String text, boolean checked, boolean disabled, java.lang.String disabledText, java.lang.String footer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDisabledText()Get the text to display when this item is disabled.java.lang.StringgetFooter()Optional footer text shown dimmed below a list or checkbox while this item is focused.java.lang.StringgetName()Get the name of this item.java.lang.StringgetText()Get the text to display for this item.booleanisDisabled()Whether this item is disabled.booleanisInitiallyChecked()Whether this checkbox is initially checked.java.lang.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jline.prompt.PromptItem
isSelectable
-
-
-
-
Constructor Detail
-
DefaultCheckboxItem
public DefaultCheckboxItem(java.lang.String name, java.lang.String text, boolean checked, boolean disabled, java.lang.String disabledText, java.lang.String footer)
-
DefaultCheckboxItem
public DefaultCheckboxItem(java.lang.String name, java.lang.String text, boolean checked, boolean disabled, java.lang.String disabledText)
-
DefaultCheckboxItem
public DefaultCheckboxItem(java.lang.String name, java.lang.String text, boolean checked)
-
DefaultCheckboxItem
public DefaultCheckboxItem(java.lang.String name, java.lang.String text)
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:PromptItemGet the name of this item.- Specified by:
getNamein interfacePromptItem- Returns:
- the name
-
getText
public java.lang.String getText()
Description copied from interface:PromptItemGet the text to display for this item.- Specified by:
getTextin interfacePromptItem- Returns:
- the text
-
isInitiallyChecked
public boolean isInitiallyChecked()
Description copied from interface:CheckboxItemWhether this checkbox is initially checked. This represents the default/initial state, not the current selection.- Specified by:
isInitiallyCheckedin interfaceCheckboxItem- Returns:
- true if this checkbox is initially checked
-
isDisabled
public boolean isDisabled()
Description copied from interface:PromptItemWhether this item is disabled.- Specified by:
isDisabledin interfacePromptItem- Returns:
- true if this item is disabled
-
getDisabledText
public java.lang.String getDisabledText()
Description copied from interface:PromptItemGet the text to display when this item is disabled.- Specified by:
getDisabledTextin interfacePromptItem- Returns:
- the disabled text
-
getFooter
public java.lang.String getFooter()
Description copied from interface:PromptItemOptional footer text shown dimmed below a list or checkbox while this item is focused.- Specified by:
getFooterin interfacePromptItem- Returns:
- the footer text, or
null/empty for no footer
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-