Community
Participate
Working Groups
I have a problem using the IWorkbenchPage::findViewReference(...) method with view ID and secondary ID parameters. I am calling IViewReference viewRef = activePage.findViewReference("org.eclipse.ui.console.ConsoleView", "mySecondaryID"); and it seems to always return null, even if the console view is open. Internally, I see that findViewReference(...) loops through getViewReferences() and tries to match the IDs. To debug, I added the following logging to my code: IViewReference[] viewRefs = activePage.getViewReferences(); for (IViewReference viewReference : viewRefs) { logger.trace("view ref ID - " + viewReference.getId()); logger.trace("view ref secondary ID - " + viewReference.getSecondaryId()); } The console view is logged as: view ref ID - org.eclipse.ui.console.ConsoleView:mySecondaryID view ref secondary ID - mySecondaryID The main ID is appended with the secondary ID, and thus never gets matched in findViewReference(). I ran the same test with an Indigo environment, and the logging gives: view ref ID - org.eclipse.ui.console.ConsoleView view ref secondary ID - mySecondaryID And it does return the view reference from findViewReference() Thanks
Secondary ID support might have been fixed in Kepler. Eric? PW
See also bug 404795 *** This bug has been marked as a duplicate of bug 401709 ***