IWorkbenchPage page= getSite().getPage(); IViewPart view= view= page.findView("org.eclipse.ui.views.TaskList"); if (view instanceof TaskList) { StructuredSelection ss= new StructuredSelection(marker); ((TaskList) view).setSelection(ss, true);
try { boolean isProblem= marker.isSubtypeOf(IMarker.PROBLEM); IWorkbenchPage page= getSite().getPage(); IViewPart view= view= page.findView(isProblem ? IPageLayout.ID_PROBLEM_VIEW: IPageLayout.ID_TASK_LIST); Method method= view.getClass().getMethod("setSelection", new Class[] { IStructuredSelection.class, boolean.class}); method.invoke(view, new Object[] {new StructuredSelection(marker), Boolean.TRUE }); } catch (CoreException x) { } catch (NoSuchMethodException x) { } catch (IllegalAccessException x) { } catch (InvocationTargetException x) {
	public void gotoAnnotation(boolean forward) {				ISelectionProvider provider= getSelectionProvider();				ITextSelection s= (ITextSelection) provider.getSelection();		Position annotationPosition= new Position(0, 0);		Annotation nextAnnotation= getNextAnnotation(s.getOffset(), s.getLength(),forward, annotationPosition);				setStatusLineErrorMessage(null);		if (nextAnnotation != null) {						IMarker marker= null;			if (nextAnnotation instanceof MarkerAnnotation)				marker= ((MarkerAnnotation) nextAnnotation).getMarker();			else if (nextAnnotation instanceof IJavaAnnotation) {				Iterator e= ((IJavaAnnotation)nextAnnotation).getOverlaidIterator();				if (e != null) {					while (e.hasNext()) {						Object o= e.next();						if (o instanceof MarkerAnnotation) {							marker= ((MarkerAnnotation) o).getMarker();							break;						}					}				}			}						if (marker != null) {				IWorkbenchPage page= getSite().getPage();				IViewPart view= view= page.findView("org.eclipse.ui.views.TaskList"); //$NON-NLS-1$				if (view instanceof TaskList) {					StructuredSelection ss= new StructuredSelection(marker);					((TaskList) view).setSelection(ss, true);				}			}						selectAndReveal(annotationPosition.getOffset(), annotationPosition.getLength());			if (nextAnnotation instanceof IJavaAnnotation && ((IJavaAnnotation)nextAnnotation).isProblem())				setStatusLineErrorMessage(((IJavaAnnotation)nextAnnotation).getMessage());		}	}