public class ConsoleUtils {
/** Finds an existing {@link MessageConsole} with given name.
* If it doesn't exist, create a new one. */
public static MessageConsole findOrCreateMessageConsole(String name) {
MessageConsole console = findConsole(name, MessageConsole.class);
if(console != null) {
return console;
}
// no console, so create a new one
MessageConsole msgConsole = new MessageConsole(name, null);
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { msgConsole });
return msgConsole;
}