*/
public static IViewPart getView(boolean show, String id) {
IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
IViewReference[] view = page.getViewReferences();
IViewReference infoRef = null;
for (IViewReference reference : view) {
if (reference.getId().equals(id)) {
infoRef = reference;
break;
}
}
// JONES: need to get the part and set the selection to null so that the
// last selected
// feature will not flash (because it will not be in list any more).
IViewPart infoView = null;
if (infoRef == null) {
try {
infoView = page.showView(id);
} catch (PartInitException e1) {
return null;
}
if (infoView == null) {
return null;
}
}
if (infoRef != null)
return (IViewPart) infoRef.getPart(show);
return null;
}