use of org.eclipse.ui.console.IConsoleManager in project knime-core by knime.
the class ConsoleViewAppender method findConsole.
/**
* Looks up the console view that is responsible for the given event, does
* not activate the view.
*
* @param consoleName The name of the console to look up
*/
private MessageConsole findConsole(final String consoleName) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
IConsole[] existing = conMan.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (consoleName.equals(existing[i].getName())) {
return (MessageConsole) existing[i];
}
}
// no console found, so create a new one
MessageConsole myConsole = new MessageConsole(consoleName, null);
conMan.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
Aggregations