use of org.eclipse.ui.console.IConsole in project abstools by abstools.
the class ConsoleHandler method findCostabsConsole.
public static MessageConsole findCostabsConsole() {
ConsolePlugin plugin = ConsolePlugin.getDefault();
IConsoleManager conMan = plugin.getConsoleManager();
IConsole[] existing = conMan.getConsoles();
for (int i = 0; i < existing.length; i++) if (ID_CONSOLE_VIEW.equals(existing[i].getName()))
return (MessageConsole) existing[i];
// no console found, so create a new one
MessageConsole myConsole = new MessageConsole(ID_CONSOLE_VIEW, null);
conMan.addConsoles(new IConsole[] { myConsole });
return myConsole;
}
use of org.eclipse.ui.console.IConsole in project azure-tools-for-java by Microsoft.
the class Activator method findConsole.
public static MessageConsole findConsole(String name) {
ConsolePlugin consolePlugin = ConsolePlugin.getDefault();
IConsoleManager conMan = consolePlugin.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 messageConsole = new MessageConsole(name, null);
conMan.addConsoles(new IConsole[] { messageConsole });
return messageConsole;
}
use of org.eclipse.ui.console.IConsole in project titan.EclipsePlug-ins by eclipse.
the class ConsoleWriter method findConsole.
/**
* Try to get a console with a given name. If a Console is not found
* a new console will be created
* @param name of the given console
* @return The Console
*/
private MessageConsole findConsole(final String name) {
ConsolePlugin plugin = ConsolePlugin.getDefault();
// Protection, Activator.stop exception...
if (plugin == null) {
return null;
}
IConsoleManager conMan = plugin.getConsoleManager();
IConsole[] existing = conMan.getConsoles();
for (IConsole anExisting : existing) {
if (name.equals(anExisting.getName())) {
return (MessageConsole) anExisting;
}
}
// 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.IConsole in project titan.EclipsePlug-ins by eclipse.
the class ExecutorMonitorView method createPartControl.
@Override
public void createPartControl(final Composite parent) {
viewer = new TreeViewer(parent, SWT.H_SCROLL | SWT.V_SCROLL);
contentProvider = new ExecutorMonitorContentProvider();
viewer.setContentProvider(contentProvider);
labelProvider = new ExecutorMonitorLabelProvider();
viewer.setLabelProvider(labelProvider);
createActions();
manager = new MenuManager("menuManager");
createEmptyContextMenu();
createToolBar();
Activator.setMainView(this);
viewer.setInput(getInitialInput());
viewer.expandToLevel(2);
updateActions();
getSite().setSelectionProvider(viewer);
launchListener = new LaunchesListener(this);
DebugPlugin.getDefault().getLaunchManager().addLaunchListener(launchListener);
selectionChangedListener = new ISelectionChangedListener() {
@Override
public void selectionChanged(final SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
ITreeLeaf element = (ITreeLeaf) selection.getFirstElement();
updateActions();
if (null == element) {
return;
}
if (element instanceof LaunchElement) {
createLauncherContextMenu();
} else if (element instanceof MainControllerElement) {
createExecutorContextMenu((MainControllerElement) element);
BaseExecutor executor = ((MainControllerElement) element).executor();
IProcess process = executor.getProcess();
if (null == process) {
return;
}
IConsole console = DebugUITools.getConsole(process);
if (null == console) {
return;
}
IConsole[] consoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
boolean exists = false;
for (IConsole console2 : consoles) {
if (console2.equals(console)) {
exists = true;
}
}
if (!exists) {
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[] { console });
}
ConsolePlugin.getDefault().getConsoleManager().showConsoleView(console);
ConsolePlugin.getDefault().getConsoleManager().refresh(console);
} else {
createEmptyContextMenu();
}
}
};
viewer.addSelectionChangedListener(selectionChangedListener);
}
use of org.eclipse.ui.console.IConsole in project titan.EclipsePlug-ins by eclipse.
the class AstWalkerRunnerJava 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;
}
Aggregations