Search in sources :

Example 11 with IConsole

use of org.eclipse.ui.console.IConsole in project abstools by abstools.

the class SDAction method findConsole.

private MessageConsole findConsole() {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();
    for (int i = 0; i < existing.length; i++) {
        // System.out.println("Console \"" + existing[i].getName() + "\" found");
        if (ID_CONSOLE_VIEW.equals(existing[i].getName()))
            return (MessageConsole) existing[i];
    }
    // no console found, so create a new one
    MessageConsole myConsole = new MessageConsole(ID_CONSOLE_VIEW, 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 12 with IConsole

use of org.eclipse.ui.console.IConsole in project abstools by abstools.

the class ConsoleHandler method findCostabsConsole.

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

use of org.eclipse.ui.console.IConsole in project liferay-ide by liferay.

the class UITestsUtils method getConsole.

public static IConsole getConsole(String name) {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();
    for (int i = 0; i < existing.length; i++) if ((existing[i].getName()).contains(name))
        return existing[i];
    return null;
}
Also used : IConsoleManager(org.eclipse.ui.console.IConsoleManager) ConsolePlugin(org.eclipse.ui.console.ConsolePlugin) IConsole(org.eclipse.ui.console.IConsole)

Example 14 with IConsole

use of org.eclipse.ui.console.IConsole in project liferay-ide by liferay.

the class CompileAction method getConsole.

public static IConsole getConsole(String name) {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();
    for (int i = 0; i < existing.length; i++) {
        if ((existing[i].getName()).contains(name)) {
            return existing[i];
        }
    }
    return null;
}
Also used : IConsoleManager(org.eclipse.ui.console.IConsoleManager) ConsolePlugin(org.eclipse.ui.console.ConsolePlugin) IConsole(org.eclipse.ui.console.IConsole)

Example 15 with IConsole

use of org.eclipse.ui.console.IConsole in project n4js by eclipse.

the class EclipseUtils method getOrCreateConsole.

/**
 * Get or create the console with the given name in the console view.
 */
public static MessageConsole getOrCreateConsole(String name, boolean create, boolean reveal) {
    MessageConsole result = null;
    final ConsolePlugin plugin = ConsolePlugin.getDefault();
    final IConsoleManager mgr = plugin.getConsoleManager();
    final IConsole[] consoles = mgr.getConsoles();
    for (int i = 0; i < consoles.length; i++) {
        final IConsole currConsole = consoles[i];
        if (currConsole instanceof MessageConsole && name.equals(currConsole.getName())) {
            result = (MessageConsole) currConsole;
            break;
        }
    }
    if (result == null && create) {
        final MessageConsole newConsole = new MessageConsole(name, null);
        mgr.addConsoles(new IConsole[] { newConsole });
        result = newConsole;
    }
    if (result != null && reveal) {
        revealConsole(result);
    }
    return result;
}
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

IConsole (org.eclipse.ui.console.IConsole)50 IConsoleManager (org.eclipse.ui.console.IConsoleManager)32 ConsolePlugin (org.eclipse.ui.console.ConsolePlugin)28 MessageConsole (org.eclipse.ui.console.MessageConsole)22 IOConsole (org.eclipse.ui.console.IOConsole)6 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)4 PartInitException (org.eclipse.ui.PartInitException)4 IOException (java.io.IOException)3 CoreException (org.eclipse.core.runtime.CoreException)3 IProcess (org.eclipse.debug.core.model.IProcess)3 IConsoleView (org.eclipse.ui.console.IConsoleView)3 TextConsole (org.eclipse.ui.console.TextConsole)3 ArrayList (java.util.ArrayList)2 Matcher (java.util.regex.Matcher)2 Pattern (java.util.regex.Pattern)2 IProcessTerminationListener (net.vtst.eclipse.easyxtext.ui.launching.EasyLaunchConfigurationDelegateUtils.IProcessTerminationListener)2 EasyPatternMatchListener (net.vtst.eclipse.easyxtext.ui.launching.EasyPatternMatchListener)2 IMarker (org.eclipse.core.resources.IMarker)2 BadLocationException (org.eclipse.jface.text.BadLocationException)2 IOConsoleOutputStream (org.eclipse.ui.console.IOConsoleOutputStream)2