1919import java .util .Comparator ;
2020
2121import org .springframework .beans .factory .annotation .Autowired ;
22+ import org .springframework .context .ConfigurableApplicationContext ;
2223import org .springframework .stereotype .Component ;
2324
2425import de .doubleslash .keeptime .model .repos .ProjectRepository ;
@@ -64,6 +65,8 @@ public Model(final ProjectRepository projectRepository, final WorkRepository wor
6465 private ObservableList <Project > allProjects = FXCollections .observableArrayList ();
6566
6667 protected final ObservableList <Work > pastWorkItems = FXCollections .observableArrayList ();
68+ private final SortedList <Work > sortedPastWorkItems = new SortedList <>(pastWorkItems ,
69+ Comparator .comparing (Work ::getStartTime ));
6770 public final ObjectProperty <Work > activeWorkItem = new SimpleObjectProperty <>();
6871
6972 public final ObjectProperty <Color > taskBarColor = new SimpleObjectProperty <>(ORIGINAL_TASK_BAR_FONT_COLOR );
@@ -77,12 +80,15 @@ public Model(final ProjectRepository projectRepository, final WorkRepository wor
7780 public final ObjectProperty <Boolean > useHotkey = new SimpleObjectProperty <>(false );
7881 public final ObjectProperty <Boolean > displayProjectsRight = new SimpleObjectProperty <>(false );
7982 public final ObjectProperty <Boolean > hideProjectsOnMouseExit = new SimpleObjectProperty <>(true );
83+ public final ObjectProperty <Boolean > emptyNoteReminder = new SimpleObjectProperty <>(false );
8084
8185 public final ObjectProperty <Boolean > saveWindowPosition = new SimpleObjectProperty <>(false );
8286 public final ObjectProperty <Double > windowPositionY = new SimpleObjectProperty <>(0.5 );
8387 public final ObjectProperty <Double > windowPositionX = new SimpleObjectProperty <>(0.5 );
8488 public final ObjectProperty <Integer > screenHash = new SimpleObjectProperty <>(0 );
8589
90+ private ConfigurableApplicationContext springContext ;
91+
8692 public void setWorkRepository (final WorkRepository workRepository ) {
8793 this .workRepository = workRepository ;
8894 }
@@ -156,4 +162,16 @@ private Screen getScreenWithHashOrPrimary(final int hash) {
156162 }
157163 return Screen .getPrimary ();
158164 }
165+
166+ public void setSpringContext (final ConfigurableApplicationContext springContext ) {
167+ this .springContext = springContext ;
168+ }
169+
170+ public ConfigurableApplicationContext getSpringContext () {
171+ return this .springContext ;
172+ }
173+
174+ public SortedList <Work > getSortedPastWorkItems () {
175+ return sortedPastWorkItems ;
176+ }
159177}
0 commit comments