@Override public ANSIBuffer attrib(final String str, final int code) { if (BRIGHT_COLORS && 30 <= code && code <= 37) { // This is a color code: add a 'bright' code return append(esc + "[" + code + ";1m").append(str).append(ANSICodes.attrib(0)); } return super.attrib(str, code); };
@Override public ANSIBuffer attrib(final String str, final int code) { if (BRIGHT_COLORS && 30 <= code && code <= 37) { // This is a color code: add a 'bright' code return append(esc + "[" + code + ";1m").append(str).append(ANSICodes.attrib(0)); } return super.attrib(str, code); };
private void promptForEmailAnsi() throws PrompterException, IOException { ANSIBuffer ansiBuffer = new ANSIBuffer(); ansiBuffer.append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.FG_YELLOW)) .append("Would you like to subscribe to the Atlassian developer mailing list?") .append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.OFF)); boolean signUp = promptForBoolean(ansiBuffer.toString(),"Y"); if(signUp) { ANSIBuffer ansiEmailBuffer = new ANSIBuffer(); ansiEmailBuffer.append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.FG_GREEN)) .append("Please enter your email address (leave blank to cancel):") .append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.OFF)); String email = prompter.prompt(ansiEmailBuffer.toString()); if(StringUtils.isNotBlank(email) && EmailValidator.getInstance().isValid(email)) { doSubscribe(email); } } }
@Override public void showWarning(String message) throws PrompterException { String formattedMessage = message; if (useAnsiColor) { ANSIBuffer ansiBuffer = new ANSIBuffer(); ansiBuffer.append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.BOLD)) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.FG_YELLOW)) .append(message) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.OFF)); formattedMessage = ansiBuffer.toString(); } showMessage(formattedMessage); }
@Override public void showInfo(String message) throws PrompterException { String formattedMessage = message; if (useAnsiColor) { ANSIBuffer ansiBuffer = new ANSIBuffer(); ansiBuffer.append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.BOLD)) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.FG_GREEN)) .append(message) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.OFF)); formattedMessage = ansiBuffer.toString(); } showMessage(formattedMessage); }
@Override public void showError(String message) throws PrompterException { String formattedMessage = message; if (useAnsiColor) { ANSIBuffer ansiBuffer = new ANSIBuffer(); ansiBuffer.append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.BOLD)) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.FG_RED)) .append(message) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.OFF)); formattedMessage = ansiBuffer.toString(); } showMessage(formattedMessage); }
public String requiredMessage(String message) { String formattedMessage = message; if (useAnsiColor) { ANSIBuffer ansiBuffer = new ANSIBuffer(); ansiBuffer.append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.BOLD)) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.FG_RED)) .append(message) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.OFF)); formattedMessage = ansiBuffer.toString(); } return formattedMessage; }
protected String requiredMessage(String message) { String formattedMessage = message; if (useAnsiColor) { ANSIBuffer ansiBuffer = new ANSIBuffer(); ansiBuffer.append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.BOLD)) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.FG_RED)) .append(message) .append(ANSIBuffer.ANSICodes .attrib(PrettyPrompter.OFF)); formattedMessage = ansiBuffer.toString(); } return formattedMessage; }
private boolean promptForUpdateAnsi(DefaultArtifactVersion ampsVersionInPom, DefaultArtifactVersion runningVersion) throws PrompterException { ANSIBuffer ansiBuffer = new ANSIBuffer(); ansiBuffer.append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.FG_YELLOW)) .append("You are running SDK version ") .append(runningVersion.toString()) .append(" but your pom is using version ") .append(ampsVersionInPom.toString()) .append("\n") .append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.OFF)) .append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.BOLD)) .append("Would you like to have your pom updated?") .append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.OFF)); return promptForBoolean(ansiBuffer.toString(),"Y"); }
private void promptAnsi(String latestVersion) throws PrompterException { ANSIBuffer ansiBuffer = new ANSIBuffer(); ansiBuffer.append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.FG_YELLOW)) .append("************************************************************") .append("\nVersion " + latestVersion + " of the Atlassian Plugin SDK is now available.\n") .append("Run the atlas-update command to update.\n") .append("************************************************************") .append(ANSIBuffer.ANSICodes.attrib(PrettyPrompter.OFF)); getLogger().warn(ansiBuffer.toString()); // prompter.prompt(ansiBuffer.toString()); }
public Buffer attrib(final int code) { if (isEnabled()) { buff.append(ANSICodes.attrib(code)); } return this; }
public Buffer attrib(final int code) { if (isEnabled()) { buff.append(ANSICodes.attrib(code)); } return this; }
public Buffer attrib(final int code) { if (isEnabled()) { buff.append(ANSIBuffer.ANSICodes.attrib(code)); } return this; }
public Buffer attrib(final int code) { if (isEnabled()) { buff.append(ANSICodes.attrib(code)); } return this; }
@Override public ANSIBuffer reverse(final String str) { if (SystemUtils.IS_OS_WINDOWS) { return super.reverse(str).append(ANSICodes.attrib(esc)); } return super.reverse(str); } };
@Override public ANSIBuffer reverse(final String str) { if (SystemUtils.IS_OS_WINDOWS) { return super.reverse(str).append(ANSICodes.attrib(esc)); } return super.reverse(str); } };