Search in sources :

Example 21 with IConsole

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

the class AstWalkerJava 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 22 with IConsole

use of org.eclipse.ui.console.IConsole in project soot by Sable.

the class SootPlugin method findConsole.

private 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 23 with IConsole

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

the class ConsoleLogger method showConsole.

private void showConsole() {
    DefaultLoader.getIdeHelper().invokeAndWait(() -> {
        IConsole myConsole = this.console;
        IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
        if (window != null) {
            IWorkbenchPage page = window.getActivePage();
            if (page != null) {
                String id = IConsoleConstants.ID_CONSOLE_VIEW;
                IConsoleView view;
                try {
                    view = (IConsoleView) page.showView(id);
                    view.display(myConsole);
                } catch (PartInitException e) {
                    e.printStackTrace();
                }
            }
        }
    });
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IConsoleView(org.eclipse.ui.console.IConsoleView) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IConsole(org.eclipse.ui.console.IConsole) PartInitException(org.eclipse.ui.PartInitException)

Example 24 with IConsole

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

the class ConsoleLogger method findConsole.

private MessageConsole findConsole(String name) {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMan = plugin.getConsoleManager();
    IConsole[] existing = conMan.getConsoles();
    for (int i = 0; i < existing.length; i++) {
        System.out.println(existing[i].getType());
        if (name.equals(existing[i].getName()) && existing[i] instanceof MessageConsole) {
            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 25 with IConsole

use of org.eclipse.ui.console.IConsole in project erlide_eclipse by erlang.

the class ConsoleRemoveLaunchAction method getLaunch.

protected ILaunch getLaunch() {
    if (fConsoleView == null) {
        return fLaunch;
    }
    // else get dynamically, as this action was created via plug-in XML view
    // contribution
    final IConsole console = fConsoleView.getConsole();
    if (console instanceof ErlangConsole) {
        final ErlangConsole pconsole = (ErlangConsole) console;
        final IBackend backend = pconsole.getBackend();
        return backend.getData().getLaunch();
    }
    return null;
}
Also used : ErlangConsole(org.erlide.ui.console.ErlangConsole) IBackend(org.erlide.backend.api.IBackend) 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