2525import java .util .TreeSet ;
2626import java .util .stream .Collectors ;
2727
28- import de .doubleslash .keeptime .common .SvgNodeProvider ;
29- import javafx .scene .control .*;
3028import org .slf4j .Logger ;
3129import org .slf4j .LoggerFactory ;
3230import org .springframework .beans .factory .annotation .Autowired ;
3735import de .doubleslash .keeptime .common .DateFormatter ;
3836import de .doubleslash .keeptime .common .Resources ;
3937import de .doubleslash .keeptime .common .Resources .RESOURCE ;
38+ import de .doubleslash .keeptime .common .SvgNodeProvider ;
4039import de .doubleslash .keeptime .controller .Controller ;
4140import de .doubleslash .keeptime .exceptions .FXMLLoaderException ;
4241import de .doubleslash .keeptime .model .Model ;
5251import javafx .fxml .FXMLLoader ;
5352import javafx .scene .Node ;
5453import javafx .scene .canvas .Canvas ;
54+ import javafx .scene .control .Alert ;
5555import javafx .scene .control .Alert .AlertType ;
56+ import javafx .scene .control .Button ;
57+ import javafx .scene .control .ButtonType ;
58+ import javafx .scene .control .ContentDisplay ;
59+ import javafx .scene .control .DateCell ;
60+ import javafx .scene .control .DatePicker ;
61+ import javafx .scene .control .Dialog ;
62+ import javafx .scene .control .Label ;
63+ import javafx .scene .control .Tooltip ;
64+ import javafx .scene .control .TreeItem ;
65+ import javafx .scene .control .TreeTableCell ;
66+ import javafx .scene .control .TreeTableColumn ;
67+ import javafx .scene .control .TreeTableView ;
5668import javafx .scene .control .cell .TreeItemPropertyValueFactory ;
5769import javafx .scene .input .Clipboard ;
5870import javafx .scene .input .ClipboardContent ;
6375import javafx .scene .shape .Circle ;
6476import javafx .stage .Stage ;
6577import javafx .util .Callback ;
78+
6679@ Component
6780public class ReportController {
6881
@@ -187,19 +200,22 @@ private void updateReport(final LocalDate dateToShow) {
187200
188201 this .currentDayLabel .setText (DateFormatter .toDayDateString (this .currentReportDate ));
189202 final List <Work > currentWorkItems = model .getWorkRepository ()
190- .findByStartDateOrderByStartTimeAsc (this .currentReportDate );
203+ .findByStartDateOrderByStartTimeAsc (this .currentReportDate );
191204
192205 colorTimeLine .update (currentWorkItems , controller .calcSeconds (currentWorkItems ));
193206
194- final SortedSet <Project > workedProjectsSet = currentWorkItems .stream ().map (Work ::getProject )
195- .collect (Collectors .toCollection (() -> new TreeSet <>(Comparator .comparing (Project ::getIndex ))));
207+ final SortedSet <Project > workedProjectsSet = currentWorkItems .stream ()
208+ .map (Work ::getProject )
209+ .collect (Collectors .toCollection (() -> new TreeSet <>(
210+ Comparator .comparing (Project ::getIndex ))));
196211
197212 long currentWorkSeconds = 0 ;
198213 long currentSeconds = 0 ;
199214
200215 for (final Project project : workedProjectsSet ) {
201- final List <Work > onlyCurrentProjectWork = currentWorkItems .stream ().filter (w -> w .getProject () == project )
202- .collect (Collectors .toList ());
216+ final List <Work > onlyCurrentProjectWork = currentWorkItems .stream ()
217+ .filter (w -> w .getProject () == project )
218+ .collect (Collectors .toList ());
203219
204220 final long projectWorkSeconds = controller .calcSeconds (onlyCurrentProjectWork );
205221
@@ -269,11 +285,12 @@ public void updateItem(final LocalDate item, final boolean empty) {
269285 }
270286
271287 private Button createDeleteWorkButton (final Work w ) {
272- final Button deleteButton ;
273- deleteButton = new Button ( "" , SvgNodeProvider .getSvgNodeWithScale (RESOURCE .SVG_TRASH_ICON ,0.03 ,0.03 ));
288+ final Button deleteButton = new Button ( "" ,
289+ SvgNodeProvider .getSvgNodeWithScale (RESOURCE .SVG_TRASH_ICON , 0.03 , 0.03 ));
274290 deleteButton .setMaxSize (20 , 18 );
275291 deleteButton .setMinSize (20 , 18 );
276292 deleteButton .setContentDisplay (ContentDisplay .GRAPHIC_ONLY );
293+
277294 deleteButton .setOnAction (e -> {
278295 LOG .info ("Delete work clicked." );
279296 final Alert alert = new Alert (AlertType .CONFIRMATION );
@@ -295,10 +312,12 @@ private Button createDeleteWorkButton(final Work w) {
295312 }
296313
297314 private Button createEditWorkButton (final Work work ) {
298- final Button editButton = new Button ("" ,SvgNodeProvider .getSvgNodeWithScale (RESOURCE .SVG_PENCIL_ICON , 0.03 ,0.03 ));
315+ final Button editButton = new Button ("" ,
316+ SvgNodeProvider .getSvgNodeWithScale (RESOURCE .SVG_PENCIL_ICON , 0.03 , 0.03 ));
299317 editButton .setMaxSize (20 , 18 );
300318 editButton .setMinSize (20 , 18 );
301319 editButton .setContentDisplay (ContentDisplay .GRAPHIC_ONLY );
320+
302321 editButton .setOnAction (e -> {
303322 LOG .info ("Edit work clicked." );
304323 final Dialog <Work > dialog = setupEditWorkDialog (work );
@@ -355,10 +374,11 @@ private GridPane setUpEditWorkGridPane(final Work work, final Dialog<Work> dialo
355374 }
356375
357376 private Button createCopyProjectButton (final List <Work > projectWork ) {
358- final Button copyButton = new Button ("" , SvgNodeProvider .getSvgNodeWithScale (RESOURCE .SVG_FLOPPY_DISK_ICON , 0.03 , 0.03 ));
377+ final Button copyButton = new Button ("" , SvgNodeProvider .getSvgNodeWithScale (RESOURCE .SVG_CLIPBOARD , 0.03 , 0.03 ));
359378 copyButton .setMaxSize (20 , 18 );
360379 copyButton .setMinSize (20 , 18 );
361380 copyButton .setContentDisplay (ContentDisplay .GRAPHIC_ONLY );
381+
362382 final EventHandler <ActionEvent > eventListener = actionEvent -> {
363383 LOG .debug ("Copy to Clipboard clicked." );
364384 final ProjectReport pr = new ProjectReport (projectWork .size ());
@@ -378,7 +398,7 @@ private Button createCopyProjectButton(final List<Work> projectWork) {
378398 }
379399
380400 private Node createCopyWorkButton (final Work w ) {
381- final Button copyButton = new Button ("" , SvgNodeProvider .getSvgNodeWithScale (RESOURCE .SVG_FLOPPY_DISK_ICON , 0.03 , 0.03 ));
401+ final Button copyButton = new Button ("" , SvgNodeProvider .getSvgNodeWithScale (RESOURCE .SVG_CLIPBOARD , 0.03 , 0.03 ));
382402 copyButton .setMaxSize (20 , 18 );
383403 copyButton .setMinSize (20 , 18 );
384404 copyButton .setContentDisplay (ContentDisplay .GRAPHIC_ONLY );
0 commit comments