66import java .util .List ;
77import java .util .ResourceBundle ;
88
9+ import de .jensd .fx .glyphs .fontawesome .FontAwesomeIcon ;
910import javafx .beans .property .SimpleDoubleProperty ;
1011import javafx .beans .property .SimpleIntegerProperty ;
1112import javafx .collections .FXCollections ;
1213import javafx .fxml .FXML ;
1314import javafx .fxml .FXMLLoader ;
1415import javafx .fxml .Initializable ;
1516import javafx .scene .control .Label ;
16- import javafx .scene .control .ListView ;
1717import javafx .scene .control .TableColumn ;
1818import javafx .scene .control .TableView ;
1919import javafx .scene .layout .AnchorPane ;
20+ import javafx .scene .layout .VBox ;
21+ import javafx .scene .paint .Paint ;
2022import lombok .Data ;
2123import lombok .extern .slf4j .Slf4j ;
2224import root .core .domain .AlertLog ;
2628@ Slf4j
2729public class AlertLogMonitoringSummaryAP extends AnchorPane implements Initializable {
2830
31+ @ FXML
32+ VBox wrapVBox ;
33+
2934 @ FXML
3035 Label alertLogFileLB ;
3136
@@ -43,12 +48,11 @@ public class AlertLogMonitoringSummaryAP extends AnchorPane implements Initializ
4348
4449 @ FXML
4550 private TableColumn <AlertLogSummary , Double > errorRateCL ;
46-
47- @ FXML
48- private ListView <Log > errorLogLV ;
49-
51+
52+ private ExpandableListView <Log > errorLogLV ;
53+
5054 private AlertLog alertLog ;
51-
55+
5256 private List <Log > errorLogs = new ArrayList <>();
5357
5458 public AlertLogMonitoringSummaryAP (AlertLog alertLog ) {
@@ -71,8 +75,21 @@ public void initialize(URL location, ResourceBundle resources) {
7175 errorCL .setCellValueFactory (cellData -> cellData .getValue ().getErrorLogCount ().asObject ());
7276 errorRateCL .setCellValueFactory (cellData -> cellData .getValue ().getErrorRate ().asObject ());
7377
74- // Set cell factory of error log listview
75- errorLogLV .setCellFactory (categoryList -> new AlertLogListViewCell ());
78+ errorLogLV = new ExpandableListView <>(FontAwesomeIcon .CLOCK_ALT , Paint .valueOf ("#183279" ));
79+
80+ // Set content provider for expandable listview
81+ errorLogLV .setContentProvider (new ExpandableListView .ContentProvider <Log >() {
82+ @ Override
83+ public String getTitleOf (final Log log ) {
84+ return log .getLogTimeStamp () + "\t (Index: " + (log .getIndex () + 1 ) + ")" ;
85+ }
86+
87+ @ Override
88+ public String getContentOf (final Log log ) {
89+ return log .getFullLogString ();
90+ }
91+ });
92+ wrapVBox .getChildren ().add (errorLogLV );
7693
7794 render ();
7895 }
@@ -83,7 +100,8 @@ private void render() {
83100
84101 // Set summary tableview value
85102 summaryTV .setItems (FXCollections .observableArrayList (List .of (getSummaryData ())));
86-
103+
104+ // Set errorLog listview values
87105 errorLogLV .getItems ().addAll (errorLogs );
88106 }
89107
0 commit comments