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));
}
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());
}
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;
}
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 });
}
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;
}
Aggregations