[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform] Re: Common Navigator showing expanded folders

Try this:

PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findViewReference().getView(false)

This gets the part only if it has been actually created, so you should not get those errors of it being in the middle of creation.

Mark Lovell wrote:
I am getting closer...

I tried PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().findView(viewID);


But under certain conditions I get org.eclipse.ui.PartInitException: Warning: Detected recursive attempt by part <my navigator view> to create itself (this is probably, but not necessarily, a bug)


This happens when my navigator is behind another view (but I can see the tab) when I click the tab to bring the view to the surface, I get this error.

It appears that findView does more than simply return a pointer.

I can do it by calling getViewReferences(), iterating and getting the one whose id matches the common navigator. But there should be a better way.

So.... Is there another way to just get a pointer to the view? It is kind of unfortunate that I have to get the common navigator from the view id, because it is exactly the common navigator that is calling my label provider.


Help?






--
Common Navigator Framework section in Platform Plugin Developer Guide (Programmer's Guide)


http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.isv/guide/cnf.htm

http://dev.eclipse.org/blogs/francis
http://wiki.eclipse.org/Common_Navigator_Framework
http://wiki.eclipse.org/Common_Navigator_Framework_Use_Cases


You have brains in your head. You have feet in your shoes. - Dr Seuss, Oh the Places You'll Go