public AnsiMessageBuilder newline() { ansi.newline(); return this; }
public AnsiMessageBuilder newline() { ansi.newline(); return this; }
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()); }
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(); } } }
private Ansi printSummary(PropertyInfo propertyInfo, Ansi ansi) { return ansi.a(propertyInfo.getShortDescription()).newline(); }
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()); }
@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; }
@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 } }
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(); } }
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(); } }
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()); }
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(); } }
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()); }
/** 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(); }
/** 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(); }
/** 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(); }
/** 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(); }
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); } }