Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » Given a view id can I find the Perspective(s) it is in
Given a view id can I find the Perspective(s) it is in [message #754846] Fri, 04 November 2011 11:30 Go to next message
Eclipse UserFriend
Is is possible to find the open perspectives that reference a particular view in e4?

This is how we did it in eclipse 3.6 using groovy
  
	public Set<String> getActivePerspectiveIdsForGadgetId(String id){		
		Set<String> perspectives = new HashSet<String>();
		def window = workbench.getActiveWorkbenchWindow();
		def page = window.getActivePage();
		def openPerspectives = page.getOpenPerspectives();
		for (def openPerspective : openPerspectives) {
			def perspective = page.findPerspective(openPerspective);
			for (def iViewReference : perspective.getViewReferences()) {
				if (id.equals(iViewReference.getId())) {
					perspectives.add(openPerspective.getId());
				}
			}
		}
		return perspectives;
	}

In e4 page.findPerspective(openPerspective) doesn't work because the method is no longer on the IWorkbenchPage API.

I couldn't find anything in the IWorkBenchPage API that would allow me to do this now.

Any suggestions?
Re: Given a view id can I find the Perspective(s) it is in [message #755230 is a reply to message #754846] Mon, 07 November 2011 13:23 Go to previous messageGo to next message
Eclipse UserFriend
No Message Body
Re: Given a view id can I find the Perspective(s) it is in [message #755234 is a reply to message #755230] Mon, 07 November 2011 13:31 Go to previous messageGo to next message
Eclipse UserFriend
Ooops, sorry.

I would work with the org.eclipse.e4.ui.workbench.modeling.EModelService in Eclipse 4.

IWorkbenchPage never had an findPerspective(*) method, that was an implementation detail on WorkbenchPage (an internal class).

PW

Re: Given a view id can I find the Perspective(s) it is in [message #787364 is a reply to message #755234] Tue, 31 January 2012 08:57 Go to previous message
Eclipse UserFriend
I added an example how to find the perspective of a given View ID to my Eclipse 4 Service Tutorial.

I hope this helps.
Previous Topic:Contributing to e4
Next Topic:"Handler service cannot be null" exception in launching eclipse product.
Goto Forum:
  


Current Time: Wed Jul 23 13:34:50 EDT 2025

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

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

Back to the top