Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » keep console view in runtime instance up to date
keep console view in runtime instance up to date [message #485918] Tue, 15 September 2009 14:33 Go to next message
Ralf Buschermoehle is currently offline Ralf BuschermoehleFriend
Messages: 81
Registered: July 2009
Member
Hello,

I print messages into the console of the runtime eclipse instance ...

MessageConsoleStream out ...
MessageConsole console ...

final IWorkbench workbench = PlatformUI.getWorkbench();
final IWorkbenchWindow workbenchWindow =
workbench.getActiveWorkbenchWindow();
workbench.getDisplay().asyncExec(new Runnable() {
public void run() {
out.println(message.toString());
console.activate();
IWorkbenchPage page = workbenchWindow.getActivePage();
if (page != null) {
String id = IConsoleConstants.ID_CONSOLE_VIEW;
try {
IConsoleView view = (IConsoleView) page.showView(id);
view.display(console);
} catch (PartInitException e) {
e.printStackTrace();
}
}

Unfortunately the console is currently not updated directly after a
message has been printed to "out" - I tried also

workbenchWindow.getShell().layout();
while (workbench.getDisplay().readAndDispatch());

.... unfortunately with no success. Any ideas how I can keep the console
up to date?

Greetings,

Ralf
[solved] keep console view in runtime instance up to date [message #485930 is a reply to message #485918] Tue, 15 September 2009 14:47 Go to previous message
Ralf Buschermoehle is currently offline Ralf BuschermoehleFriend
Messages: 81
Registered: July 2009
Member
Got it ...

workbenchWindow.getShell().layout();
while (workbench.getDisplay().readAndDispatch());

in an syncExec solved it.

Greetings,

Ralf


Ralf Buschermoehle wrote:
> Hello,
>
> I print messages into the console of the runtime eclipse instance ...
>
> MessageConsoleStream out ...
> MessageConsole console ...
>
> final IWorkbench workbench = PlatformUI.getWorkbench();
> final IWorkbenchWindow workbenchWindow =
> workbench.getActiveWorkbenchWindow();
> workbench.getDisplay().asyncExec(new Runnable() {
> public void run() {
> out.println(message.toString());
> console.activate();
> IWorkbenchPage page = workbenchWindow.getActivePage();
> if (page != null) {
> String id = IConsoleConstants.ID_CONSOLE_VIEW;
> try {
> IConsoleView view = (IConsoleView) page.showView(id);
> view.display(console);
> } catch (PartInitException e) {
> e.printStackTrace();
> }
> }
>
> Unfortunately the console is currently not updated directly after a
> message has been printed to "out" - I tried also
>
> workbenchWindow.getShell().layout();
> while (workbench.getDisplay().readAndDispatch());
>
> ... unfortunately with no success. Any ideas how I can keep the console
> up to date?
>
> Greetings,
>
> Ralf
Previous Topic:Common Navigator and showing external files
Next Topic:Browser Icon Change
Goto Forum:
  


Current Time: Thu Apr 25 17:07:42 GMT 2024

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

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

Back to the top