Search in sources :

Example 36 with IConsoleManager

use of org.eclipse.ui.console.IConsoleManager in project titan.EclipsePlug-ins by eclipse.

the class AstWalkerRunnerJava method findConsole.

private static MessageConsole findConsole(String name) {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();
    for (int i = 0; i < existing.length; i++) if (name.equals(existing[i].getName()))
        return (MessageConsole) existing[i];
    // no console found, so create a new one
    MessageConsole myConsole = new MessageConsole(name, 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)

Example 37 with IConsoleManager

use of org.eclipse.ui.console.IConsoleManager in project jbosstools-hibernate by jbosstools.

the class KnownConfigurations method removeLoggingStream.

private void removeLoggingStream(ConsoleConfiguration oldConfig) {
    Object[] object = loggingStreams.remove(oldConfig.getName());
    if (object != null) {
        MessageConsole mc = (MessageConsole) object[0];
        MessageConsoleStream stream = (MessageConsoleStream) object[1];
        try {
            stream.close();
        } catch (IOException ie) {
        /* ignore */
        }
        ;
        IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
        consoleManager.removeConsoles(new IConsole[] { mc });
    }
}
Also used : IConsoleManager(org.eclipse.ui.console.IConsoleManager) MessageConsole(org.eclipse.ui.console.MessageConsole) MessageConsoleStream(org.eclipse.ui.console.MessageConsoleStream) IOException(java.io.IOException)

Example 38 with IConsoleManager

use of org.eclipse.ui.console.IConsoleManager in project arduino-eclipse-plugin by Sloeber.

the class Helpers method findConsole.

public static MessageConsole findConsole(String name) {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();
    for (int i = 0; i < existing.length; i++) if (name.equals(existing[i].getName()))
        return (MessageConsole) existing[i];
    // no console found, so create a new one
    MessageConsole myConsole = new MessageConsole(name, 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)

Example 39 with IConsoleManager

use of org.eclipse.ui.console.IConsoleManager in project jbosstools-openshift by jbosstools.

the class ConsoleUtils method findMessageConsole.

/**
 * Retrieve the message console given its name. If no console exists yet, a
 * new one is created with a specifi attribute to mark it as an 'openshift'
 * console. This attribute (or marker) is use later on by the
 * ConsoleTypePropertyTester to add a 'remove' button on the console in the
 * consoles view.
 *
 * @param name
 *            the name of the console to find
 * @return the message console (found or created)
 */
public static MessageConsole findMessageConsole(String name) {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager consoleManager = plugin.getConsoleManager();
    IConsole[] existing = consoleManager.getConsoles();
    for (int i = 0; i < existing.length; i++) {
        if (name.equals(existing[i].getName())) {
            return (MessageConsole) existing[i];
        }
    }
    // no console found, so create a new one
    MessageConsole console = new MessageConsole(name, null);
    console.setAttribute(CONSOLE_TYPE_KEY, CONSOLE_TYPE_VALUE);
    consoleManager.addConsoles(new IConsole[] { console });
    return console;
}
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)

Example 40 with IConsoleManager

use of org.eclipse.ui.console.IConsoleManager in project jbosstools-openshift by jbosstools.

the class ConsoleUtils method deregisterConsoleListener.

/**
 * Deregister the given listener as a console listener.
 *
 * @param consoleListener
 */
public static void deregisterConsoleListener(IConsoleListener consoleListener) {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager consoleManager = plugin.getConsoleManager();
    consoleManager.removeConsoleListener(consoleListener);
}
Also used : IConsoleManager(org.eclipse.ui.console.IConsoleManager) ConsolePlugin(org.eclipse.ui.console.ConsolePlugin)

Aggregations

IConsoleManager (org.eclipse.ui.console.IConsoleManager)41 IConsole (org.eclipse.ui.console.IConsole)32 ConsolePlugin (org.eclipse.ui.console.ConsolePlugin)31 MessageConsole (org.eclipse.ui.console.MessageConsole)25 IOConsole (org.eclipse.ui.console.IOConsole)4 MessageConsoleStream (org.eclipse.ui.console.MessageConsoleStream)4 IOException (java.io.IOException)2 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)2 BufferedReader (java.io.BufferedReader)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