Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Technology Project and PMC » Writing to the ConsoleView
Writing to the ConsoleView [message #36816] Mon, 02 December 2002 14:46
Eclipse UserFriend
Originally posted by: benjamin.diefenbach.lhsystems.com

After several hours of searching for a easy and fast way to write to the
console window it works now.

Here is the code for doing so.

IViewPart viewPart =
JavaPlugin.getActivePage().findView("org.eclipse.debug.ui.ConsoleView ");
if (viewPart instanceof ConsoleView) {
ConsoleView console = (ConsoleView) viewPart;
console.getConsoleViewer().getDocument().set("Test message");
}

The ConsoleView which you must import is the
"org.eclipse.debug.internal.ui.views.console.ConsoleView" which is
included in the org.eclipse.debug.ui plugin.

If this doesn`t work just look for all Workbenchpages and test if you can
find the view. This may be if the ConsoleWindow is not in the actual
perspective.

IWorkbenchWindow windows[] =
JavaPlugin.getActiveWorkbenchWindow().getWorkbench().getWork benchWindows();
for (int i = 0; i < windows.length; i++) {
IWorkbenchWindow window = windows[i];
IWorkbenchPage pages[] = window.getPages();
for (int j = 0; j < pages.length; j++) {
IWorkbenchPage page = pages[j];
IViewPart foundViewPart = page.
findView("org.eclipse.debug.ui.ConsoleView");
if (foundViewPart != null) {
viewPart = foundViewPart;
}
}
}
Previous Topic:Lomboz j2ee plugin problem
Next Topic:Writing to the ConsoleView
Goto Forum:
  


Current Time: Sat Apr 27 04:17:29 GMT 2024

Powered by FUDForum. Page generated in 0.03468 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top