Pergunta

So, I'm working on an Eclipse Plugin which includes a custom view based on analysis of source code. The majority of the time, it works great. However, if I quit Eclipse with that view open, when I reopen it, it runs into an error with either IWorkbenchWindow.getActivePage() or IWorkbenchPage.getEditorReferences() returning null. This inconsistency seems to be because the view has the focus when Eclipse quits and is the first thing that Eclipse tries to reconstruct on start up. the focus is on a non-window shell (I don't fully understand this, but that's what this said). Is there a workaround so that I can ensure that Eclipse fully loads its IWorkbenchWindow before my custom plugin regardless of what has the focus when Eclipse closes?

Thanks

Foi útil?

Solução

You can consider using the site instead: getSite().getPage()...

Outras dicas

Tonny Madsen pointed out in the comments that, from within a View, I can access the Active Page from getSite().getPage(), which solved the issues.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top