Search in sources :

Example 1 with IConsoleView

use of org.eclipse.ui.console.IConsoleView 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 2 with IConsoleView

use of org.eclipse.ui.console.IConsoleView in project ch.hsr.ifs.cdttesting by IFS-HSR.

the class Console method revealConsole.

private static void revealConsole() {
    IConsole myConsole = findConsole(name);
    IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
    String id = IConsoleConstants.ID_CONSOLE_VIEW;
    IConsoleView view;
    try {
        view = (IConsoleView) page.showView(id);
        view.display(myConsole);
    } catch (PartInitException e) {
        return;
    }
}
Also used : IConsoleView(org.eclipse.ui.console.IConsoleView) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IConsole(org.eclipse.ui.console.IConsole) PartInitException(org.eclipse.ui.PartInitException)

Example 3 with IConsoleView

use of org.eclipse.ui.console.IConsoleView in project mdw-designer by CenturyLinkCloud.

the class WorkflowLaunchConfiguration method writeToConsole.

protected void writeToConsole(String name, String toWrite) throws IOException {
    ConsolePlugin plugin = ConsolePlugin.getDefault();
    IConsoleManager conMgr = plugin.getConsoleManager();
    IConsole[] existing = conMgr.getConsoles();
    for (int i = 0; i < existing.length; i++) {
        if (name.equals(existing[i].getName()))
            console = (org.eclipse.ui.console.MessageConsole) existing[i];
    }
    if (console == null) {
        console = new org.eclipse.ui.console.MessageConsole(name, MdwPlugin.getImageDescriptor("icons/extevent.gif"));
        conMgr.addConsoles(new IConsole[] { console });
    }
    console.newMessageStream().write(toWrite);
    MdwPlugin.getDisplay().asyncExec(new Runnable() {

        public void run() {
            IWorkbenchPage page = MdwPlugin.getActivePage();
            if (page != null) {
                try {
                    IConsoleView view = (IConsoleView) page.showView(IConsoleConstants.ID_CONSOLE_VIEW);
                    if (view != null)
                        view.display(console);
                } catch (PartInitException ex) {
                    PluginMessages.log(ex);
                }
            }
        }
    });
}
Also used : ConsolePlugin(org.eclipse.ui.console.ConsolePlugin) IConsole(org.eclipse.ui.console.IConsole) IConsoleManager(org.eclipse.ui.console.IConsoleManager) IConsoleView(org.eclipse.ui.console.IConsoleView) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) PartInitException(org.eclipse.ui.PartInitException)

Aggregations

IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)3 PartInitException (org.eclipse.ui.PartInitException)3 IConsole (org.eclipse.ui.console.IConsole)3 IConsoleView (org.eclipse.ui.console.IConsoleView)3 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)1 ConsolePlugin (org.eclipse.ui.console.ConsolePlugin)1 IConsoleManager (org.eclipse.ui.console.IConsoleManager)1