Search in sources :

Example 6 with MessageConsole

use of org.eclipse.ui.console.MessageConsole in project linuxtools by eclipse.

the class CreaterepoUtilsTest method testFindConsoleSameObject.

/**
 * Test if findConsole method finds correct console.
 */
@Test
public void testFindConsoleSameObject() {
    MessageConsole createrepoConsole = new MessageConsole(CONSOLE_NAME, null, null, true);
    manager.addConsoles(new IConsole[] { // $NON-NLS-1$
    new MessageConsole("DummyConsole1", null, null, true), createrepoConsole, // $NON-NLS-1$
    new MessageConsole("DummyConsole2", null, null, true) });
    assertEquals(3, manager.getConsoles().length);
    assertEquals(createrepoConsole, CreaterepoUtils.findConsole(CONSOLE_NAME));
}
Also used : MessageConsole(org.eclipse.ui.console.MessageConsole) Test(org.junit.Test)

Example 7 with MessageConsole

use of org.eclipse.ui.console.MessageConsole in project linuxtools by eclipse.

the class CreaterepoUtilsTest method testCreateConsoleIfNotFound.

/**
 * Test if findConsole creates a console with correct name.
 */
@Test
public void testCreateConsoleIfNotFound() {
    MessageConsole console = CreaterepoUtils.findConsole(CONSOLE_NAME);
    assertNotNull(console);
    assertEquals(CONSOLE_NAME, console.getName());
}
Also used : MessageConsole(org.eclipse.ui.console.MessageConsole) Test(org.junit.Test)

Example 8 with MessageConsole

use of org.eclipse.ui.console.MessageConsole in project linuxtools by eclipse.

the class RunRpmlintAction 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 9 with MessageConsole

use of org.eclipse.ui.console.MessageConsole in project yamcs-studio by yamcs.

the class ConsoleViewHandler method close.

/**
 * Usually called by JRE when Logger shuts down, i.e. way after the Eclipse shutdown has already closed the console
 * view
 */
@Override
public void close() throws SecurityException {
    // Mark as detached from console
    final MessageConsole console_copy = console;
    if (console_copy == null)
        return;
    console = null;
    // Remove from 'Console' view
    console_copy.clearConsole();
    final ConsolePlugin consolePlugin = ConsolePlugin.getDefault();
    consolePlugin.getConsoleManager().removeConsoles(new IConsole[] { console_copy });
}
Also used : MessageConsole(org.eclipse.ui.console.MessageConsole) ConsolePlugin(org.eclipse.ui.console.ConsolePlugin)

Example 10 with MessageConsole

use of org.eclipse.ui.console.MessageConsole in project gfm_viewer by satyagraha.

the class LogConsole method createHandler.

public Handler createHandler(Formatter formatter) {
    MessageConsole console = new MessageConsole(name, null);
    console.activate();
    ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
    MessageConsoleStream consoleStream = console.newMessageStream();
    handler = new FlushingStreamHandler(consoleStream, formatter);
    return handler;
}
Also used : MessageConsole(org.eclipse.ui.console.MessageConsole) MessageConsoleStream(org.eclipse.ui.console.MessageConsoleStream)

Aggregations

MessageConsole (org.eclipse.ui.console.MessageConsole)18 IConsoleManager (org.eclipse.ui.console.IConsoleManager)8 ConsolePlugin (org.eclipse.ui.console.ConsolePlugin)7 IConsole (org.eclipse.ui.console.IConsole)7 MessageConsoleStream (org.eclipse.ui.console.MessageConsoleStream)6 Test (org.junit.Test)3 IOException (java.io.IOException)2 IStatus (org.eclipse.core.runtime.IStatus)2 Status (org.eclipse.core.runtime.Status)2 AzureDockerHostsManager (com.microsoft.azure.docker.AzureDockerHostsManager)1 DockerHost (com.microsoft.azure.docker.model.DockerHost)1 EditableDockerHost (com.microsoft.azure.docker.model.EditableDockerHost)1 Azure (com.microsoft.azure.management.Azure)1 VirtualMachine (com.microsoft.azure.management.compute.VirtualMachine)1 DeploymentEventArgs (com.microsoft.azuretools.azurecommons.deploy.DeploymentEventArgs)1 DeploymentEventListener (com.microsoft.azuretools.azurecommons.deploy.DeploymentEventListener)1 AzureManager (com.microsoft.azuretools.sdkmanage.AzureManager)1 AzureUIRefreshEvent (com.microsoft.azuretools.utils.AzureUIRefreshEvent)1 BufferedReader (java.io.BufferedReader)1 File (java.io.File)1