本文整理了Java中org.fusesource.jansi.Ansi.eraseScreen()
方法的一些代码示例,展示了Ansi.eraseScreen()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ansi.eraseScreen()
方法的具体详情如下:
包路径:org.fusesource.jansi.Ansi
类名称:Ansi
方法名:eraseScreen
暂无
代码示例来源:origin: prestodb/presto
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;
}
}
代码示例来源:origin: Dreampie/Resty
private static String diy(String color, String value) {
if (devEnable) {
return String.valueOf(Ansi.ansi().eraseScreen().render("@|" + color + " " + value + "|@"));
} else {
return value;
}
}
代码示例来源:origin: org.sonatype.gshell.commands/gshell-shell
public Object execute(final CommandContext context) throws Exception {
assert context != null;
IO io = context.getIo();
io.out.print(Ansi.ansi().eraseScreen(Ansi.Erase.ALL));
io.out.flush();
return Result.SUCCESS;
}
}
代码示例来源:origin: com.cybermkd/ICEREST
private static String diy(String color, String value) {
if (Constant.devMode){
return String.valueOf(Ansi.ansi().eraseScreen().render("@|" + color + " " + value + "|@"));
}else {
return value;
}
}
代码示例来源:origin: T-baby/ICERest
private static String diy(String color, String value) {
if (Constant.devMode){
return String.valueOf(Ansi.ansi().eraseScreen().render("@|" + color + " " + value + "|@"));
}else {
return value;
}
}
代码示例来源:origin: com.facebook.presto/presto-cli
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;
}
}
代码示例来源:origin: io.prestosql/presto-cli
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;
}
}
代码示例来源:origin: uk.co.nichesolutions.presto/presto-cli
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;
}
}
代码示例来源:origin: prestosql/presto
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;
}
}
代码示例来源:origin: org.apache.pig/pig
@Override
protected void printClear() {
AnsiConsole.systemInstall();
Ansi ansi = Ansi.ansi();
System.out.println( ansi.eraseScreen() );
System.out.println( ansi.cursor(0, 0) );
AnsiConsole.systemUninstall();
}
代码示例来源:origin: aliyun/aliyun-odps-console
/**
* NOTE: Use this method only if isUnixTerminal is true.
* Repositions the cursor to top left, and clear screen
*/
public static void resetScreen(PrintStream out) {
out.print(ansi().cursor(1, 1).toString());
out.print(ansi().eraseScreen(Ansi.Erase.FORWARD).toString());
out.flush();
}
代码示例来源:origin: aliyun/aliyun-odps-console
/**
* NOTE: Use this method only if isUnixTerminal is true.
* Clear the screen, and the repositions the cursor to top left
*/
public static void clearScreen(PrintStream out) {
out.print(ansi().eraseScreen(Ansi.Erase.ALL).toString());
out.print(ansi().cursor(1, 1).toString());
out.flush();
}
}
代码示例来源:origin: org.springframework.shell/spring-shell
@CliCommand(value = { "cls", "clear" }, help = "Clears the console")
public void clear() {
AnsiConsole.out().print(ansi().eraseScreen().cursor(0, 0));
}
代码示例来源:origin: org.jboss.forge/forge-shell
@Override
public void clear()
{
print(new Ansi().cursor(0, 0).eraseScreen().toString());
}
代码示例来源:origin: awegmann/consoleui
/**
* 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());
}
代码示例来源:origin: org.jledit/core
/**
* Repaints the whole screen.
*/
void repaintScreen() {
int repaintLine = 1;
console.out().print(ansi().eraseScreen(Erase.ALL));
console.out().print(ansi().cursor(1, 1));
console.out().print("\33[" + (getHeaderSize() + 1) + ";" + (terminal.getHeight() - getFooterSize()) + ";r");
redrawHeader();
redrawFooter();
LinkedList<String> linesToDisplay = new LinkedList<String>();
int l = 1;
while (linesToDisplay.size() < terminal.getHeight() - getFooterSize()) {
String currentLine = getContent(l++);
linesToDisplay.addAll(toDisplayLines(currentLine));
}
for (int i = 0; i < terminal.getHeight() - getHeaderSize() - getFooterSize(); i++) {
console.out().print(ansi().cursor(repaintLine + getHeaderSize(), 1));
displayText(linesToDisplay.get(i));
repaintLine++;
}
console.out().print(ansi().cursor(2, 1));
}
代码示例来源:origin: awegmann/consoleui
public static void main(String[] args) throws InterruptedException {
AnsiConsole.systemInstall();
System.out.println(ansi().eraseScreen().render("@|red,italic Hello|@ @|green World|@\n@|reset " +
"This is a demonstration of ConsoleUI java library. It provides a simple console interface\n" +
"for querying information from the user. ConsoleUI is inspired by Inquirer.js which is written\n" +
内容来源于网络,如有侵权,请联系作者删除!