Browse Source

Open in filebrowser exchanged for copy filepath

prepared for mac build
betaFixes
Bianca Mac 6 months ago
parent
commit
30869278a7
  1. 2
      .gitignore
  2. 3
      health_data_export/.gitignore
  3. 198
      health_data_export/dependency-reduced-pom.xml
  4. BIN
      health_data_export/health_data_export-7.jar
  5. 16
      health_data_export/macos.entitlements
  6. BIN
      health_data_export/res/application/RI_Logo_blau_en_short_mac.icns
  7. 2
      health_data_export/res/application/style.css
  8. 38
      health_data_export/src/application/UICoordinator.java
  9. 2
      health_data_export/src/application/res/Text.java
  10. BIN
      health_data_export/target/health_data_export-7.jar
  11. 5
      health_data_export/target/maven-archiver/pom.properties
  12. BIN
      health_data_export/target/original-health_data_export-7.jar

2
.gitignore

@ -6,3 +6,5 @@ health_data_export/target/generated-sources/
health_data_export/target/maven_archiver/
health_data_export/target/maven-status/
health_data_export/target/test-classes/
health_data_export/tmp
health_data_export/HealthTool.app

3
health_data_export/.gitignore

@ -1 +1,4 @@
/target/
/tmp/
/HealthTool.app/
/HealthTool-1.1.dmg

198
health_data_export/dependency-reduced-pom.xml

@ -1,99 +1,99 @@
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>health_data_export</groupId>
<artifactId>health_data_export</artifactId>
<version>7</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.cbi.maven.plugins</groupId>
<artifactId>eclipse-dmg-packager</artifactId>
<version>1.3.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.cbi.maven.plugins</groupId>
<artifactId>eclipse-dmg-packager</artifactId>
<version>1.3.0</version>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.5</version>
<configuration>
<mainClass>health_data_export/application.SuperMain</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<mainClass>application.SuperMain</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>eclipse cbi</id>
<url>https://repo.eclipse.org/content/repositories/cbi-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>eclipse cbi</id>
<url>https://repo.eclipse.org/content/repositories/cbi-releases</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx</artifactId>
<version>11</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
<?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">
<modelVersion>4.0.0</modelVersion>
<groupId>health_data_export</groupId>
<artifactId>health_data_export</artifactId>
<version>7</version>
<build>
<sourceDirectory>src</sourceDirectory>
<resources>
<resource>
<directory>src</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.eclipse.cbi.maven.plugins</groupId>
<artifactId>eclipse-dmg-packager</artifactId>
<version>1.3.0</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>8</source>
<target>8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.eclipse.cbi.maven.plugins</groupId>
<artifactId>eclipse-dmg-packager</artifactId>
<version>1.3.0</version>
</plugin>
<plugin>
<groupId>org.openjfx</groupId>
<artifactId>javafx-maven-plugin</artifactId>
<version>0.0.5</version>
<configuration>
<mainClass>health_data_export/application.SuperMain</mainClass>
</configuration>
</plugin>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<version>2.9</version>
<configuration>
<downloadSources>true</downloadSources>
<downloadJavadocs>false</downloadJavadocs>
</configuration>
</plugin>
<plugin>
<artifactId>maven-shade-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer>
<mainClass>application.SuperMain</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<repositories>
<repository>
<id>eclipse cbi</id>
<url>https://repo.eclipse.org/content/repositories/cbi-releases</url>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>eclipse cbi</id>
<url>https://repo.eclipse.org/content/repositories/cbi-releases</url>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx</artifactId>
<version>11</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
</dependencies>
</project>

BIN
health_data_export/health_data_export-7.jar

16
health_data_export/macos.entitlements

@ -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>

BIN
health_data_export/res/application/RI_Logo_blau_en_short_mac.icns

2
health_data_export/res/application/style.css

@ -150,7 +150,7 @@
-fx-padding: 5;
}
#openFileInFileBrowser {
#copyToClipboard {
-fx-background-color: #bebebe;
-fx-padding: 5;
}

38
health_data_export/src/application/UICoordinator.java

@ -54,6 +54,7 @@ import javafx.scene.control.TextArea;
import javafx.scene.control.Tooltip;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.DataFormat;
import javafx.scene.input.DragEvent;
@ -70,6 +71,7 @@ import javafx.scene.paint.Color;
import javafx.scene.shape.Line;
import javafx.stage.DirectoryChooser;
import javafx.stage.Stage;
import javafx.util.Duration;
/**
* 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> levelFour = getComboBox(comboContainer);
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.setDisable(false);
@ -1459,20 +1464,30 @@ public class UICoordinator implements ChangeListener<Boolean>
clipboardFiles.add(fileForSaving);
// copy filepath to clipboard
BorderPane showInFileBrowser = new BorderPane();
showInFileBrowser.setId("openFileInFileBrowser");
Label openInFileBrowserText = new Label(Text.OPEN_FILE_IN_BROWSER);
showInFileBrowser.setCenter(openInFileBrowserText);
showInFileBrowser.setLeft(new ImageView(
BorderPane copyToClipboard = new BorderPane();
copyToClipboard.setId("copyToClipboard");
Label clipBoardText = new Label(Text.COPY_FILE_PATH);
copyToClipboard.setCenter(clipBoardText);
copyToClipboard.setLeft(new ImageView(
new Image(this.getClass().
getResourceAsStream("filepath.png"),64.0,64.0, true, true)));
showInFileBrowser.setOnMouseClicked(new EventHandler<MouseEvent>()
copyToClipboard.setOnMouseClicked(new EventHandler<MouseEvent>()
{
@Override
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(goToNextcloud, Priority.ALWAYS);
nextcloudHelp.getChildren().add(dragToNextcloud);
nextcloudHelp.getChildren().add(showInFileBrowser);
nextcloudHelp.getChildren().add(copyToClipboard);
container.getChildren().add(nextcloudHelp);
TextArea copyable = new TextArea(String.format(Text.F_RAW_UPLOAD_DATA, fileForSaving.getAbsolutePath(),Text.NEXTCLOUD_ADDRESS));
copyable.setEditable(false);
copyable.setWrapText(true);
copyable.setStyle("-fx-font-family :\"Arial\"");
copyable.setId("buttonProblems");
copyable.setFocusTraversable(false);
copyable.setPrefHeight(70);

2
health_data_export/src/application/res/Text.java

@ -137,7 +137,7 @@ public class Text
+ "\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 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 DRAG_FILE = "Drag me to nextcloud server!";
public static final String DRAG_IN_ACTION = "Started dragging the file";

BIN
health_data_export/target/health_data_export-7.jar

5
health_data_export/target/maven-archiver/pom.properties

@ -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

BIN
health_data_export/target/original-health_data_export-7.jar

Loading…
Cancel
Save