/** "Clears the console" */ public static void clear() { ConsoleManager.getDisplay() .asyncExec( new Runnable() { public void run() { console.getDocument().set(""); } }); }
/** * Display the specified object in the console, using the specified color, and go to the next line * if it's asked * * @param o the object to display * @param colorValue the color to use * @param cr true to go to the next line, false otherwise */ private static void internalWrite(final Object o, final ColorValue colorValue, final boolean cr) { ConsoleManager.getDisplay() .asyncExec( new Runnable() { public void run() { String message = o.toString(); MessageConsoleStream consoleStream = console.newMessageStream(); consoleStream.setColor(colorValue.getColor()); try { consoleStream.write(message + (cr ? "\n" : "")); consoleStream.close(); } catch (IOException ioe) { Activator.sendErrorToErrorLog(Messages.COM01E.message(), ioe); } } }); }