Show status line when going to next/previous
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java index bd5bc58..b313e77 100644 --- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java +++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java
@@ -61,6 +61,7 @@ private SearchDropDownAction fSearchDropDownAction; private CopyToClipboardAction fCopyToClipboardAction; private int fMarkerToShow; + private boolean fHandleNextSelectionChangedEvent= true; /* * These static fields will go away when support for @@ -103,7 +104,7 @@ addSelectionChangedListener( new ISelectionChangedListener() { public void selectionChanged(SelectionChangedEvent event) { - handleSelectionChanged(); + handleSelectionChanged(true); } } ); @@ -130,7 +131,8 @@ fOuterPart.getSite().registerContextMenu(menuMgr, this); } - private void handleSelectionChanged() { + private void handleSelectionChanged(boolean updateMarkerToShow) { + int selectionCount= getSelectedEntriesCount(); boolean hasSingleSelection= selectionCount == 1; boolean hasElements= getItemCount() > 0; @@ -138,7 +140,14 @@ fShowPreviousResultAction.setEnabled(hasSingleSelection || (hasElements && selectionCount == 0)); fGotoMarkerAction.setEnabled(hasSingleSelection); fRemoveMatchAction.setEnabled(hasSingleSelection); - fMarkerToShow= -1; + if (updateMarkerToShow && fHandleNextSelectionChangedEvent) { + fMarkerToShow= -1; + } else + fHandleNextSelectionChangedEvent= true; + + if (!updateMarkerToShow) + fHandleNextSelectionChangedEvent= false; + String location= ""; //$NON-NLS-1$ if (hasSingleSelection) { ISearchResultViewEntry entry= (ISearchResultViewEntry)getTable().getItem(getTable().getSelectionIndex()).getData(); @@ -405,6 +414,7 @@ private void selectResult(Table table, int index) { table.setSelection(index); table.showSelection(); + handleSelectionChanged(false); } private void openCurrentSelection() {