Skip to content

Commit acb15d8

Browse files
committed
Focusing Alert log cell using next, prev button
1 parent c54793d commit acb15d8

File tree

2 files changed

+35
-2
lines changed

2 files changed

+35
-2
lines changed

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

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,39 @@ public void monitoringAlertLog(ActionEvent e) throws Exception {
260260
summaryNodataAP.toBack();
261261
}
262262

263+
public void prevAlertLog(ActionEvent e) {
264+
String input = navigatorTF.getText();
265+
if (!validateAlertLogNavigatorInput(input)) {
266+
return;
267+
}
268+
269+
int toIndex = Integer.parseInt(input) - 1;
270+
if (toIndex == 0) {
271+
updateStatusMessage("첫번째 Log입니다.");
272+
return;
273+
}
274+
275+
navigatorTF.setText(String.valueOf(toIndex));
276+
focusAlertLog(e);
277+
}
278+
279+
public void nextAlertLog(ActionEvent e) {
280+
String input = navigatorTF.getText();
281+
if (!validateAlertLogNavigatorInput(input)) {
282+
return;
283+
}
284+
285+
286+
int toIndex = Integer.parseInt(input) + 1;
287+
if (toIndex > alertLogLV.getItems().size()) {
288+
updateStatusMessage("마지막 Log입니다.");
289+
return;
290+
}
291+
292+
navigatorTF.setText(String.valueOf(toIndex));
293+
focusAlertLog(e);
294+
}
295+
263296
public void focusAlertLog(Event e) {
264297
String input = navigatorTF.getText();
265298
if (!validateAlertLogNavigatorInput(input)) {

src/main/resources/fxml/AlertLogMonitoringMenu.fxml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,15 +239,15 @@
239239
</Label>
240240
<HBox alignment="CENTER_LEFT" layoutY="39.20000076293945" style="-fx-border-color: #e1e1e1; -fx-border-width: 0.5px;" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="42.0">
241241
<children>
242-
<JFXButton contentDisplay="GRAPHIC_ONLY">
242+
<JFXButton contentDisplay="GRAPHIC_ONLY" onAction="#prevAlertLog">
243243
<graphic>
244244
<FontAwesomeIconView fill="#3c4584" glyphName="ARROW_CIRCLE_LEFT" size="20" strokeMiterLimit="0.0" tabSize="0" />
245245
</graphic>
246246
<HBox.margin>
247247
<Insets left="10.0" />
248248
</HBox.margin>
249249
</JFXButton>
250-
<JFXButton contentDisplay="GRAPHIC_ONLY">
250+
<JFXButton contentDisplay="GRAPHIC_ONLY" onAction="#nextAlertLog">
251251
<graphic>
252252
<FontAwesomeIconView fill="#3c4584" glyphName="ARROW_CIRCLE_RIGHT" size="20" strokeMiterLimit="0.0" tabSize="0" />
253253
</graphic>

0 commit comments

Comments
 (0)