Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Commit

Permalink
Fix Help and img chooser; move test; fixes for Maven
Browse files Browse the repository at this point in the history
  • Loading branch information
po4yka committed May 29, 2021
1 parent 2d1ad25 commit 249dc77
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 51 deletions.
30 changes: 14 additions & 16 deletions markdowneditor.iml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/tests" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/${project.build.directory}/classes" />
<excludeFolder url="file://$MODULE_DIR$/${project.build.directory}/test-classes" />
<excludeFolder url="file://$MODULE_DIR$/target" />
Expand All @@ -33,14 +34,16 @@
<orderEntry type="library" name="Maven: org.openjfx:javafx-base:linux:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-controls:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-controls:linux:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-graphics:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-fxml:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-fxml:linux:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-web:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-web:linux:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-media:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-media:linux:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-graphics:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-graphics:win:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-graphics:linux:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: org.openjfx:javafx-graphics:mac:17-ea+11" level="project" />
<orderEntry type="library" name="Maven: com.itextpdf:barcodes:7.1.15" level="project" />
<orderEntry type="library" name="Maven: com.itextpdf:font-asian:7.1.15" level="project" />
<orderEntry type="library" name="Maven: com.itextpdf:forms:7.1.15" level="project" />
Expand All @@ -56,21 +59,16 @@
<orderEntry type="library" name="Maven: com.itextpdf:svg:7.1.15" level="project" />
<orderEntry type="library" name="Maven: com.itextpdf:html2pdf:2.1.6" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.13" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter:5.8.0-M1" level="project" />
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter-api:5.8.0-M1" level="project" />
<orderEntry type="library" name="Maven: org.apiguardian:apiguardian-api:1.1.1" level="project" />
<orderEntry type="library" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
<orderEntry type="library" name="Maven: org.junit.platform:junit-platform-commons:1.8.0-M1" level="project" />
<orderEntry type="library" name="Maven: org.junit.jupiter:junit-jupiter-params:5.8.0-M1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.8.0-M1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.junit.platform:junit-platform-engine:1.8.0-M1" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.4.20" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains.kotlin:kotlin-stdlib:1.4.20" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains:annotations:13.0" level="project" />
<orderEntry type="library" scope="RUNTIME" name="Maven: org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.4.20" level="project" />
<orderEntry type="library" name="Maven: junit:junit:4.13.2" level="project" />
<orderEntry type="library" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter:5.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-api:5.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.apiguardian:apiguardian-api:1.1.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.opentest4j:opentest4j:1.2.0" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-commons:1.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-params:5.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.jupiter:junit-jupiter-engine:5.7.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.junit.platform:junit-platform-engine:1.7.2" level="project" />
<orderEntry type="library" name="Maven: org.fxmisc.richtext:richtextfx:0.10.1" level="project" />
<orderEntry type="library" name="Maven: org.reactfx:reactfx:2.0-M5" level="project" />
<orderEntry type="library" name="Maven: org.fxmisc.undo:undofx:2.1.0" level="project" />
Expand Down
46 changes: 19 additions & 27 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,21 @@
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics</artifactId>
<artifactId>javafx-graphics </artifactId>
<version>17-ea+11</version>
<classifier>win</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics </artifactId>
<version>17-ea+11</version>
<classifier>linux</classifier>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-graphics </artifactId>
<version>17-ea+11</version>
<classifier>mac</classifier>
</dependency>
<dependency>
<groupId>com.itextpdf</groupId>
Expand All @@ -55,14 +68,13 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
<version>4.13.2</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>RELEASE</version>
<scope>compile</scope>
<version>5.7.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.fxmisc.richtext</groupId>
Expand All @@ -80,6 +92,8 @@
</repositories>

<build>
<sourceDirectory>src/main/java</sourceDirectory>
<testSourceDirectory>src/main/tests</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -106,28 +120,6 @@
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>markdowneditor.launcher.MainLauncher</mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
Expand Down
7 changes: 2 additions & 5 deletions src/main/java/markdowneditor/launcher/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public static Stage getParentStage() {
private static void openWindow() throws IOException {
var stage = new Stage();

URL res = classValue.getResource("helpWindow.fxml");
URL res = classValue.getResource("/fxml/helpWindow.fxml");
assert (res != null) : "res in Main openWindow is null";
Parent root = FXMLLoader.load(res);
var scene = new Scene(root);
Expand Down Expand Up @@ -117,7 +117,7 @@ public static File openSavePdfDialog() {

public static String[] openLinkImagePicker(String text, boolean mustBeImage) throws IOException {
FXMLLoader loader = new FXMLLoader();
URL res = classValue.getResource("imageLinkPicker.fxml");
URL res = classValue.getResource("/fxml/imageLinkPicker.fxml");
assert (res != null) : "res in Main openLinkImagePicker is null";
loader.setLocation(res);
final Parent rootPane = loader.load();
Expand Down Expand Up @@ -174,9 +174,6 @@ public void start(Stage primaryStage) {

primaryStage.show();
} catch (Exception e) {
String msg = e.getMessage();
Throwable stacktrace = e.getCause();
e.printStackTrace();
displayError(e);
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/markdowneditor/model/utils/StyleLoader.java
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
package markdowneditor.model.utils;

import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.nio.file.Files;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
import java.util.concurrent.atomic.AtomicReference;

public abstract class StyleLoader {
public static Map<String, String> getAllStyles() throws IOException {
Expand Down

0 comments on commit 249dc77

Please sign in to comment.