From dc62592d88bc9659713d6f1e4b90fb5345627fdd Mon Sep 17 00:00:00 2001
From: Patrick Plitzner
Date: Mon, 5 Oct 2015 12:46:05 +0200
Subject: [PATCH 1/1] Allow using the search bar only if at least one letter is
entered (#3341)
---
.../OSGI-INF/l10n/messages.properties | 2 +-
.../OSGI-INF/l10n/messages_de.properties | 2 +-
.../eu/etaxonomy/taxeditor/navigation/search/SearchBar.java | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties
index acd510f07..2fb82b9b4 100644
--- a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties
+++ b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages.properties
@@ -1,7 +1,7 @@
SearchBar_0=Use "*" for wildcard searching
SearchBar_1=Search
SearchBar_2=Could not execute search
-SearchBar_3=Please type at least one character when using the "*" wildcard.
+SearchBar_3=Please type at least one character
SearchBar_4=Error opening search result.
SearchBar_6=Taxa
SearchBar_7=Synonyms
diff --git a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties
index 3ab85da0c..0546737ff 100644
--- a/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties
+++ b/eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/messages_de.properties
@@ -1,7 +1,7 @@
SearchBar_0=Benutze "*" f\u00FCr Platzhalter-Suche
SearchBar_1=Suche
SearchBar_2=Suche konnte nicht ausgef\u00FChrt werden
-SearchBar_3=Bitte geben Sie mindestens ein Zeichen ein, wenn Sie den "*" Platzhalter benutzen wollen
+SearchBar_3=Bitte geben Sie mindestens einen Buchstaben ein
SearchBar_4=Fehler beim f\u00fcffnen des Suchergebnisses
SearchBar_6=Taxa
SearchBar_7=Synonyme
diff --git a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java
index bd04a0feb..9b40efb83 100644
--- a/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java
+++ b/eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/search/SearchBar.java
@@ -179,7 +179,7 @@ public class SearchBar extends WorkbenchWindowControlContribution{
return;
}
- if("*".equals(searchString.trim())){
+ if(!searchString.trim().matches(".*\\p{L}+.*")){
MessagingUtils.warningDialog(Messages.SearchBar_2, this, Messages.SearchBar_3);
return;
}
--
2.34.1