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
tbm.add(fNextProblem= new NextProblem());
		tbm.add(fPreviousProblem= new PreviousProblem());
		tbm.update(true);
		createTableViewer(contextPane);
		contextPane.setContent(fTableViewer.getControl());
		
		fContextViewerContainer= new PageBook(this, SWT.NONE);
		fNullContextViewer= new NullContextViewer();
		fNullContextViewer.createControl(fContextViewerContainer);
		fContextViewerContainer.showPage(fNullContextViewer.getControl());
		fCurrentContextViewer= fNullContextViewer;
		fCurrentContextViewer= fNullContextViewer;
		fCurrentDescriptor= null;	
		
		setWeights(new int[]{35, 65});		
	}
	
	private  void createTableViewer(Composite parent) {
		fTableViewer= new TableViewer(new Table(parent, SWT.SINGLE | SWT.H_SCROLL));
		fTableViewer.setLabelProvider(new RefactoringStatusEntryLabelProvider());
		fTableViewer.setContentProvider(new RefactoringStatusContentProvider());
		fTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
			public void selectionChanged(SelectionChangedEvent event) {
				entrySelected(event.getSelection());
				fNextProblem.update();
				fPreviousProblem.update();
			}
		});
		fTableViewer.setSorter(new RefactoringStatusSorter());	
		Table tableControl= fTableViewer.getTable();