Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to open console and problems view while running a job
How to open console and problems view while running a job [message #896602] Thu, 19 July 2012 06:11 Go to next message
Latha Shankara is currently offline Latha ShankaraFriend
Messages: 33
Registered: June 2012
Member
Hi,

I am using the below code to open the console view,

try {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IConsoleConstants.ID_CONSOLE_VIEW);
} catch (PartInitException ex) {
ex.printStackTrace();
}
But I get a NullPointerException since getActiveWorkbenchWindow() method returns null for a non ui thread.

Is there a way to open the console and problems view from within a job,

Thanks,
Latha
Re: How to open console and problems view while running a job [message #896630 is a reply to message #896602] Thu, 19 July 2012 08:26 Go to previous messageGo to next message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
Hi Latha,

use the UIJob or call the code in (a)syncExec as follows
Display.getDefault().(a)syncExec(new Runnable() {

    public void run() {
        try {
            PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(IConsoleConstants.ID_CONSOLE_VIEW);
        } catch (PartInitException ex) {
            ex.printStackTrace();
        }
    }
});

[Updated on: Thu, 19 July 2012 08:27]

Report message to a moderator

Re: How to open console and problems view while running a job [message #896662 is a reply to message #896630] Thu, 19 July 2012 10:23 Go to previous messageGo to next message
Latha Shankara is currently offline Latha ShankaraFriend
Messages: 33
Registered: June 2012
Member
Hi Jan,

Thanks for your answer.

Is there a way to get the view without using PlatformUI?

I found that a console view could be shown/open without using PlatformUI like in the below link http://wiki.eclipse.org/FAQ_How_do_I_write_to_the_console_from_a_plug-in%3F
but wanted to know if I could do a similar one to open Problems view.

Thanks,
Latha
Re: How to open console and problems view while running a job [message #896664 is a reply to message #896662] Thu, 19 July 2012 10:32 Go to previous message
Jan Krakora is currently offline Jan KrakoraFriend
Messages: 477
Registered: December 2009
Location: Prague
Senior Member
As far I know it's not.
Previous Topic:standalone RCP how to remove eclipse ide things?
Next Topic:Dynamic tables in a view
Goto Forum:
  


Current Time: Mon Oct 14 11:32:28 GMT 2024

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

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

Back to the top