Skip to content

Commit 1fbb90a

Browse files
ddamkeddamke
authored andcommitted
Merge branch 'develop' into bug/import_export_function_fix_linux
2 parents 1b611c3 + e6e6373 commit 1fbb90a

File tree

10 files changed

+137
-77
lines changed

10 files changed

+137
-77
lines changed

.github/workflows/mavenCi.yml

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616

17-
analyze:
17+
Analyze_Build_Upload:
1818

1919
runs-on: ubuntu-latest
2020

@@ -26,6 +26,14 @@ jobs:
2626
java-version: '11'
2727
distribution: 'corretto'
2828
cache: maven
29+
- name: Build
30+
run: mvn clean verify org.jacoco:jacoco-maven-plugin:0.8.7:prepare-agent org.jacoco:jacoco-maven-plugin:0.8.7:report -Pcoverage
31+
32+
- name: Upload Build Artifact
33+
uses: actions/upload-artifact@v3
34+
with:
35+
name: KeepTime
36+
path: /home/runner/work/KeepTime/KeepTime/target/keeptime-*-bin.zip
2937
- name: Analyze
3038
env:
3139
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -36,26 +44,3 @@ jobs:
3644
-Dsonar.projectKey=${{ secrets.PROJECT_KEY }} -X
3745
-Dsonar.java.binaries=.
3846
-Dsonar.qualitygate.wait=true
39-
40-
41-
build_and_upload:
42-
needs: analyze
43-
runs-on: ubuntu-latest
44-
45-
steps:
46-
- uses: actions/checkout@v3
47-
- name: Set up JDK 1.8
48-
uses: actions/setup-java@v3
49-
with:
50-
java-version: '8'
51-
distribution: 'corretto'
52-
cache: maven
53-
- name: Build
54-
run: |
55-
mvn package -B clean verify
56-
57-
- name: Upload Build Artifact
58-
uses: actions/upload-artifact@v3
59-
with:
60-
name: KeepTime
61-
path: /home/runner/work/KeepTime/KeepTime/target/keeptime-*-bin.zip

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,7 @@ You should put the .jar in an extra folder as a *logs* and a *db* folder will be
6767

6868
* Windows 7, 10
6969
* Linux (tested on Ubuntu 18.04)
70-
* Java 8 + JavaFX
70+
* Java 11
71+
72+
73+

pom.xml

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,8 @@
3434
<properties>
3535
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3636
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
37-
<maven.compiler.source>1.8</maven.compiler.source>
38-
<maven.compiler.target>1.8</maven.compiler.target>
39-
37+
<maven.compiler.source>11</maven.compiler.source>
38+
<maven.compiler.target>11</maven.compiler.target>
4039

4140
<maven-dependency-check.version>6.0.5</maven-dependency-check.version>
4241
<!-- USING HTML,XML (comma-separated list) did not work with plugin version 5.1.0 -->
@@ -47,6 +46,33 @@
4746
</properties>
4847

4948
<dependencies>
49+
<dependency>
50+
<groupId>org.openjfx</groupId>
51+
<artifactId>javafx-controls</artifactId>
52+
<version>11.0.2</version>
53+
</dependency>
54+
<dependency>
55+
<groupId>org.openjfx</groupId>
56+
<artifactId>javafx-fxml</artifactId>
57+
<version>11.0.2</version>
58+
</dependency>
59+
<dependency>
60+
<groupId>org.openjfx</groupId>
61+
<artifactId>javafx-swing</artifactId>
62+
<version>11</version>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.openjfx</groupId>
66+
<artifactId>javafx-graphics</artifactId>
67+
<version>11.0.2</version>
68+
<classifier>win</classifier>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.openjfx</groupId>
72+
<artifactId>javafx-graphics</artifactId>
73+
<version>11.0.2</version>
74+
<classifier>linux</classifier>
75+
</dependency>
5076
<dependency>
5177
<groupId>org.springframework.boot</groupId>
5278
<artifactId>spring-boot-starter-data-jpa</artifactId>
@@ -93,6 +119,39 @@
93119
<scope>test</scope>
94120
</dependency>
95121
</dependencies>
122+
<profiles>
123+
<profile>
124+
<id>coverage</id>
125+
<build>
126+
<plugins>
127+
<plugin>
128+
<groupId>org.jacoco</groupId>
129+
<artifactId>jacoco-maven-plugin</artifactId>
130+
<version>0.8.7</version>
131+
<executions>
132+
<execution>
133+
<id>prepare-agent</id>
134+
<goals>
135+
<goal>prepare-agent</goal>
136+
</goals>
137+
</execution>
138+
<execution>
139+
<id>report</id>
140+
<goals>
141+
<goal>report</goal>
142+
</goals>
143+
<configuration>
144+
<formats>
145+
<format>XML</format>
146+
</formats>
147+
</configuration>
148+
</execution>
149+
</executions>
150+
</plugin>
151+
</plugins>
152+
</build>
153+
</profile>
154+
</profiles>
96155
<build>
97156
<plugins>
98157
<plugin>

