Search in sources :

Example 41 with IConsoleManager

use of org.eclipse.ui.console.IConsoleManager in project tmdm-studio-se by Talend.

the class MDMServerConsoleFactory method showMDMServerConsole.

public void showMDMServerConsole(MDMServerDef serverDef) {
    IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (window == null) {
        return;
    }
    IWorkbenchPage page = window.getActivePage();
    if (page == null) {
        return;
    }
    Map<String, MDMServerMessageConsole> serverToConsole = getServerToConsole();
    MDMServerMessageConsole mdmServerConsole = serverToConsole.get(serverDef.getName());
    if (mdmServerConsole == null) {
        mdmServerConsole = createMDMServerMessageConsole(serverDef);
        serverToConsole.put(serverDef.getName(), mdmServerConsole);
    }
    if (!containedMDMServerMessageConsole(mdmServerConsole)) {
        IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
        consoleManager.addConsoles(new IConsole[] { mdmServerConsole });
        mdmServerConsole.activate();
    } else {
        mdmServerConsole.setServerDef(serverDef);
        mdmServerConsole.reload();
        ConsolePlugin.getDefault().getConsoleManager().showConsoleView(mdmServerConsole);
    }
// boolean showed = showConsoleView(serverDef.getName());
// if (showed) {
// }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) IConsoleManager(org.eclipse.ui.console.IConsoleManager) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage)

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