Skip to content

Commit

Permalink
minor refactorings
Browse files Browse the repository at this point in the history
  • Loading branch information
hansi-b committed Oct 8, 2024
1 parent e868f54 commit 394c82a
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,10 @@ static void create(Stage primaryStage, ObservableData data, SpanRecorder spanRec
log.warn("Cannot resize logo (System tray not supported, or using headless graphics).");
return;
}

data.projects().addListener((InvalidationListener) observable -> log.info("invalidated = {}", observable));
data.projects().addListener((ListChangeListener<FxProject>) c -> log.info("onChanged = {}", c));


log.info("Showing TrayIcon ...");
Platform.setImplicitExit(false);
TrayIcon trayIcon = new TrayIcon(new Resources().loadAwtLogo());
Expand All @@ -75,16 +74,15 @@ static void create(Stage primaryStage, ObservableData data, SpanRecorder spanRec
});
MenuItem stopItem = new MenuItem("Stop");
stopItem.addActionListener(e -> {
Platform.runLater(() -> spanRecorder.stopRecording());
Platform.runLater(spanRecorder::stopRecording);
stopItem.setEnabled(false);
});
stopItem.setEnabled(false);

popup.add(showItem);
popup.addSeparator();

data.fxProjectTree().children().map(project -> createMenu(project, spanRecorder, stopItem))
.forEach(m -> popup.add(m));
data.fxProjectTree().children().map(project -> createMenu(project, spanRecorder, stopItem)).forEach(popup::add);

popup.addSeparator();
popup.add(stopItem);
Expand All @@ -95,7 +93,6 @@ static void create(Stage primaryStage, ObservableData data, SpanRecorder spanRec
tray.add(trayIcon);
} catch (AWTException e) {
log.error("Could not add tray icon", e);
return;
}
}

Expand Down

0 comments on commit 394c82a

Please sign in to comment.