|
14 | 14 |
|
15 | 15 | import javafx.application.Platform; |
16 | 16 | import javafx.event.ActionEvent; |
| 17 | +import javafx.event.Event; |
| 18 | +import javafx.event.EventHandler; |
17 | 19 | import javafx.fxml.FXML; |
18 | 20 | import javafx.fxml.Initializable; |
19 | 21 | import javafx.scene.control.Alert.AlertType; |
20 | 22 | import javafx.scene.control.DatePicker; |
21 | 23 | import javafx.scene.control.TextField; |
| 24 | +import javafx.scene.input.KeyCode; |
| 25 | +import javafx.scene.input.KeyEvent; |
22 | 26 | import javafx.scene.layout.AnchorPane; |
23 | 27 | import javafx.scene.layout.StackPane; |
24 | 28 | import lombok.extern.slf4j.Slf4j; |
@@ -169,6 +173,15 @@ private void initAlertLogMonitoringElements() { |
169 | 173 |
|
170 | 174 | // AlertLog Navigator |
171 | 175 | navigatorTF.setTextFormatter(new NumberTextFormatter()); |
| 176 | + navigatorTF.setOnKeyReleased(new EventHandler<KeyEvent>() { |
| 177 | + @Override |
| 178 | + public void handle(KeyEvent e) { |
| 179 | + if (e.getCode().equals(KeyCode.ENTER)) { |
| 180 | + focusAlertLog(e); |
| 181 | + e.consume(); |
| 182 | + } |
| 183 | + } |
| 184 | + }); |
172 | 185 |
|
173 | 186 | // Set view visible |
174 | 187 | mainNodataAP.setVisible(true); |
@@ -247,7 +260,7 @@ public void monitoringAlertLog(ActionEvent e) throws Exception { |
247 | 260 | summaryNodataAP.toBack(); |
248 | 261 | } |
249 | 262 |
|
250 | | - public void focusAlertLog(ActionEvent e) { |
| 263 | + public void focusAlertLog(Event e) { |
251 | 264 | String input = navigatorTF.getText(); |
252 | 265 | if (!validateAlertLogNavigatorInput(input)) { |
253 | 266 | return; |
|
0 commit comments