Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 15:30 Go to next message
Josh Davis is currently offline Josh DavisFriend
Messages: 20
Registered: August 2011
Junior Member
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 18:23 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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 18:31 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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 13:57 Go to previous message
Lars Vogel is currently offline Lars VogelFriend
Messages: 1098
Registered: July 2009
Senior Member

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: Sat Apr 20 11:55:22 GMT 2024

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

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

Back to the top