Skip to content
Snippets Groups Projects
Commit 1b4ebf91 authored by Tobias Ullerich's avatar Tobias Ullerich
Browse files

Improve search result dialog

parent 7c78ed84
No related branches found
No related tags found
No related merge requests found
......@@ -239,7 +239,8 @@ public class Strings {
// Search
public static final String SEARCH_BUTTON = "Search.Button";
public static final String SEARCH_PLACEHOLDER = "Search.Placeholder";
public static final String SEARCH_ALERT_NO_MATCHES = "Search.Alert.NoMatches";
public static final String SEARCH_ALERT_NO_MATCHES_HEADER = "Search.Alert.NoMatches.Header";
public static final String SEARCH_ALERT_NO_MATCHES_CONTENT = "Search.Alert.NoMatches.Content";
// UI - Dialog - Page - Delete
public static final String UI_DIALOG_PAGE_DELETE_HEADER = "UI.Dialog.Page.Delete.Header";
......
package de.tobias.playpad.layout.desktop.listener;
import de.thecodelabs.utils.application.ApplicationUtils;
import de.thecodelabs.utils.ui.Alerts;
import de.thecodelabs.utils.util.Localization;
import de.tobias.playpad.Strings;
import de.tobias.playpad.pad.Pad;
......@@ -7,6 +9,7 @@ import de.tobias.playpad.project.Project;
import de.tobias.playpad.viewcontroller.main.IMainViewController;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Alert;
import javafx.scene.control.TextField;
import java.util.List;
......@@ -47,7 +50,12 @@ public class DesktopSearchController implements EventHandler<ActionEvent> {
}
if (searchResult.isEmpty()) {
mainView.showInfoMessage(Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES));
Alerts.getInstance().createAlert(
Alert.AlertType.INFORMATION, ApplicationUtils.getApplication().getInfo().getName(),
Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES_HEADER),
Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES_CONTENT, currentSearchTerm),
mainView.getStage()
).showAndWait();
return;
}
......@@ -58,7 +66,12 @@ public class DesktopSearchController implements EventHandler<ActionEvent> {
result.getController().getView().highlightView(HIGHLIGHT_DURATION);
}
} else {
mainView.showInfoMessage(Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES));
Alerts.getInstance().createAlert(
Alert.AlertType.INFORMATION, ApplicationUtils.getApplication().getInfo().getName(),
Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES_HEADER),
Localization.getString(Strings.SEARCH_ALERT_NO_MATCHES_CONTENT, currentSearchTerm),
mainView.getStage()
).showAndWait();
currentIndex = 0;
}
}
......
......@@ -218,10 +218,13 @@ DnDMode.Move=Tauschen
# Main Layout
MainLayout.Desktop=Desktopmodus
MainLayout.Touch=Touchmodus
# Suche
Search.Button=Suchen
Search.Placeholder=Suche
Search.Alert.NoMatches=Keine Treffer gefunden.
Search.Alert.NoMatches.Header=Kachelsuche
Search.Alert.NoMatches.Content=Keine weiteren Treffer zu '{}' gefunden.
# UI - Dialog - Page - Delete
UI.Dialog.Page.Delete.Header=Seite l\u00F6schen
UI.Dialog.Page.Delete.Content=M\u00F6chten Sie die Seite unwiederbringlich l\u00F6schen?
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment