Open in filebrowser exchanged for copy filepath

prepared for mac build
This commit is contained in:
bs
2021-05-21 18:22:36 +02:00
parent b8585f7626
commit 30869278a7
12 changed files with 148 additions and 116 deletions
+2
View File
@@ -6,3 +6,5 @@ health_data_export/target/generated-sources/
health_data_export/target/maven_archiver/ health_data_export/target/maven_archiver/
health_data_export/target/maven-status/ health_data_export/target/maven-status/
health_data_export/target/test-classes/ health_data_export/target/test-classes/
health_data_export/tmp
health_data_export/HealthTool.app
+3
View File
@@ -1 +1,4 @@
/target/ /target/
/tmp/
/HealthTool.app/
/HealthTool-1.1.dmg
+99 -99
View File
@@ -1,99 +1,99 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>health_data_export</groupId> <groupId>health_data_export</groupId>
<artifactId>health_data_export</artifactId> <artifactId>health_data_export</artifactId>
<version>7</version> <version>7</version>
<build> <build>
<sourceDirectory>src</sourceDirectory> <sourceDirectory>src</sourceDirectory>
<resources> <resources>
<resource> <resource>
<directory>src</directory> <directory>src</directory>
<excludes> <excludes>
<exclude>**/*.java</exclude> <exclude>**/*.java</exclude>
</excludes> </excludes>
</resource> </resource>
</resources> </resources>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.eclipse.cbi.maven.plugins</groupId> <groupId>org.eclipse.cbi.maven.plugins</groupId>
<artifactId>eclipse-dmg-packager</artifactId> <artifactId>eclipse-dmg-packager</artifactId>
<version>1.3.0</version> <version>1.3.0</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version> <version>3.8.1</version>
<configuration> <configuration>
<source>8</source> <source>8</source>
<target>8</target> <target>8</target>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.eclipse.cbi.maven.plugins</groupId> <groupId>org.eclipse.cbi.maven.plugins</groupId>
<artifactId>eclipse-dmg-packager</artifactId> <artifactId>eclipse-dmg-packager</artifactId>
<version>1.3.0</version> <version>1.3.0</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.openjfx</groupId> <groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId> <artifactId>javafx-maven-plugin</artifactId>
<version>0.0.5</version> <version>0.0.5</version>
<configuration> <configuration>
<mainClass>health_data_export/application.SuperMain</mainClass> <mainClass>health_data_export/application.SuperMain</mainClass>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-eclipse-plugin</artifactId> <artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version> <version>2.9</version>
<configuration> <configuration>
<downloadSources>true</downloadSources> <downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs> <downloadJavadocs>false</downloadJavadocs>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<artifactId>maven-shade-plugin</artifactId> <artifactId>maven-shade-plugin</artifactId>
<version>2.3</version> <version>2.3</version>
<executions> <executions>
<execution> <execution>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>shade</goal> <goal>shade</goal>
</goals> </goals>
<configuration> <configuration>
<transformers> <transformers>
<transformer> <transformer>
<mainClass>application.SuperMain</mainClass> <mainClass>application.SuperMain</mainClass>
</transformer> </transformer>
</transformers> </transformers>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<repositories> <repositories>
<repository> <repository>
<id>eclipse cbi</id> <id>eclipse cbi</id>
<url>https://repo.eclipse.org/content/repositories/cbi-releases</url> <url>https://repo.eclipse.org/content/repositories/cbi-releases</url>
</repository> </repository>
</repositories> </repositories>
<pluginRepositories> <pluginRepositories>
<pluginRepository> <pluginRepository>
<id>eclipse cbi</id> <id>eclipse cbi</id>
<url>https://repo.eclipse.org/content/repositories/cbi-releases</url> <url>https://repo.eclipse.org/content/repositories/cbi-releases</url>
</pluginRepository> </pluginRepository>
</pluginRepositories> </pluginRepositories>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.openjfx</groupId> <groupId>org.openjfx</groupId>
<artifactId>javafx</artifactId> <artifactId>javafx</artifactId>
<version>11</version> <version>11</version>
<type>pom</type> <type>pom</type>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
Binary file not shown.
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
</dict>
</plist>
+1 -1
View File
@@ -150,7 +150,7 @@
-fx-padding: 5; -fx-padding: 5;
} }
#openFileInFileBrowser { #copyToClipboard {
-fx-background-color: #bebebe; -fx-background-color: #bebebe;
-fx-padding: 5; -fx-padding: 5;
} }
@@ -54,6 +54,7 @@ import javafx.scene.control.TextArea;
import javafx.scene.control.Tooltip; import javafx.scene.control.Tooltip;
import javafx.scene.image.Image; import javafx.scene.image.Image;
import javafx.scene.image.ImageView; import javafx.scene.image.ImageView;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent; import javafx.scene.input.ClipboardContent;
import javafx.scene.input.DataFormat; import javafx.scene.input.DataFormat;
import javafx.scene.input.DragEvent; import javafx.scene.input.DragEvent;
@@ -70,6 +71,7 @@ import javafx.scene.paint.Color;
import javafx.scene.shape.Line; import javafx.scene.shape.Line;
import javafx.stage.DirectoryChooser; import javafx.stage.DirectoryChooser;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.util.Duration;
/** /**
* Main class of the application. Changes the views, commands the work and * Main class of the application. Changes the views, commands the work and
@@ -1105,6 +1107,9 @@ public class UICoordinator implements ChangeListener<Boolean>
ComboBox<String> levelThree = getComboBox(comboContainer); ComboBox<String> levelThree = getComboBox(comboContainer);
ComboBox<String> levelFour = getComboBox(comboContainer); ComboBox<String> levelFour = getComboBox(comboContainer);
levelOne.setStyle("-fx-font-family :\"Arial\""); levelOne.setStyle("-fx-font-family :\"Arial\"");
levelTwo.setStyle("-fx-font-family :\"Arial\"");
levelThree.setStyle("-fx-font-family :\"Arial\"");
levelFour.setStyle("-fx-font-family :\"Arial\"");
levelOne.setItems(getOccupationList("")); levelOne.setItems(getOccupationList(""));
levelOne.setDisable(false); levelOne.setDisable(false);
@@ -1459,20 +1464,30 @@ public class UICoordinator implements ChangeListener<Boolean>
clipboardFiles.add(fileForSaving); clipboardFiles.add(fileForSaving);
// copy filepath to clipboard // copy filepath to clipboard
BorderPane showInFileBrowser = new BorderPane(); BorderPane copyToClipboard = new BorderPane();
showInFileBrowser.setId("openFileInFileBrowser"); copyToClipboard.setId("copyToClipboard");
Label openInFileBrowserText = new Label(Text.OPEN_FILE_IN_BROWSER); Label clipBoardText = new Label(Text.COPY_FILE_PATH);
showInFileBrowser.setCenter(openInFileBrowserText); copyToClipboard.setCenter(clipBoardText);
showInFileBrowser.setLeft(new ImageView( copyToClipboard.setLeft(new ImageView(
new Image(this.getClass(). new Image(this.getClass().
getResourceAsStream("filepath.png"),64.0,64.0, true, true))); getResourceAsStream("filepath.png"),64.0,64.0, true, true)));
showInFileBrowser.setOnMouseClicked(new EventHandler<MouseEvent>() copyToClipboard.setOnMouseClicked(new EventHandler<MouseEvent>()
{ {
@Override @Override
public void handle(MouseEvent arg0) public void handle(MouseEvent arg0)
{ {
hostServices.showDocument(fileForSaving.getParent()); final Clipboard clipboard = Clipboard.getSystemClipboard();
final ClipboardContent content = new ClipboardContent();
content.putString(fileForSaving.getAbsolutePath());
clipboard.setContent(content);
Point2D p = clipBoardText.localToScreen(clipBoardText.getLayoutBounds().getCenterX(),
clipBoardText.getLayoutBounds().getCenterY());
Tooltip copied = new Tooltip(Text.FILE_PATH_IN_CLIPBOARD);
clipBoardText.setTooltip(copied);
copied.show(clipBoardText, p.getX(), p.getY());
copied.setHideDelay(Duration.seconds(5));
copied.autoHideProperty().set(true);
} }
}); });
@@ -1518,16 +1533,17 @@ public class UICoordinator implements ChangeListener<Boolean>
} }
}); });
HBox.setHgrow(showInFileBrowser, Priority.ALWAYS); HBox.setHgrow(copyToClipboard, Priority.ALWAYS);
HBox.setHgrow(dragToNextcloud, Priority.ALWAYS); HBox.setHgrow(dragToNextcloud, Priority.ALWAYS);
HBox.setHgrow(goToNextcloud, Priority.ALWAYS); HBox.setHgrow(goToNextcloud, Priority.ALWAYS);
nextcloudHelp.getChildren().add(dragToNextcloud); nextcloudHelp.getChildren().add(dragToNextcloud);
nextcloudHelp.getChildren().add(showInFileBrowser); nextcloudHelp.getChildren().add(copyToClipboard);
container.getChildren().add(nextcloudHelp); container.getChildren().add(nextcloudHelp);
TextArea copyable = new TextArea(String.format(Text.F_RAW_UPLOAD_DATA, fileForSaving.getAbsolutePath(),Text.NEXTCLOUD_ADDRESS)); TextArea copyable = new TextArea(String.format(Text.F_RAW_UPLOAD_DATA, fileForSaving.getAbsolutePath(),Text.NEXTCLOUD_ADDRESS));
copyable.setEditable(false); copyable.setEditable(false);
copyable.setWrapText(true); copyable.setWrapText(true);
copyable.setStyle("-fx-font-family :\"Arial\"");
copyable.setId("buttonProblems"); copyable.setId("buttonProblems");
copyable.setFocusTraversable(false); copyable.setFocusTraversable(false);
copyable.setPrefHeight(70); copyable.setPrefHeight(70);
@@ -137,7 +137,7 @@ public class Text
+ "\nClick here to copy server adress to clipboard!)"; + "\nClick here to copy server adress to clipboard!)";
public static final String SERVER_ADDRESS_IN_CLIPBOARD = "Server address was saved in clipboard"; public static final String SERVER_ADDRESS_IN_CLIPBOARD = "Server address was saved in clipboard";
public static final String FILE_PATH_IN_CLIPBOARD = "Filepath was saved in clipboard"; public static final String FILE_PATH_IN_CLIPBOARD = "Filepath was saved in clipboard";
public static final String OPEN_FILE_IN_BROWSER = "Open file in filebrowser!"; public static final String COPY_FILE_PATH = "Copy filepath to clipboard!";
public static final String F_RAW_UPLOAD_DATA = "The buttons aren't working for you? Then you might need the following information:\nSaved Data: %s\nNextcloud server: %s"; public static final String F_RAW_UPLOAD_DATA = "The buttons aren't working for you? Then you might need the following information:\nSaved Data: %s\nNextcloud server: %s";
public static final String DRAG_FILE = "Drag me to nextcloud server!"; public static final String DRAG_FILE = "Drag me to nextcloud server!";
public static final String DRAG_IN_ACTION = "Started dragging the file"; public static final String DRAG_IN_ACTION = "Started dragging the file";
Binary file not shown.
@@ -1,5 +0,0 @@
#Generated by Maven
#Fri May 21 10:51:02 CEST 2021
groupId=health_data_export
artifactId=health_data_export
version=7