use of com.intellij.execution.process.AnsiEscapeDecoder in project intellij-community by JetBrains.
the class Printer method printWithAnsiColoring.
default default void printWithAnsiColoring(@NotNull String text, @NotNull Key processOutputType) {
AnsiEscapeDecoder decoder = new AnsiEscapeDecoder();
decoder.escapeText(text, ProcessOutputTypes.STDOUT, new AnsiEscapeDecoder.ColoredTextAcceptor() {
@Override
public void coloredTextAvailable(@NotNull String text, @NotNull Key attributes) {
ConsoleViewContentType contentType = ConsoleViewContentType.getConsoleViewType(attributes);
if (contentType == null || contentType == ConsoleViewContentType.NORMAL_OUTPUT) {
contentType = ConsoleViewContentType.getConsoleViewType(processOutputType);
}
print(text, contentType);
}
});
}
use of com.intellij.execution.process.AnsiEscapeDecoder in project intellij-community by JetBrains.
the class Printer method printWithAnsiColoring.
default default void printWithAnsiColoring(@NotNull String text, @NotNull ConsoleViewContentType contentType) {
AnsiEscapeDecoder decoder = new AnsiEscapeDecoder();
decoder.escapeText(text, ProcessOutputTypes.STDOUT, new AnsiEscapeDecoder.ColoredTextAcceptor() {
@Override
public void coloredTextAvailable(@NotNull String text, @NotNull Key attributes) {
ConsoleViewContentType viewContentType = ConsoleViewContentType.getConsoleViewType(attributes);
if (viewContentType == null) {
viewContentType = contentType;
}
print(text, viewContentType);
}
});
}
Aggregations