Search in sources :

Example 11 with IConsoleManager

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;
}
Also used : IConsoleManager(org.eclipse.ui.console.IConsoleManager) MessageConsole(org.eclipse.ui.console.MessageConsole) ConsolePlugin(org.eclipse.ui.console.ConsolePlugin) IConsole(org.eclipse.ui.console.IConsole)

Aggregations

IConsoleManager (org.eclipse.ui.console.IConsoleManager)11 IConsole (org.eclipse.ui.console.IConsole)9 ConsolePlugin (org.eclipse.ui.console.ConsolePlugin)8 MessageConsole (org.eclipse.ui.console.MessageConsole)8 IOConsole (org.eclipse.ui.console.IOConsole)3 MessageConsoleStream (org.eclipse.ui.console.MessageConsoleStream)2 BufferedReader (java.io.BufferedReader)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 OutputStream (java.io.OutputStream)1 PrintStream (java.io.PrintStream)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 IFileInfo (org.eclipse.core.filesystem.IFileInfo)1 IFileStore (org.eclipse.core.filesystem.IFileStore)1 CoreException (org.eclipse.core.runtime.CoreException)1 IStatus (org.eclipse.core.runtime.IStatus)1 Status (org.eclipse.core.runtime.Status)1