public static void printToConsole(@NotNull final JavaREPLLanguageConsole console,
@NotNull final String string,
@NotNull final ConsoleViewContentType mainType,
@Nullable ConsoleViewContentType additionalType) {
final TextAttributes mainAttributes = mainType.getAttributes();
final TextAttributes attributes;
if (additionalType == null) {
attributes = mainAttributes;
} else {
attributes = additionalType.getAttributes().clone();
attributes.setBackgroundColor(mainAttributes.getBackgroundColor());
}
Application application = ApplicationManager.getApplication();
if (application.isDispatchThread()) {
console.printToHistory(string, attributes);