Bug 81733 RefactoringWizardDialog - ErrorPage - action buttons "Next Problem", "Previous Problem" do not work correctly
If a refactoring (checkFinalConditions method) finishes with a refactoring status, that has several entries with different severities, the following situation can happen: Action buttons "Next Problem", "Previous Problem" do not work correctly. (For example the button "Previous" does nothing.) Explanation: There is a bug. The list of entries is retrieved from a RefactoringStatus object and put into a RefactoringStatusViewer. The viewer sorts the items, using RefactoringStatusSorter. The implementation of RefactoringStatusViewer.revealElement(boolean) is wrong, because this takes the index from the table: int index= fTableViewer.getTable().getSelectionIndex(); but this index refers to an index in the sorted list and the code: if (doIt) fTableViewer.setSelection(new StructuredSelection(entries[index])); refers the index (increased or decreased) to the original list of entries (unsorted). The result is a mess after clicking on Next or Previous button.
org.eclipse.ltk.ui.refactoring/src/org/eclipse/ltk/internal/ui/refactoring/RefactoringStatusViewer.java
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.ltk.internal.ui.refactoring;
import org.eclipse.compare.CompareUI;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;