Java Code Examples for org.fusesource.jansi.Ansi#newline()

The following examples show how to use org.fusesource.jansi.Ansi#newline() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ColorFormatter.java    From tomee with Apache License 2.0 6 votes vote down vote up
@Override
public synchronized String format(final LogRecord record) {
    final boolean exception = record.getThrown() != null;
    final Ansi sbuf = prefix(record);
    sbuf.a(record.getLevel().getLocalizedName());
    sbuf.a(" - ");
    sbuf.a(formatMessage(record));
    if (!exception) {
        suffix(sbuf, record);
    }
    sbuf.newline();
    if (exception) {
        try {
            final StringWriter sw = new StringWriter();
            final PrintWriter pw = new PrintWriter(sw);
            record.getThrown().printStackTrace(pw);
            pw.close();
            sbuf.a(sw.toString());
        } catch (final Exception ex) {
            // no-op
        } finally {
            suffix(sbuf, record);
        }
    }
    return sbuf.toString();
}
 
Example 2
Source File: DetailPrinter.java    From seed with Mozilla Public License 2.0 5 votes vote down vote up
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());
}
 
Example 3
Source File: DetailPrinter.java    From seed with Mozilla Public License 2.0 5 votes vote down vote up
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();
    }
}
 
Example 4
Source File: AnsiConsole.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void onDeactivate(Ansi ansi) {
    if (width > 0) {
        ansi.newline();
        extraEol = true;
    }
}
 
Example 5
Source File: AnsiConsole.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void onDeactivate(Ansi ansi) {
    if (width > 0) {
        ansi.newline();
        extraEol = true;
    }
}
 
Example 6
Source File: AnsiConsole.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void onDeactivate(Ansi ansi) {
    if (width > 0) {
        ansi.newline();
        extraEol = true;
    }
}
 
Example 7
Source File: AnsiConsole.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void onDeactivate(Ansi ansi) {
    if (width > 0) {
        ansi.newline();
        extraEol = true;
    }
}