Skip to content

Commit 1566945

Browse files
committed
Add auto-inquiry function in history menu
1 parent a40a6bf commit 1566945

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

src/main/java/root/javafx/Controller/MonitoringAPController.java

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,12 @@ public MonitoringAPController(Class<T> clazz) {
101101
setAnchor(this, 0, 0, 0, 0);
102102

103103
// Add comoboBox click listner
104-
aliasComboBox.valueProperty().addListener((options, oldVlaue, newValue) -> {
105-
syncTableData(newValue, 0);
104+
aliasComboBox.valueProperty().addListener((options, oldValue, newValue) -> {
105+
if(oldValue == null) {
106+
syncTableData(newValue, 0);
107+
} else {
108+
runMonitoring();
109+
}
106110
});
107111

108112
// Setting inquiry datepicker initial value
@@ -112,6 +116,11 @@ public MonitoringAPController(Class<T> clazz) {
112116

113117
unitComboBox.getItems().addAll(FileSize.values());
114118
unitComboBox.getSelectionModel().select(propService.getDefaultFileSizeUnit());
119+
unitComboBox.valueProperty().addListener((observable, oldValue, newValue) -> {
120+
if(oldValue != null) {
121+
runMonitoring();
122+
}
123+
});
115124

116125
roundComboBox.getItems().addAll(RoundingDigits.values());
117126
roundComboBox.getSelectionModel().select(propService.getDefaultRoundingDigits());
@@ -126,7 +135,12 @@ public RoundingDigits fromString(String digits) {
126135
return RoundingDigits.find(digits);
127136
}
128137
});
129-
138+
roundComboBox.valueProperty().addListener((observable, oldValue, newValue) -> {
139+
if(oldValue != null) {
140+
runMonitoring();
141+
}
142+
});
143+
130144
// Set pagination property
131145
pagination.currentPageIndexProperty().addListener((observable, oldValue, newValue) -> {
132146
String selected = aliasComboBox.getSelectionModel().getSelectedItem();
@@ -259,6 +273,10 @@ public void setAnchor(Node node, double left, double top, double right, double b
259273
* @param e
260274
*/
261275
public void run(ActionEvent e) {
276+
runMonitoring();
277+
}
278+
279+
private void runMonitoring() {
262280
String selected = aliasComboBox.getSelectionModel().getSelectedItem();
263281

264282
// Clear data

0 commit comments

Comments
 (0)