org.fusesource.jansi.Ansi.reset()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(143)

本文整理了Java中org.fusesource.jansi.Ansi.reset()方法的一些代码示例,展示了Ansi.reset()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Ansi.reset()方法的具体详情如下:
包路径:org.fusesource.jansi.Ansi
类名称:Ansi
方法名:reset

Ansi.reset介绍

暂无

代码示例

代码示例来源:origin: fabric8io/docker-maven-plugin

/** {@inheritDoc} */
public void verbose(String message, Object ... params) {
  if (verbose) {
    log.info(ansi().fgBright(BLACK).a(prefix).a(format(message, params)).reset().toString());
  }
}

代码示例来源:origin: org.apache.maven.shared/maven-shared-utils

public AnsiMessageBuilder success( Object message )
{
  Style.SUCCESS.apply( ansi ).a( message ).reset();
  return this;
}

代码示例来源:origin: fabric8io/docker-maven-plugin

private String formatTimestamp(Timestamp timestamp,boolean withColor) {
  if (timeFormatter == null) {
    return "";
  }
  String date = timeFormatter.print(timestamp.getDate());
  return (withColor ?
      ansi().fgBright(BLACK).a(date).reset().toString() :
      date) + " ";
}

代码示例来源:origin: org.apache.maven.plugins/maven-surefire-report-plugin

public AnsiMessageBuilder success( Object message )
{
  Style.SUCCESS.apply( ansi ).a( message ).reset();
  return this;
}

代码示例来源:origin: apache/hive

/**
 * NOTE: Use this method only if isUnixTerminal is true.
 * Erases the current line and prints the given line with the specified color.
 *
 * @param line  - line to print
 * @param color - color for the line
 */
private void reprintLineWithColorAsBold(String line, Ansi.Color color) {
 out.print(ansi().eraseLine(Ansi.Erase.ALL).fg(color).bold().a(line).a('\n').boldOff().reset()
  .toString());
 out.flush();
 lines++;
}

代码示例来源:origin: org.apache.maven.shared/maven-shared-utils

public AnsiMessageBuilder strong( Object message )
{
  Style.STRONG.apply( ansi ).a( message ).reset();
  return this;
}

代码示例来源:origin: prestodb/presto

