Given a view id can I find the Perspective(s) it is in [message #754846] |
Fri, 04 November 2011 11:30  |
Eclipse User |
|
|
|
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?
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.26775 seconds