src/main/java/de/doubleslash/keeptime/Main.java renamed to src/main/java/de/doubleslash/keeptime/App.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@
6262
import javafx.stage.StageStyle;
6363

6464
@SpringBootApplication
65-
public class Main extends Application {
65+
public class App extends Application {
6666

67-
private static final Logger LOG = LoggerFactory.getLogger(Main.class);
67+
private static final Logger LOG = LoggerFactory.getLogger(App.class);
6868

6969
private ConfigurableApplicationContext springContext;
7070

@@ -84,7 +84,7 @@ public void init() throws Exception {
8484
final DefaultExceptionHandler defaultExceptionHandler = new DefaultExceptionHandler();
8585
defaultExceptionHandler.register();
8686

87-
springContext = SpringApplication.run(Main.class);
87+
springContext = SpringApplication.run(App.class);
8888
ApplicationProperties applicationProperties = springContext.getBean(ApplicationProperties.class);
8989
LOG.info("KeepTime Version: '{}'.", applicationProperties.getBuildVersion());
9090
LOG.info("KeepTime Build Timestamp: '{}'.", applicationProperties.getBuildTimestamp());
@@ -300,7 +300,4 @@ public void stop() throws Exception {
300300
springContext.stop();
301301
}
302302

303-
public static void main(final String[] args) {
304-
launch(Main.class, args);
305-
}
306303
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package de.doubleslash.keeptime;
2+
3+
import static javafx.application.Application.launch;
4+
5+
public class KeepTime {
6+
public static void main(final String[] args) {
7+
launch(App.class, args);
8+
}
9+
}

src/main/java/de/doubleslash/keeptime/view/ManageWorkController.java

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@
2121
import java.time.format.DateTimeParseException;
2222
import java.time.format.FormatStyle;
2323

24+
import javafx.scene.control.skin.ComboBoxListViewSkin;
2425
import org.slf4j.Logger;
2526
import org.slf4j.LoggerFactory;
2627

27-
import com.sun.javafx.scene.control.skin.ComboBoxListViewSkin;
28-
2928
import de.doubleslash.keeptime.common.ColorHelper;
3029
import de.doubleslash.keeptime.common.StyleUtils;
3130
import de.doubleslash.keeptime.model.Model;
@@ -229,21 +228,22 @@ public Project fromString(final String string) {
229228
// needs to set again because editable is ignored from fxml because of custom preselection of current Project
230229
projectComboBox.setEditable(true);
231230

232-
projectComboBox.valueProperty().addListener(
233-
(final ObservableValue<? extends Project> observable, final Project oldValue, final Project newValue) -> {
234-
if (newValue == null) {
235-
return;
236-
}
231+
projectComboBox.valueProperty()
232+
.addListener((final ObservableValue<? extends Project> observable, final Project oldValue,
233+
final Project newValue) -> {
234+
if (newValue == null) {
235+
return;
236+
}
237237

238-
selectedProject = newValue;
239-
comboChange = true;
240-
// needed to avoid exception on empty textfield https://bugs.openjdk.java.net/browse/JDK-8081700
241-
Platform.runLater(() -> {
242-
setTextColor(projectComboBox.getEditor(), newValue.getColor());
243-
});
244-
}
238+
selectedProject = newValue;
239+
comboChange = true;
240+
// needed to avoid exception on empty textfield https://bugs.openjdk.java.net/browse/JDK-8081700
241+
Platform.runLater(() -> {
242+
setTextColor(projectComboBox.getEditor(), newValue.getColor());
243+
});
244+
}
245245

246-
);
246+
);
247247

248248
enableStrgA_combo();
249249

@@ -290,17 +290,21 @@ public void changed(final ObservableValue<? extends String> observable, final St
290290
});
291291

292292
// manages Focusbehaviour
293-
projectComboBox.getEditor().focusedProperty().addListener((final ObservableValue<? extends Boolean> observable,
294-
final Boolean oldIsFocused, final Boolean newIsFocused) -> {
295-
if (newIsFocused) {
296-
// needed to avoid exception on empty textfield https://bugs.openjdk.java.net/browse/JDK-8081700
297-
Platform.runLater(() -> projectComboBox.getEditor().selectAll());
298-
} else {
299-
// needed to avoid exception on empty textfield https://bugs.openjdk.java.net/browse/JDK-8081700
300-
Platform.runLater(() -> projectComboBox.hide());
301-
}
302-
303-
});
293+
projectComboBox.getEditor()
294+
.focusedProperty()
295+
.addListener((final ObservableValue<? extends Boolean> observable, final Boolean oldIsFocused,
296+
final Boolean newIsFocused) -> {
297+
if (newIsFocused) {
298+
// needed to avoid exception on empty textfield
299+
// https://bugs.openjdk.java.net/browse/JDK-8081700
300+
Platform.runLater(() -> projectComboBox.getEditor().selectAll());
301+
} else {
302+
// needed to avoid exception on empty textfield
303+
// https://bugs.openjdk.java.net/browse/JDK-8081700
304+
Platform.runLater(() -> projectComboBox.hide());
305+
}
306+
307+
});
304308

305309
// on
306310
projectComboBox.setOnKeyReleased(ke -> {

src/main/java/de/doubleslash/keeptime/view/ReportController.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
import java.util.TreeSet;
2626
import java.util.stream.Collectors;
2727

28+
import javafx.scene.control.skin.DatePickerSkin;
2829
import org.slf4j.Logger;
2930
import org.slf4j.LoggerFactory;
3031
import org.springframework.beans.factory.annotation.Autowired;
3132
import org.springframework.stereotype.Component;
3233

33-
import com.sun.javafx.scene.control.skin.DatePickerSkin;
3434

3535
import de.doubleslash.keeptime.common.DateFormatter;
3636
import de.doubleslash.keeptime.common.Resources;
@@ -135,6 +135,7 @@ private void initialize() {
135135

136136
colorTimeLine = new ColorTimeLine(colorTimeLineCanvas);
137137
initTableView();
138+
138139
}
139140

140141
private void initTableView() {
@@ -165,26 +166,26 @@ protected void updateItem(final TableRow item, final boolean empty) {
165166
(final TreeTableColumn.CellDataFeatures<TableRow, TableRow> entry) -> new ReadOnlyObjectWrapper<>(
166167
entry.getValue().getValue()));
167168
noteColumn.setMinWidth(200);
168-
noteColumn.impl_setReorderable(false);
169+
noteColumn.setReorderable(false);
169170
this.workTableTreeView.getColumns().add(noteColumn);
170171

171172
final TreeTableColumn<TableRow, String> timeRangeColumn = new TreeTableColumn<>("Timeslot");
172173
timeRangeColumn.setCellValueFactory(new TreeItemPropertyValueFactory<TableRow, String>("timeRange"));
173174
timeRangeColumn.setMinWidth(120);
174-
timeRangeColumn.impl_setReorderable(false);
175+
timeRangeColumn.setReorderable(false);
175176
this.workTableTreeView.getColumns().add(timeRangeColumn);
176177

177178
final TreeTableColumn<TableRow, String> timeSumColumn = new TreeTableColumn<>("Duration");
178179
timeSumColumn.setCellValueFactory(new TreeItemPropertyValueFactory<TableRow, String>("timeSum"));
179180
timeSumColumn.setMinWidth(60);
180-
timeSumColumn.impl_setReorderable(false);
181+
timeSumColumn.setReorderable(false);
181182
this.workTableTreeView.getColumns().add(timeSumColumn);
182183

183184
final TreeTableColumn<TableRow, Button> buttonColumn = new TreeTableColumn<>("Controls");
184185
buttonColumn.setCellValueFactory(new TreeItemPropertyValueFactory<TableRow, Button>("buttonBox"));
185186
buttonColumn.setMinWidth(100);
186187
buttonColumn.setSortable(false);
187-
buttonColumn.impl_setReorderable(false);
188+
buttonColumn.setReorderable(false);
188189
this.workTableTreeView.getColumns().add(buttonColumn);
189190

190191
workTableTreeView.setShowRoot(false);

src/main/java/de/doubleslash/keeptime/view/SettingsController.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,9 @@
1818

1919
import java.io.File;
2020
import java.io.IOException;
21-
import java.net.URL;
22-
import java.nio.charset.Charset;
2321
import java.nio.file.Paths;
2422
import java.sql.SQLException;
25-
import java.time.LocalDate;
26-
import java.util.List;
27-
import java.util.stream.Collectors;
2823

29-
import de.doubleslash.keeptime.Main;
30-
import de.doubleslash.keeptime.model.Project;
31-
import de.doubleslash.keeptime.model.Work;
3224
import javafx.application.Platform;
3325
import javafx.scene.control.*;
3426
import org.h2.tools.RunScript;

src/main/java/de/doubleslash/keeptime/view/ViewController.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ private class Delta {
150150
private final BooleanProperty mouseHoveringProperty = new SimpleBooleanProperty(false);
151151
public static final LongProperty activeWorkSecondsProperty = new SimpleLongProperty(0);
152152
public static final ObjectProperty<Color> fontColorProperty = new SimpleObjectProperty<>();
153+
private boolean contextMenuOpenBoolean = false;
153154

154155
private Stage reportStage;
155156
private ReportController reportController;
@@ -268,8 +269,19 @@ private void initialize() {
268269

269270
pane.setOnMouseEntered(a -> mouseHoveringProperty.set(true));
270271

271-
pane.setOnMouseExited(a -> mouseHoveringProperty.set(false));
272+
projectsVBox.setOnContextMenuRequested(c -> { // Is needed because the Context menu loses Focus otherwise
273+
mouseHoveringProperty.set(true);
274+
LOG.trace("Options selected");
275+
contextMenuOpenBoolean = true;
276+
});
277+
278+
pane.setOnMouseExited(a -> {
279+
if (!contextMenuOpenBoolean) {
280+
mouseHoveringProperty.set(false);
281+
}
282+
contextMenuOpenBoolean = false;
272283

284+
});
273285
// Drag stage
274286
pane.setOnMousePressed(mouseEvent -> {
275287

@@ -577,7 +589,7 @@ public void savePosition() {
577589
return;
578590
}
579591

580-
LOG.debug("Stage position changed '{}'/'{}'.", mainStage.xProperty().doubleValue(),
592+
LOG.trace("Stage position changed '{}'/'{}'.", mainStage.xProperty().doubleValue(),
581593
mainStage.yProperty().doubleValue());
582594

583595
final ScreenPosHelper positionHelper = new ScreenPosHelper(mainStage.xProperty().doubleValue(),

src/main/resources/logback.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
1515
</encoder>
1616
</appender>
17-
18-
<logger name="de.doubleslash" level="debug" />
1917

2018
<root level="info">
2119
<appender-ref ref="STDOUT" />

0 commit comments

Comments
 (0)