Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2001-12-12 11:47:40 -0500
committerDani Megert2001-12-12 11:47:40 -0500
commitf5dc39fce05c6740865fd2e894b61e461c99c825 (patch)
treebd7a9098cd283928d36b9b1854d3f2fcdb3c8e1f
parent01298a3ba1043dafdb601f73609e2c37cc652869 (diff)
downloadeclipse.platform.text-f5dc39fce05c6740865fd2e894b61e461c99c825.tar.gz
eclipse.platform.text-f5dc39fce05c6740865fd2e894b61e461c99c825.tar.xz
eclipse.platform.text-f5dc39fce05c6740865fd2e894b61e461c99c825.zip
Show status line when going to next/previous
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchResultViewer.java16
1 files changed, 13 insertions, 3 deletions
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 bd5bc582b..b313e778b 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 @@ class SearchResultViewer extends TableViewer {
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 @@ class SearchResultViewer extends TableViewer {
addSelectionChangedListener(
new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
- handleSelectionChanged();
+ handleSelectionChanged(true);
}
}
);
@@ -130,7 +131,8 @@ class SearchResultViewer extends TableViewer {
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 @@ class SearchResultViewer extends TableViewer {
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 @@ class SearchResultViewer extends TableViewer {
private void selectResult(Table table, int index) {
table.setSelection(index);
table.showSelection();
+ handleSelectionChanged(false);
}
private void openCurrentSelection() {

Back to the top