Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to get all open views(Get all currently open views in the workbench)
How to get all open views [message #687812] Thu, 23 June 2011 09:49 Go to next message
Serge  is currently offline Serge
Messages: 76
Registered: July 2009
Member
Hello everyone

I'm trying to retrieve all open views that are currently open in a workbench. I have several perspectives open in which I've opened some views. So far I've failed to get all of them at once. I couldn't even find out of how to get all open views from a certain perspective. Does anyone know how this could be done?

Thanks a lot.
Re: How to get all open views [message #689510 is a reply to message #687812] Mon, 27 June 2011 18:38 Go to previous messageGo to next message
Chaitannya  is currently offline Chaitannya
Messages: 14
Registered: May 2010
Junior Member
I don't know if you can get a list of all Open views, here's a way I test if a view is open.
	IWorkbenchPage activePage = PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getActivePage();
		IViewPart view = activePage.findView(viewID);

		if (view != null) {
                   View is open
		}


Now you will have to map it with your perspective.
Re: How to get all open views [message #698084 is a reply to message #687812] Mon, 18 July 2011 18:25 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can only find out the views open in the active perspective in a window. Inactive perspectives don't usually tell you anything. Given that, the method you want is org.eclipse.ui.IWorkbenchPage.getViewReferences()

PW




Re: How to get all open views [message #720403 is a reply to message #687812] Tue, 30 August 2011 14:16 Go to previous message
Marco Lopes is currently offline Marco Lopes
Messages: 56
Registered: September 2010
Member
So, if i want to close specific Workbench views (and i do), i have to:

1) iterate over ALL the Perspectives
2) SET the perspective (make it active)
3) iterate over all the perspective views

?

Thanks.
Previous Topic:[SOLVED] How to CLOSE a console View?
Next Topic:Is it possible to have preset workbench layouts?
Goto Forum:
  


Current Time: Sat Oct 25 05:40:29 GMT 2014

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

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