11package root .javafx .Controller ;
22
33import java .io .IOException ;
4+ import java .net .URL ;
45import java .time .LocalDate ;
56import java .time .format .DateTimeFormatter ;
67import java .util .ArrayList ;
910import java .util .List ;
1011import java .util .Locale ;
1112import java .util .Map ;
13+ import java .util .ResourceBundle ;
1214import java .util .stream .Collectors ;
1315
1416import com .jfoenix .controls .JFXButton ;
1517import com .jfoenix .controls .JFXComboBox ;
1618
1719import javafx .event .ActionEvent ;
20+ import javafx .event .EventHandler ;
1821import javafx .fxml .FXML ;
1922import javafx .fxml .FXMLLoader ;
23+ import javafx .fxml .Initializable ;
2024import javafx .scene .Node ;
2125import javafx .scene .control .Alert .AlertType ;
2226import javafx .scene .control .Button ;
2327import javafx .scene .control .DatePicker ;
2428import javafx .scene .control .Label ;
2529import javafx .scene .control .Pagination ;
30+ import javafx .scene .input .KeyCode ;
31+ import javafx .scene .input .KeyEvent ;
2632import javafx .scene .layout .AnchorPane ;
2733import javafx .scene .layout .BorderPane ;
2834import javafx .scene .layout .HBox ;
4349import root .utils .DateUtils ;
4450import root .utils .UnitUtils .FileSize ;
4551
46- public class MonitoringAPController <T extends MonitoringResult > extends BorderPane {
52+ public class MonitoringAPController <T extends MonitoringResult > extends BorderPane implements Initializable {
4753
4854 private static final String MONITORING_HISTORY_DEFAULT_TEXT = "기록을 조회해주세요." ;
4955
@@ -59,7 +65,7 @@ public class MonitoringAPController<T extends MonitoringResult> extends BorderPa
5965
6066 @ FXML
6167 JFXComboBox <FileSize > unitComboBox ;
62-
68+
6369 @ FXML
6470 JFXComboBox <RoundingDigits > roundComboBox ;
6571
@@ -101,6 +107,22 @@ public class MonitoringAPController<T extends MonitoringResult> extends BorderPa
101107 }
102108 }
103109
110+
111+ @ Override
112+ public void initialize (URL location , ResourceBundle resources ) {
113+ addEventFilter (KeyEvent .KEY_PRESSED , new EventHandler <KeyEvent >() {
114+ public void handle (KeyEvent ke ) {
115+ if (ke .getCode ().equals (KeyCode .Z )) {
116+ prevHistoryBtn .fire ();
117+ ke .consume ();
118+ } else if (ke .getCode ().equals (KeyCode .X )) {
119+ nextHistoryBtn .fire ();
120+ ke .consume ();
121+ }
122+ }
123+ });
124+ }
125+
104126 public MonitoringAPController (Class <T > clazz ) {
105127 this .reportUsecase = new ReportUsecaseImpl (ReportFileRepo .getInstance ());
106128
@@ -468,4 +490,5 @@ public void setAliasComboBoxItems(List<String> items) {
468490 public String getSelectedAliasComboBoxItem () {
469491 return this .aliasComboBox .getSelectionModel ().getSelectedItem ();
470492 }
493+
471494}
0 commit comments