public void repositionCursor() { if (lines > 0) { if (isRealTerminal()) { out.print(ansi().cursorUp(lines).toString()); } else { out.print('\r'); } out.flush(); lines = 0; } }
/** * NOTE: Use this method only if isUnixTerminal is true. * Repositions the cursor back to line 0. */ private void repositionCursor() { if (lines > 0) { out.print(ansi().cursorUp(lines).toString()); out.flush(); lines = 0; } }
public static void rePositionCursor(PrintStream ps) { ps.print(ansi().cursorUp(0).toString()); ps.flush(); }
private void repositionCursor() { if (lines > 0) { out.print(ansi().cursorUp(lines).toString()); out.flush(); lines = 0; } }
public void resetScreen() { if (lines > 0) { if (isRealTerminal()) { out.print(ansi().cursorUp(lines).eraseScreen(Erase.FORWARD).toString()); } else { out.print('\r'); } out.flush(); lines = 0; } }
private Ansi erasePreviousLine(String categoryName) { int cursorMove = this.cursorMove; if (userInputActive) { cursorMove++; } if (cursorMove > 0) { int moveLeftLength = categoryName.length() + lastMessage.length(); if (userInputActive) { moveLeftLength += PROMPT.length(); } return ansi() .cursorUp(cursorMove) .cursorLeft(moveLeftLength) .eraseLine(FORWARD); } return ansi(); }
private void updateAnsiProgress(String imageId, String status, String progressMessage) { Map<String,Integer> imgLineMap = imageLines.get(); Integer line = imgLineMap.get(imageId); int diff = 0; if (line == null) { line = imgLineMap.size(); imgLineMap.put(imageId, line); } else { diff = imgLineMap.size() - line; } if (diff > 0) { print(ansi().cursorUp(diff).eraseLine(Ansi.Erase.ALL).toString()); } // Status with progress bars: (max length = 11, hence pad to 11) // Extracting // Downloading String progress = progressMessage != null ? progressMessage : ""; String msg = ansi() .fg(COLOR_PROGRESS_ID).a(imageId).reset().a(": ") .fg(COLOR_PROGRESS_STATUS).a(StringUtils.rightPad(status,11) + " ") .fg(COLOR_PROGRESS_BAR).a(progress).toString(); println(msg); if (diff > 0) { // move cursor back down to bottom print(ansi().cursorDown(diff - 1).toString()); } }
/** * NOTE: Use this method only if isUnixTerminal is true. * Repositions the cursor back to line 0. */ private void repositionCursor() { if (lines > 0) { out.print(ansi().cursorUp(lines).toString()); out.flush(); lines = 0; } }
/** * NOTE: Use this method only if isUnixTerminal is true. * Repositions the cursor back to line 0. */ public void repositionCursor() { if (lines > 0) { out.print(ansi().cursorUp(lines).toString()); out.flush(); lines = 0; } }
/** * NOTE: Use this method only if isUnixTerminal is true. * Repositions the cursor back to line 0. */ public static void rePositionCursor(PrintStream out, int lines) { out.print(ansi().cursorUp(lines).toString()); out.flush(); }
public static void rePositionCursor(PrintStream ps) { ps.print(ansi().cursorUp(0).toString()); ps.flush(); }
public void repositionCursor() { if (lines > 0) { if (isRealTerminal()) { out.print(ansi().cursorUp(lines).toString()); } else { out.print('\r'); } out.flush(); lines = 0; } }
public void repositionCursor() { if (lines > 0) { if (isRealTerminal()) { out.print(ansi().cursorUp(lines).toString()); } else { out.print('\r'); } out.flush(); lines = 0; } }
public void repositionCursor() { if (lines > 0) { if (isRealTerminal()) { out.print(ansi().cursorUp(lines).toString()); } else { out.print('\r'); } out.flush(); lines = 0; } }
public void repositionCursor() { if (lines > 0) { if (isRealTerminal()) { out.print(ansi().cursorUp(lines).toString()); } else { out.print('\r'); } out.flush(); lines = 0; } }
public void resetScreen() { if (lines > 0) { if (isRealTerminal()) { out.print(ansi().cursorUp(lines).eraseScreen(Erase.FORWARD).toString()); } else { out.print('\r'); } out.flush(); lines = 0; } }
public void resetScreen() { if (lines > 0) { if (isRealTerminal()) { out.print(ansi().cursorUp(lines).eraseScreen(Erase.FORWARD).toString()); } else { out.print('\r'); } out.flush(); lines = 0; } }
public void resetScreen() { if (lines > 0) { if (isRealTerminal()) { out.print(ansi().cursorUp(lines).eraseScreen(Erase.FORWARD).toString()); } else { out.print('\r'); } out.flush(); lines = 0; } }
/** * Renders the confirmation message on the screen. */ private void render() { System.out.println(""); System.out.println(ansi().eraseLine().cursorUp(2)); System.out.print(renderMessagePrompt(this.confirmChoice.getMessage()) + itemRenderer.renderConfirmChoiceOptions(this.confirmChoice) + " " + ansi().reset().a(calcResultValue() + " ").eraseLine()); System.out.flush(); renderHeight = 1; }
/** * Generic method to render the message prompt and the users input after the prompt. This method is * used by all prompt implementations to display the question and result after the user has made * the input. * * @param message message to render as colored prompt. * @param resultValue result value generated from the prompt implementation */ protected void renderMessagePromptAndResult(String message, String resultValue) { System.out.println(ansi().cursorUp(renderHeight - 1).a(renderMessagePrompt(message)).fg(Ansi.Color.CYAN).a(" " + resultValue).eraseScreen(Ansi.Erase.FORWARD).reset()); }