public JLineTextTerminal(ConsoleReader reader) { if(reader == null) throw new IllegalArgumentException("reader is null"); reader.setHandleUserInterrupt(true); this.reader = reader; TerminalProperties<JLineTextTerminal> props = getProperties(); props.addStringListener(PROP_PROMPT_COLOR, null, (term, newVal) -> setPromptColor(newVal)); props.addStringListener(PROP_PROMPT_BGCOLOR, null, (term, newVal) -> setPromptBackgroundColor(newVal)); props.addBooleanListener(PROP_PROMPT_BOLD, false, (term, newVal) -> setPromptBold(newVal)); props.addBooleanListener(PROP_PROMPT_ITALIC, false, (term, newVal) -> setPromptItalic(newVal)); props.addBooleanListener(PROP_PROMPT_UNDERLINE, false, (term, newVal) -> setPromptUnderline(newVal)); props.addStringListener(PROP_INPUT_COLOR, null, (term, newVal) -> setInputColor(newVal)); props.addStringListener(PROP_INPUT_BGCOLOR, null, (term, newVal) -> setInputBackgroundColor(newVal)); props.addBooleanListener(PROP_INPUT_BOLD, false, (term, newVal) -> setInputBold(newVal)); props.addBooleanListener(PROP_INPUT_ITALIC, false, (term, newVal) -> setInputItalic(newVal)); props.addBooleanListener(PROP_INPUT_UNDERLINE, false, (term, newVal) -> setInputUnderline(newVal)); props.addStringListener(PROP_ANSI_COLOR_MODE, AnsiColorMode.STANDARD.toString(), (term, newVal) -> setAnsiColorMode(newVal)); }
public WebTextTerminal() { TerminalProperties<WebTextTerminal> props = getProperties(); props.addStringListener(PROP_USER_INTERRUPT_KEY, null, (term, newVal) -> setUserInterruptKey(newVal)); props.addStringListener(PROP_PROMPT_STYLE_CLASS, null, (term, newVal) -> addSetting("promptStyleClass", newVal)); props.addStringListener(PROP_PROMPT_COLOR, null, (term, newVal) -> addSetting("promptColor", newVal)); props.addStringListener(PROP_PROMPT_BGCOLOR, null, (term, newVal) -> addSetting("promptBackgroundColor", newVal)); props.addBooleanListener(PROP_PROMPT_BOLD, false, (term, newVal) -> addSetting("promptBold", newVal)); props.addBooleanListener(PROP_PROMPT_ITALIC, false, (term, newVal) -> addSetting("promptItalic", newVal)); props.addBooleanListener(PROP_PROMPT_UNDERLINE, false, (term, newVal) -> addSetting("promptUnderline", newVal)); props.addStringListener(PROP_INPUT_STYLE_CLASS, null, (term, newVal) -> addSetting("inputStyleClass", newVal)); props.addStringListener(PROP_INPUT_COLOR, null, (term, newVal) -> addSetting("inputColor", newVal)); props.addStringListener(PROP_INPUT_BGCOLOR, null, (term, newVal) -> addSetting("inputBackgroundColor", newVal)); props.addBooleanListener(PROP_INPUT_BOLD, false, (term, newVal) -> addSetting("inputBold", newVal)); props.addBooleanListener(PROP_INPUT_ITALIC, false, (term, newVal) -> addSetting("inputItalic", newVal)); props.addBooleanListener(PROP_INPUT_UNDERLINE, false, (term, newVal) -> addSetting("inputUnderline", newVal)); props.addStringListener(PROP_PANE_BGCOLOR, null, (term, newVal) -> addSetting("paneBackgroundColor", newVal)); props.addStringListener(PROP_PANE_STYLE_CLASS, null, (term, newVal) -> addSetting("paneStyleClass", newVal)); }
props.addStringListener(PROP_PROMPT_FONT_FAMILY, null, (term, newVal) -> setPromptFontFamily(newVal)); props.addIntListener(PROP_PROMPT_FONT_SIZE, DEFAULT_FONT_SIZE, (term, newVal) -> setPromptFontSize(newVal)); props.addBooleanListener(PROP_PROMPT_BOLD, false, (term, newVal) -> setPromptBold(newVal)); props.addBooleanListener(PROP_PROMPT_ITALIC, false, (term, newVal) -> setPromptItalic(newVal)); props.addBooleanListener(PROP_PROMPT_UNDERLINE, false, (term, newVal) -> setPromptUnderline(newVal)); props.addBooleanListener(PROP_PROMPT_SUBSCRIPT, false, (term, newVal) -> setPromptSubscript(newVal)); props.addBooleanListener(PROP_PROMPT_SUPERSCRIPT, false, (term, newVal) -> setPromptSuperscript(newVal)); props.addStringListener(PROP_INPUT_FONT_FAMILY, null, (term, newVal) -> setInputFontFamily(newVal)); props.addIntListener(PROP_INPUT_FONT_SIZE, DEFAULT_FONT_SIZE, (term, newVal) -> setInputFontSize(newVal)); props.addBooleanListener(PROP_INPUT_BOLD, false, (term, newVal) -> setInputBold(newVal)); props.addBooleanListener(PROP_INPUT_ITALIC, false, (term, newVal) -> setInputItalic(newVal)); props.addBooleanListener(PROP_INPUT_UNDERLINE, false, (term, newVal) -> setInputUnderline(newVal)); props.addBooleanListener(PROP_INPUT_SUBSCRIPT, false, (term, newVal) -> setInputSubscript(newVal)); props.addBooleanListener(PROP_INPUT_SUPERSCRIPT, false, (term, newVal) -> setInputSuperscript(newVal));