Skip to content

Commit d11e081

Browse files
authored
Merge pull request #4729 from nadment/4721
Do not start the search if no search term is provided. #4721
2 parents 60d02cf + 1080a92 commit d11e081

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ui/src/main/java/org/apache/hop/ui/hopgui/perspective/search/HopSearchPerspective.java

+8
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import org.apache.hop.core.search.ISearchablesLocation;
3434
import org.apache.hop.core.search.SearchQuery;
3535
import org.apache.hop.core.search.SearchableAnalyserPluginType;
36+
import org.apache.hop.core.util.Utils;
3637
import org.apache.hop.i18n.BaseMessages;
3738
import org.apache.hop.ui.core.PropsUi;
3839
import org.apache.hop.ui.core.dialog.ErrorDialog;
@@ -281,6 +282,10 @@ public void initialize(HopGui hopGui, Composite parent) {
281282
wbSearch.addListener(SWT.Selection, this::search);
282283
lastControl = wbSearch;
283284

285+
// Disable search button if nothing to search
286+
wSearchString.addListener(
287+
SWT.Modify, e -> wbSearch.setEnabled(!Utils.isEmpty(wSearchString.getText())));
288+
284289
Button wbOpen = new Button(composite, SWT.PUSH);
285290
PropsUi.setLook(wbOpen);
286291
wbOpen.setText(BaseMessages.getString(PKG, "HopSearchPerspective.Open.Button.Label"));
@@ -378,6 +383,9 @@ private void open(Event event) {
378383

379384
private void search(Event event) {
380385

386+
// Nothing to search
387+
if (Utils.isEmpty(wSearchString.getText())) return;
388+
381389
// Find the search location using the combo
382390
// Get the list of searchables.
383391
//

0 commit comments

Comments
 (0)