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

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

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

Ansi.newline介绍

暂无

代码示例

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

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

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

public AnsiMessageBuilder newline()
{
  ansi.newline();
  return this;
}

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

public AnsiMessageBuilder newline()
{
  ansi.newline();
  return this;
}

代码示例来源:origin: org.seedstack.seed/seed-core

private void printLongDescription(PropertyInfo propertyInfo, Ansi ansi) {
  String longDescription = propertyInfo.getLongDescription();
  if (longDescription != null) {
    ansi.newline().a(textWrapper.wrap(longDescription)).newline();
  }
}

代码示例来源:origin: org.seedstack.seed/seed-core

void printTree(PrintStream stream) {
  Ansi ansi = Ansi.ansi();
  ansi
      .a("Configuration options")
      .newline()
      .a("---------------------")
      .newline();
  printTree(node, "", ansi);
  ansi
      .newline()
      .a("(*) mandatory property")
      .newline()
      .a("(~) default property (can be specified as single value)")
      .newline();
  stream.print(ansi.toString());
}

代码示例来源:origin: org.seedstack.seed/seed-core

private void printAdditionalInfo(PropertyInfo propertyInfo, Ansi ansi) {
    if (propertyInfo.isMandatory() || propertyInfo.isSingleValue()) {
      ansi.newline();
    }
    if (propertyInfo.isMandatory()) {
      ansi.a("* This property is mandatory.").newline();
    }
    if (propertyInfo.isSingleValue()) {
      ansi.a("* This property is the default property of its declaring object").newline();
    }
  }
}

代码示例来源:origin: org.seedstack.seed/seed-core

private Ansi printSummary(PropertyInfo propertyInfo, Ansi ansi) {
  return ansi.a(propertyInfo.getShortDescription()).newline();
}

代码示例来源:origin: org.seedstack.seed/seed-core

void printDetail(PrintStream stream) {
  Ansi ansi = Ansi.ansi();
  String title = "Details of " + propertyInfo.getName();
  ansi
      .a(title)
      .newline()
      .a(Strings.repeat("-", title.length()))
      .newline().newline();
  printSummary(propertyInfo, ansi);
  printDeclaration(propertyInfo, ansi);
  printLongDescription(propertyInfo, ansi);
  printAdditionalInfo(propertyInfo, ansi);
  ansi.newline();
  stream.print(ansi.toString());
}

代码示例来源:origin: org.gradle/gradle-logging

@Override
public AnsiContext newLine() {
  int cols = consoleMetaData.getCols();
  int col = (cols > 0) ? writeCursor.col % cols : 0;
  listener.beforeNewLineWritten(this, Cursor.at(writeCursor.row, col));
  delegate.newline();
  newLineWritten(writePos);
  return this;
}

代码示例来源:origin: CloudSlang/cloud-slang

@Override
public void run() {
  try {
    AnsiConsole.out().print(ansi().fg(color).a(message).newline());
    AnsiConsole.out().print(ansi().fg(Ansi.Color.WHITE));
  } catch (Exception ignore) {
    // so that this thread does not die
  }
}

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

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();
  }
}

代码示例来源: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();
  }
}

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

public static void print(GeoGIG geogig, Console console,
    DiffSummary<BoundingBox, BoundingBox> diffBounds) throws IOException {
  BoundingBox left = diffBounds.getLeft();
  BoundingBox right = diffBounds.getRight();
  Optional<BoundingBox> mergedResult = diffBounds.getMergedResult();
  BoundingBox both = new ReferencedEnvelope();
  if (mergedResult.isPresent()) {
    both = mergedResult.get();
  }
  Ansi ansi = AnsiDecorator.newAnsi(console.isAnsiSupported());
  ansi.a("left:  ").a(bounds(left)).newline();
  ansi.a("right: ").a(bounds(right)).newline();
  ansi.a("both:  ").a(bounds(both)).newline();
  ansi.a("CRS:   ").a(CRS.toSRS(left.getCoordinateReferenceSystem())).newline();
  console.print(ansi.toString());
}

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

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();
  }
}

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

public static void print(GeoGIG geogig, Console console,
    DiffSummary<BoundingBox, BoundingBox> diffBounds) throws IOException {
  BoundingBox left = diffBounds.getLeft();
  BoundingBox right = diffBounds.getRight();
  Optional<BoundingBox> mergedResult = diffBounds.getMergedResult();
  BoundingBox both = new ReferencedEnvelope();
  if (mergedResult.isPresent()) {
    both = mergedResult.get();
  }
  Ansi ansi = AnsiDecorator.newAnsi(console.isAnsiSupported());
  ansi.a("left:  ").a(bounds(left)).newline();
  ansi.a("right: ").a(bounds(right)).newline();
  ansi.a("both:  ").a(bounds(both)).newline();
  ansi.a("CRS:   ").a(CRS.toSRS(left.getCoordinateReferenceSystem())).newline();
  console.print(ansi.toString());
}

代码示例来源:origin: CorfuDB/CorfuDB

/** Run when a test is skipped due to not meeting prereqs.
 * @param e             The exception that was thrown.
 * @param description   A description of the method run.
 */
protected void skipped(Throwable e, Description description) {
  System.out.print(ansi().a("[")
      .fg(Ansi.Color.YELLOW)
      .a("SKIPPED -").reset()
      .a(e.getClass().toString())
      .a("]").newline());
  System.out.flush();
}

代码示例来源:origin: CorfuDB/CorfuDB

/** Run when the test successfully completes.
 * @param description   A description of the method run.
 */
protected void succeeded(Description description) {
  if (!testStatus.equals("")) {
    testStatus = " [" + testStatus + "]";
  }
  System.out.print(ansi().a("[").fg(Ansi.Color.GREEN).a("PASS")
      .reset().a("]" + testStatus).newline());
  System.out.flush();
}

代码示例来源:origin: CorfuDB/CorfuDB

/** Run when a test is skipped due to being disabled on Travis-CI.
 * This method doesn't provide an exception, unlike skipped().
 * @param description   A description of the method run.
 */
protected void travisSkipped(Description description) {
  System.out.print(ansi().a("[")
      .fg(Ansi.Color.YELLOW)
      .a("SKIPPED").reset()
      .a("]").newline());
  System.out.flush();
}

代码示例来源:origin: CorfuDB/CorfuDB

/** Run when the test fails to complete in time.
 * @param description   A description of the method run.
 */
protected void timedOut(@Nonnull Description description) {
  System.out.print(ansi().a("[")
    .fg(Ansi.Color.RED)
    .a("TIMED OUT").reset()
    .a("]").newline());
  printThreads();
  printLogs();
  System.out.flush();
}

代码示例来源:origin: org.seedstack.seed/seed-core

private void printTree(Node node, String leftPadding, Ansi ansi) {
  if (!node.isRootNode()) {
    ansi
        .a(leftPadding)
        .fg(Ansi.Color.YELLOW).a(node.getName()).reset()
        .newline();
    for (PropertyInfo propertyInfo : node.getPropertyInfo()) {
      printProperty(propertyInfo, leftPadding, ansi);
    }
  }
  for (Node child : node.getChildren()) {
    printTree(child, leftPadding + (node.isRootNode() ? "" : INDENTATION), ansi);
  }
}

相关文章