ansi.a(lines.get(i - 1)).newline();
ansi.a(good);
ansi.a(bad).newline();
for (int i = location.getLineNumber(); i < lines.size(); i++) {
  ansi.a(lines.get(i)).newline();
ansi.reset();
out.print(ansi);

代码示例来源:origin: org.apache.maven.shared/maven-shared-utils

public AnsiMessageBuilder mojo( Object message )
{
  Style.MOJO.apply( ansi ).a( message ).reset();
  return this;
}

代码示例来源:origin: fabric8io/docker-maven-plugin

private String formatPrefix(String prefix,boolean withColor) {
  if (withColor) {
    Ansi ansi = ansi();
    if (fgBright) {
      ansi.fgBright(color);
    } else {
      ansi.fg(color);
    }
    return ansi.a(prefix).reset().toString();
  } else {
    return prefix;
  }
}

代码示例来源:origin: org.apache.maven.shared/maven-shared-utils

public AnsiMessageBuilder project( Object message )
{
  Style.PROJECT.apply( ansi ).a( message ).reset();
  return this;
}

代码示例来源:origin: apache/drill

private void reprintLineWithColorAsBold(String line, Ansi.Color color) {
 out.print(ansi().eraseLine(Ansi.Erase.ALL).fg(color).bold().a(line).a('\n').boldOff().reset()
   .toString());
 out.flush();
 lines++;
}

代码示例来源:origin: stackoverflow.com

Ansi ansi = new Ansi();
ansi.a(Ansi.Attribute.STRIKETHROUGH_ON);
ansi.a("Striked");
ansi.reset();
System.out.println(ansi);

代码示例来源:origin: org.codehaus.groovy/groovy

private void log(final String level, Object msg, Throwable cause) {
  assert level != null;
  assert msg != null;
  if (io == null) {
    synchronized (Logger.class) {
      if (io == null) {
        io = new IO();
      }
    }
  }
  // Allow the msg to be a Throwable, and handle it properly if no cause is given
  if (cause == null) {
    if (msg instanceof Throwable) {
      cause = (Throwable) msg;
      msg = cause.getMessage();
    }
  }
  Color color = GREEN;
  if (WARN.equals(level) || ERROR.equals(level)) {
    color = RED;
  }
  io.out.println(ansi().a(INTENSITY_BOLD).fg(color).a(level).reset().a(" [").a(name).a("] ").a(msg));
  if (cause != null) {
    cause.printStackTrace(io.out);
  }
  io.flush();
}

代码示例来源:origin: org.apache.maven.plugins/maven-surefire-report-plugin

public AnsiMessageBuilder info( Object message )
{
  Style.INFO.apply( ansi ).a( message ).reset();
  return this;
}

代码示例来源:origin: micronaut-projects/micronaut-core

private String doUserInput(String msg, boolean secure) {
  // Add a space to the end of the message if there isn't one already.
  if (!msg.endsWith(" ") && !msg.endsWith("\t")) {
    msg += ' ';
  }
  lastMessage = "";
  msg = isAnsiEnabled() ? outputCategory(ansi(), ">").fg(DEFAULT).a(msg).reset().toString() : msg;
  try {
    return readLine(msg, secure);
  } finally {
    cursorMove = 0;
  }
}

代码示例来源:origin: locationtech/geogig

@Override
public void print(RevCommit commit) throws IOException {
  Ansi ansi = newAnsi(console);
  ansi.fg(Color.YELLOW).a(getIdAsString(commit.getId())).reset();
  String message = Strings.nullToEmpty(commit.getMessage());
  String title = Splitter.on('\n').split(message).iterator().next();
  ansi.a(" ").a(title);
  console.println(ansi.toString());
}

代码示例来源:origin: fabric8io/docker-maven-plugin

private String colored(String message, Ansi.Color color, boolean addPrefix, Object ... params) {
  Ansi ansi = ansi().fg(color);
  String msgToPrint = addPrefix ? prefix + message : message;
  return ansi.a(format(evaluateEmphasis(msgToPrint, color), params)).reset().toString();
}

代码示例来源:origin: org.locationtech.geogig/geogig-cli

@Override
public void print(RevCommit commit) throws IOException {
  Ansi ansi = newAnsi(console);
  ansi.fg(Color.YELLOW).a(getIdAsString(commit.getId())).reset();
  String message = Strings.nullToEmpty(commit.getMessage());
  String title = Splitter.on('\n').split(message).iterator().next();
  ansi.a(" ").a(title);
  console.println(ansi.toString());
}

代码示例来源:origin: micronaut-projects/micronaut-core

.fg(Color.DEFAULT).a(msg).reset();
out.println(lastStatus);
if (!userInputActive) {

代码示例来源:origin: org.locationtech.geogig/geogig-cli-core

private void printFeatureType(Ansi ansi, RevFeatureType ft, boolean useDefaultKeyword) {
  ImmutableList<PropertyDescriptor> attribs = ft.descriptors();
  ansi.fg(Color.YELLOW).a(useDefaultKeyword ? "DEFAULT " : "").a("FEATURE TYPE ID:  ").reset()
      .a(ft.getId().toString()).newline().newline();
  ansi.a(useDefaultKeyword ? "DEFAULT " : "").a("FEATURE TYPE ATTRIBUTES").newline();
  for (PropertyDescriptor attrib : attribs) {
    ansi.fg(Color.YELLOW).a(attrib.getName() + ": ").reset()
        .a("<" + FieldType.forBinding(attrib.getType().getBinding()) + ">").newline();
  }
}

相关文章