Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not start the search if no search term is provided. #4721 #4729

Merged
merged 1 commit into from
Dec 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import org.apache.hop.core.search.ISearchablesLocation;
import org.apache.hop.core.search.SearchQuery;
import org.apache.hop.core.search.SearchableAnalyserPluginType;
import org.apache.hop.core.util.Utils;
import org.apache.hop.i18n.BaseMessages;
import org.apache.hop.ui.core.PropsUi;
import org.apache.hop.ui.core.dialog.ErrorDialog;
Expand Down Expand Up @@ -281,6 +282,10 @@ public void initialize(HopGui hopGui, Composite parent) {
wbSearch.addListener(SWT.Selection, this::search);
lastControl = wbSearch;

// Disable search button if nothing to search
wSearchString.addListener(
SWT.Modify, e -> wbSearch.setEnabled(!Utils.isEmpty(wSearchString.getText())));

Button wbOpen = new Button(composite, SWT.PUSH);
PropsUi.setLook(wbOpen);
wbOpen.setText(BaseMessages.getString(PKG, "HopSearchPerspective.Open.Button.Label"));
Expand Down Expand Up @@ -378,6 +383,9 @@ private void open(Event event) {

private void search(Event event) {

// Nothing to search
if (Utils.isEmpty(wSearchString.getText())) return;

// Find the search location using the combo
// Get the list of searchables.
//
Expand Down
Loading