### Eclipse Workspace Patch 1.0 #P org.eclipse.mylyn.ide.ui Index: plugin.xml =================================================================== RCS file: /cvsroot/tools/org.eclipse.mylyn/org.eclipse.mylyn.ide.ui/plugin.xml,v retrieving revision 1.59 diff -u -r1.59 plugin.xml --- plugin.xml 25 Sep 2007 21:45:56 -0000 1.59 +++ plugin.xml 22 Oct 2007 12:36:17 -0000 @@ -97,7 +97,23 @@ toolbarPath="mylyn" tooltip="Focus on Active Task"> - + + + + + Index: src/org/eclipse/mylyn/internal/ide/ui/actions/FocusBookmarkMarkersViewAction.java =================================================================== RCS file: src/org/eclipse/mylyn/internal/ide/ui/actions/FocusBookmarkMarkersViewAction.java diff -N src/org/eclipse/mylyn/internal/ide/ui/actions/FocusBookmarkMarkersViewAction.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ src/org/eclipse/mylyn/internal/ide/ui/actions/FocusBookmarkMarkersViewAction.java 1 Jan 1970 00:00:00 -0000 @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2004, 2007 Mylyn project committers and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + *******************************************************************************/ + +package org.eclipse.mylyn.internal.ide.ui.actions; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; + +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.mylyn.monitor.core.StatusHandler; +import org.eclipse.ui.IViewPart; +import org.eclipse.ui.views.markers.internal.BookmarkView; +import org.eclipse.ui.views.markers.internal.TableView; + +public class FocusBookmarkMarkersViewAction extends AbstractFocusMarkerViewAction { + + @Override + public List getViewers() { + List viewers = new ArrayList(); + if (cachedViewer == null) { + try { + IViewPart viewPart = super.getPartForAction(); + if (viewPart instanceof BookmarkView) { + Class infoClass = TableView.class; + Method method = infoClass.getDeclaredMethod("getViewer", new Class[] {}); + method.setAccessible(true); + cachedViewer = (StructuredViewer) method.invoke(viewPart, new Object[] {}); + updateMarkerViewLabelProvider(cachedViewer); + } + } catch (Exception e) { + StatusHandler.log(e, "couldn't get bookmarks view viewer"); + } + } + if (cachedViewer != null) + viewers.add(cachedViewer); + return viewers; + } + + + +}