use of org.eclipse.ui.console.IConsoleManager in project knime-core by knime.
the class ConsoleViewAppender method findConsole.
/**
* Looks up the console view that is responsible for the given event, does
* not activate the view.
*
* @param consoleName The name of the console to look up
*/
private MessageConsole findConsole(final String consoleName) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
IConsole[] existing = conMan.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (consoleName.equals(existing[i].getName())) {
return (MessageConsole) existing[i];
}
}
// no console found, so create a new one
MessageConsole myConsole = new MessageConsole(consoleName, null);
conMan.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
use of org.eclipse.ui.console.IConsoleManager in project ch.hsr.ifs.cdttesting by IFS-HSR.
the class Console method findConsole.
private static MessageConsole findConsole(String name) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager consoleManager = plugin.getConsoleManager();
IConsole[] existing = consoleManager.getConsoles();
for (int i = 0; i < existing.length; i++) {
if (name.equals(existing[i].getName())) {
return (MessageConsole) existing[i];
}
}
return createNewConsole(name, consoleManager);
}
use of org.eclipse.ui.console.IConsoleManager in project liferay-ide by liferay.
the class ConsoleContentCondition method test.
@Override
public boolean test() throws Exception {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager manager = plugin.getConsoleManager();
IConsole[] consoles = manager.getConsoles();
for (IConsole console : consoles) {
if (console.getName().contains(_consoleName) && console instanceof TextConsole) {
IDocument content = ((TextConsole) console).getDocument();
_lastContent = content.get();
return _lastContent.contains(_content);
}
}
return false;
}
use of org.eclipse.ui.console.IConsoleManager in project mdw-designer by CenturyLinkCloud.
the class MessageConsole method findConsole.
public static MessageConsole findConsole(String name, ImageDescriptor icon, Display display) {
IConsoleManager conMan = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] existingConsoles = conMan.getConsoles();
for (IConsole existingConsole : existingConsoles) {
if (existingConsole.getName().startsWith(name))
return (MessageConsole) existingConsole;
}
// no console found, so create a new one
MessageConsole messageConsole = new MessageConsole(name, icon, display);
conMan.addConsoles(new IConsole[] { messageConsole });
return messageConsole;
}
use of org.eclipse.ui.console.IConsoleManager 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);
}
}
}
});
}
Aggregations