Search in sources :

Example 1 with ConsolePlugin

use of org.eclipse.ui.console.ConsolePlugin in project tesb-studio-se by Talend.

the class RuntimeConsoleUtil method findConsole.

public static IOConsole findConsole() {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();
    for (int i = 0; i < existing.length; i++) {
        if (KARAF_CONSOLE.equals(existing[i].getName()))
            return (IOConsole) existing[i];
    }
    // no console found, so create a new one
    IOConsole myConsole = new IOConsole(KARAF_CONSOLE, null);
    conMan.addConsoles(new IConsole[] { myConsole });
    return myConsole;
}
Also used : IConsoleManager(org.eclipse.ui.console.IConsoleManager) ConsolePlugin(org.eclipse.ui.console.ConsolePlugin) IConsole(org.eclipse.ui.console.IConsole) IOConsole(org.eclipse.ui.console.IOConsole)

Example 2 with ConsolePlugin

use of org.eclipse.ui.console.ConsolePlugin in project tesb-studio-se by Talend.

the class RuntimeConsoleUtil method clearConsole.

public static void clearConsole() {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();
    for (int i = 0; i < existing.length; i++) {
        if (KARAF_CONSOLE.equals(existing[i].getName())) {
            ((IOConsole) existing[i]).destroy();
            conMan.removeConsoles(new IConsole[] { existing[i] });
        }
    }
}
Also used : IConsoleManager(org.eclipse.ui.console.IConsoleManager) ConsolePlugin(org.eclipse.ui.console.ConsolePlugin) IConsole(org.eclipse.ui.console.IConsole) IOConsole(org.eclipse.ui.console.IOConsole)

Example 3 with ConsolePlugin

use of org.eclipse.ui.console.ConsolePlugin in project azure-tools-for-java by Microsoft.

the class Activator method findConsole.

public static MessageConsole findConsole(String name) {
    ConsolePlugin consolePlugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = consolePlugin.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 messageConsole = new MessageConsole(name, null);
    conMan.addConsoles(new IConsole[] { messageConsole });
    return messageConsole;
}
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

ConsolePlugin (org.eclipse.ui.console.ConsolePlugin)3 IConsole (org.eclipse.ui.console.IConsole)3 IConsoleManager (org.eclipse.ui.console.IConsoleManager)3 IOConsole (org.eclipse.ui.console.IOConsole)2 MessageConsole (org.eclipse.ui.console.MessageConsole)1