Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Page not available when view is initialized
Page not available when view is initialized [message #437219] Fri, 23 September 2005 12:38 Go to next message
Eclipse UserFriend
Originally posted by: stefan.renz.web.de

Hi all,

I have an RCP application with a view wich should listen to part events.

public void createPartControl(Composite parent)
{
...

getSite().getWorkbenchWindow().getActivePage().addPartListen er(myPartListener);
...
}

This worked fine until I activated the automatic restore functionality of
the workbench (IWorkbenchConfigurer.setSaveAndRestore(true))

Now I get a NullpointerException because the page is null when my view is
created.
Can anyone tell me where there is the best location to register the part
listener ?

Thanks in advance
Re: Page not available when view is initialized [message #437221 is a reply to message #437219] Fri, 23 September 2005 12:59 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Stefan Renz wrote:
> Hi all,
> I have an RCP application with a view wich should listen to part events.
> public void createPartControl(Composite parent)
> {
> ...
>
> getSite().getWorkbenchWindow().getActivePage().addPartListen er(myPartListener);
>
> ...

You should probably use getSite().getPage().addPartListener(mpl); Also,
you can do the work in one of the IViewPart#init(...) methods.

Later,
PW


Previous Topic:Forcing start of a plugin
Next Topic:editorpart menuManager
Goto Forum:
  


Current Time: Sat Dec 14 16:36:45 GMT 2024

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

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

Back to the top