File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed
src/main/java/de/doubleslash/keeptime Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ public void start(final Stage primaryStage) throws Exception {
107107 .addAll (model .getAllProjects ().stream ().filter (Project ::isEnabled ).collect (Collectors .toList ()));
108108
109109 // set default project
110- final Optional <Project > findAny = projects .stream ().filter (p -> p . isDefault () ).findAny ();
110+ final Optional <Project > findAny = projects .stream ().filter (Project :: isDefault ).findAny ();
111111 if (findAny .isPresent ()) {
112112 model .setIdleProject (findAny .get ());
113113 log .debug ("Using project '{}' as default project." , model .getIdleProject ());
Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ private void updateReport(final LocalDate newvalue) {
7070 currentDayLabel .setText (DateFormatter .toDayDateString (newvalue ));
7171 final List <Work > currentWorkItems = model .getWorkRepository ().findByCreationDate (newvalue );
7272
73- final SortedSet <Project > workedProjectsSet = currentWorkItems .stream ().map (m -> m . getProject () )
73+ final SortedSet <Project > workedProjectsSet = currentWorkItems .stream ().map (Work :: getProject )
7474 .collect (Collectors .toCollection (() -> new TreeSet <>(Comparator .comparing (Project ::getName ))));
7575
7676 gridPane .getChildren ().clear ();
Original file line number Diff line number Diff line change 3232import javafx .beans .property .SimpleBooleanProperty ;
3333import javafx .beans .property .SimpleLongProperty ;
3434import javafx .beans .property .SimpleObjectProperty ;
35- import javafx .collections .ListChangeListener ;
3635import javafx .collections .ListChangeListener .Change ;
3736import javafx .collections .ObservableList ;
3837import javafx .embed .swing .SwingFXUtils ;
@@ -203,7 +202,7 @@ private void initialize() {
203202 calendarButton .setOnAction (ae -> calendarClicked ());
204203 calendarButton .setEffect (lighting );
205204
206- final Runnable updateMainBackgroundColor = () -> runUpdateMainBackgroundColor () ;
205+ final Runnable updateMainBackgroundColor = this :: runUpdateMainBackgroundColor ;
207206
208207 mouseHoveringProperty .addListener ((a , b , c ) -> updateMainBackgroundColor .run ());
209208
@@ -259,8 +258,7 @@ private void initialize() {
259258 textArea .setText ("" );
260259 });
261260
262- model .getAvailableProjects ()
263- .addListener ((ListChangeListener <Project >) lis -> setUpAvailableProjectsListener (lis ));
261+ model .getAvailableProjects ().addListener (this ::setUpAvailableProjectsListener );
264262
265263 Model .DEFAULT_BACKGROUND_COLOR .addListener ((a , b , c ) -> updateMainBackgroundColor .run ());
266264 Model .HOVER_BACKGROUND_COLOR .addListener ((a , b , c ) -> updateMainBackgroundColor .run ());
You can’t perform that action at this time.
0 commit comments