Bug 211493 [Markers] [Markers] New Markers view slows down traversal in Package Explorer
I20071127-0800 Traversing over elements in the Package Explorer via Arrow_Down key is slowed down by the new Markers view. Steps: - select org.eclipse.jdt.doc.user (from CVS) - press Arrow_Right - press and hold Arrow_Down => selection moves slowly, gets faster after folders with many files have been passed I quickly profiled this and found that a lot of time is burned in org.eclipse.ui.internal.provisional.views.markers.CachedMarkerBuilder$1.run(IProgressMonitor) This is probably because ExtendedMarkersView.createPartControl(Composite) contains: ISelectionListener listener = getPageSelectionListener(); getSite().getPage().addSelectionListener(listener); listener.selectionChanged(getSite().getPage().getActivePart(), getSite().getPage().getSelection()); 1. => should not leak the listener when the view is disposed 2. => should not update when the Markers view is not visible 3. => should not use addSelectionListener() but addPostSelectionListener()
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/provisional/views/markers/ExtendedMarkersView.java
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
import org.eclipse.ui.progress.WorkbenchJob;
import org.eclipse.ui.statushandlers.StatusManager;
import org.eclipse.ui.views.markers.internal.MarkerGroup;
import org.eclipse.ui.views.markers.internal.MarkerMessages;
import org.eclipse.ui.views.markers.internal.MarkerSupportRegistry;
import org.eclipse.ui.views.tasklist.ITaskListResourceAdapter;
/**
 * The ExtendedMarkersView is the view that shows markers using the
 * markerGenerators extension point.
 * 
 * The ExtendedMarkersView fully supports the markerSupport extension point
 * and is meant to be used as a view to complement them.
 * 
 * The markerContentGenerators to be used by the view can be specified by appending
 * a comma separated list of them after a colon in the class specification of the view.
 * If this list is left out the problems markerContentProvider will be used.
 * 
 * For instance for the problems view in the SDK the markup looks like:
 * 
 * &lt;view
 *          name="%Views.Problem"
 *          class="org.eclipse.ui.internal.provisional.views.markers.ExtendedMarkersView:org.eclipse.ui.ide.problemsGenerator;org.eclipse.ui.ide.allGenerator"
 *          id="org.eclipse.ui.views.ProblemView"&gt;
 * &lt;/view&gt;
 * 
 * @since 3.4
 * 
 */
public class ExtendedMarkersView extends ViewPart {