diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml deleted file mode 100644 index 6cb3bb972901..000000000000 --- a/.github/workflows/gradle-wrapper-validation.yml +++ /dev/null @@ -1,14 +0,0 @@ -# This is https://github.com/marketplace/actions/gradle-wrapper-validation -# It ensures that the jar file is from gradle and not by a strange third party. - -name: "Validate Gradle Wrapper" -on: [push, pull_request] - -jobs: - validation: - name: "Validation" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: gradle/wrapper-validation-action@v1 - diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e056bfd16a49..adbebcba3c1e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -208,3 +208,11 @@ jobs: CI: "false" # we pretend to run locally - even if tests fail on the CI, they count towards test coverage CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} DBMS: "postgresql" + # This is https://github.com/marketplace/actions/gradle-wrapper-validation + # It ensures that the jar file is from gradle and not by a strange third party. + gradlevalidation: + name: "Validate Gradle Wrapper" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: gradle/wrapper-validation-action@v1 diff --git a/.sonarcloud.properties b/.sonarcloud.properties new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/.sonarcloud.properties @@ -0,0 +1 @@ + diff --git a/CHANGELOG.md b/CHANGELOG.md index 88539afa5ac8..1477782a1607 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,7 +13,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# ### Changed -- We reintroduced the possibility to extract references from plain text (using GROBID) [#5614](https://github.com/JabRef/jabref/pull/5614) +- We reintroduced the possibility to extract references from plain text (using GROBID) [#5614](https://github.com/JabRef/jabref/pull/5614) - We changed the open office panel to show buttons in rows of three instead of going straight down to save space as the button expanded out to take up unnecessary horizontal space. [#5479](https://github.com/JabRef/jabref/issues/5479) - We cleaned up the group add/edit dialog. [#5826](https://github.com/JabRef/jabref/pull/5826) - We reintroduced the index column. [#5844](https://github.com/JabRef/jabref/pull/5844) @@ -37,8 +37,15 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed several issues concerning managing external file types: Now everything is usable and fully functional. Previously, there were problems with the radio buttons, with saving the settings and with loading an input field value. Furthermore, different behavior for Windows and other operating systems was given, which was unified as well. [#5846](https://github.com/JabRef/jabref/issues/5846) - We fixed an issue where entries containing Unicode charaters were not parsed correctly [#5899](https://github.com/JabRef/jabref/issues/5899) - We fixed an issue where an entry containing an external filename with curly braces could not be saved. Curly braces are now longer allowed in filenames. [#5899](https://github.com/JabRef/jabref/issues/5899) +- We fixed an issue where changing the type of an entry did not update the main table [#5906](https://github.com/JabRef/jabref/issues/5906) +- We fixed an issue where opening a library from the recent libraries menu was not possible [#5939](https://github.com/JabRef/jabref/issues/5939) +- We fixed an issue in the optics of the library properties, that cropped the dialog on scaled displays. [#5969](https://github.com/JabRef/jabref/issues/5969) - We fixed an issue where changing the type of an entry did not update the main table. [#5906](https://github.com/JabRef/jabref/issues/5906) - We fixed an issue where opening a library from the recent libraries menu was not possible. [#5939](https://github.com/JabRef/jabref/issues/5939) +- We fixed an issue where the most bottom group in the list got lost, if it was dragged on itself. [#5983](https://github.com/JabRef/jabref/issues/5983) +- We fixed an issue where changing entry type doesn't always work when biblatex source is shown. [#5905](https://github.com/JabRef/jabref/issues/5905) +- We fixed an issue where the group and the link column were not updated after changing the entry in the main table. [#5985](https://github.com/JabRef/jabref/issues/5985) +- We fixed an issue where reordering the groups was not possible after inserting an article. [#6008](https://github.com/JabRef/jabref/issues/6008) ### Removed diff --git a/build.gradle b/build.gradle index e942fe2262be..3daa53628ce4 100644 --- a/build.gradle +++ b/build.gradle @@ -19,8 +19,7 @@ plugins { id 'application' id "com.simonharrer.modernizer" version '1.8.0-1' id 'me.champeau.gradle.jmh' version '0.5.0' - //id 'net.ltgt.errorprone' version '0.8.1' - id 'com.github.ben-manes.versions' version '0.27.0' + id 'com.github.ben-manes.versions' version '0.28.0' id 'org.javamodularity.moduleplugin' version '1.5.0' id 'org.openjfx.javafxplugin' version '0.0.8' id 'org.beryx.jlink' version '2.17.2' @@ -46,10 +45,14 @@ apply from: 'eclipse.gradle' group = "org.jabref" version = project.findProperty('projVersion') ?: '100.0.0' -sourceCompatibility = 13 -targetCompatibility = 13 +java { + sourceCompatibility = JavaVersion.VERSION_13 + targetCompatibility = JavaVersion.VERSION_13 +} -mainClassName = "$moduleName/org.jabref.JabRefLauncher" +application { + mainClassName = "$moduleName/org.jabref.JabRefLauncher" +} // TODO: Ugly workaround to temporarily ignore build errors to dependencies of latex2unicode // These should be removed, as well as the files in the lib folder, as soon as they have valid module names @@ -91,7 +94,6 @@ repositories { } configurations { - //errorprone libreoffice // TODO: Remove the following workaround for split error messages such as @@ -108,121 +110,108 @@ javafx { dependencies { // Include all jar-files in the 'lib' folder as dependencies - compile fileTree(dir: 'lib', includes: ['*.jar']) + implementation fileTree(dir: 'lib', includes: ['*.jar']) - compile 'org.apache.pdfbox:pdfbox:2.0.18' - compile 'org.apache.pdfbox:fontbox:2.0.18' - compile 'org.apache.pdfbox:xmpbox:2.0.18' + implementation 'org.apache.pdfbox:pdfbox:2.0.18' + implementation 'org.apache.pdfbox:fontbox:2.0.18' + implementation 'org.apache.pdfbox:xmpbox:2.0.18' - compile group: 'org.apache.commons', name: 'commons-csv', version: '1.8' + implementation group: 'org.apache.commons', name: 'commons-csv', version: '1.8' - compile group: 'org.apache.tika', name: 'tika-core', version: '1.23' + implementation group: 'org.apache.tika', name: 'tika-core', version: '1.23' // required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635 - compile 'org.bouncycastle:bcprov-jdk15on:1.64' + implementation 'org.bouncycastle:bcprov-jdk15on:1.64' - compile 'commons-cli:commons-cli:1.4' + implementation 'commons-cli:commons-cli:1.4' // For Java 9+ compatibility, we include a bundled version of the libreoffice libraries // See https://bugs.documentfoundation.org/show_bug.cgi?id=117331#c8 for background information // Use the task bundleLibreOffice to update the bundled jar - //compile "org.libreoffice:juh:6.2.3" - //compile "org.libreoffice:jurt:6.2.3" - //compile "org.libreoffice:ridl:6.2.3" - //compile "org.libreoffice:unoil:6.2.3" + //implementation "org.libreoffice:juh:6.2.3" + //implementation "org.libreoffice:jurt:6.2.3" + //implementation "org.libreoffice:ridl:6.2.3" + //implementation "org.libreoffice:unoil:6.2.3" - compile 'io.github.java-diff-utils:java-diff-utils:4.5' - compile 'info.debatty:java-string-similarity:1.2.1' + implementation 'io.github.java-diff-utils:java-diff-utils:4.5' + implementation 'info.debatty:java-string-similarity:1.2.1' antlr3 'org.antlr:antlr:3.5.2' - compile 'org.antlr:antlr-runtime:3.5.2' + implementation 'org.antlr:antlr-runtime:3.5.2' antlr4 'org.antlr:antlr4:4.8-1' - compile 'org.antlr:antlr4-runtime:4.8-1' + implementation 'org.antlr:antlr4-runtime:4.8-1' - compile group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.5.4' + implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.5.4' - compile 'org.postgresql:postgresql:42.2.10' + implementation 'org.postgresql:postgresql:42.2.10' - compile ('com.oracle.ojdbc:ojdbc10:19.3.0.0') { + implementation ('com.oracle.ojdbc:ojdbc10:19.3.0.0') { // causing module issues exclude module: 'oraclepki' } - compile ('com.google.guava:guava:28.2-jre') { + implementation ('com.google.guava:guava:28.2-jre') { // TODO: Remove this as soon as https://github.com/google/guava/issues/2960 is fixed exclude module: "jsr305" } - compile group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.5' + implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.5' // JavaFX stuff - compile 'de.jensd:fontawesomefx-commons:11.0' - compile 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-11' - compile 'de.saxsys:mvvmfx-validation:1.9.0-SNAPSHOT' - compile 'de.saxsys:mvvmfx:1.8.0' - compile 'org.fxmisc.easybind:easybind:1.0.3' - compile 'org.fxmisc.flowless:flowless:0.6.1' - compile 'org.fxmisc.richtext:richtextfx:0.10.3' - compile group: 'org.glassfish.hk2.external', name: 'jakarta.inject', version: '2.6.1' - compile 'com.jfoenix:jfoenix:9.0.9' - compile 'org.controlsfx:controlsfx:11.0.1' - - compile 'org.jsoup:jsoup:1.12.2' - compile 'com.konghq:unirest-java:3.5.00' - - compile 'org.slf4j:slf4j-api:2.0.0-alpha1' - compile group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '3.0.0-SNAPSHOT' - compile group: 'org.apache.logging.log4j', name: 'log4j-slf4j18-impl', version: '3.0.0-SNAPSHOT' - compile group: 'org.apache.logging.log4j', name: 'log4j-plugins', version: '3.0.0-SNAPSHOT' + implementation 'de.jensd:fontawesomefx-commons:11.0' + implementation 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-11' + implementation 'de.saxsys:mvvmfx-validation:1.9.0-SNAPSHOT' + implementation 'de.saxsys:mvvmfx:1.8.0' + implementation 'org.fxmisc.easybind:easybind:1.0.3' + implementation 'org.fxmisc.flowless:flowless:0.6.1' + implementation 'org.fxmisc.richtext:richtextfx:0.10.4' + implementation group: 'org.glassfish.hk2.external', name: 'jakarta.inject', version: '2.6.1' + implementation 'com.jfoenix:jfoenix:9.0.9' + implementation 'org.controlsfx:controlsfx:11.0.1' + + implementation 'org.jsoup:jsoup:1.12.2' + implementation 'com.konghq:unirest-java:3.6.00' + + implementation 'org.slf4j:slf4j-api:2.0.0-alpha1' + implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '3.0.0-SNAPSHOT' + implementation group: 'org.apache.logging.log4j', name: 'log4j-slf4j18-impl', version: '3.0.0-SNAPSHOT' + implementation group: 'org.apache.logging.log4j', name: 'log4j-plugins', version: '3.0.0-SNAPSHOT' implementation group: 'org.apache.logging.log4j', name: 'log4j-api', version: '3.0.0-SNAPSHOT' - compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' + implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' - compile 'de.undercouch:citeproc-java:2.0.0' + implementation 'de.undercouch:citeproc-java:2.0.0' - compile group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1' - compile group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2' - compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.2' + implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1' + implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2' + implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.2' - compile ('com.github.tomtung:latex2unicode_2.12:0.2.6') { + implementation ('com.github.tomtung:latex2unicode_2.12:0.2.6') { exclude module: 'fastparse_2.12' } - /* - TODO: Reenable error prone as soon as https://github.com/google/error-prone/issues/1210 is fixed - errorprone ('com.google.errorprone:error_prone_core:2.3.2') { - exclude module: "jsr305" - exclude group: 'org.checkerframework', module: 'checker-qual' - exclude group: 'com.google.errorprone', module: 'error_prone_annotation' - exclude group: 'com.google.errorprone', module: 'error_prone_annotations' - exclude group: 'com.google.errorprone', module: 'error_prone_check_api' - } - */ - - compile group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.4.1' - compile (group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.4.1') { + implementation group: 'com.microsoft.azure', name: 'applicationinsights-core', version: '2.4.1' + implementation (group: 'com.microsoft.azure', name: 'applicationinsights-logging-log4j2', version: '2.4.1') { exclude module: "log4j-core" } - testCompile 'io.github.classgraph:classgraph:4.8.64' + testImplementation 'io.github.classgraph:classgraph:4.8.65' testImplementation 'org.junit.jupiter:junit-jupiter:5.6.0' testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.6.0' - testCompile 'org.junit.platform:junit-platform-launcher:1.6.0' + testImplementation 'org.junit.platform:junit-platform-launcher:1.6.0' - testCompile 'net.bytebuddy:byte-buddy-parent:1.10.8' + testImplementation 'net.bytebuddy:byte-buddy-parent:1.10.8' testRuntime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' testRuntime group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT' - testCompile 'org.mockito:mockito-core:3.2.4' - //testCompile 'com.github.tomakehurst:wiremock:2.24.1' - testCompile 'org.xmlunit:xmlunit-core:2.6.3' - testCompile 'org.xmlunit:xmlunit-matchers:2.6.3' - testCompile 'com.tngtech.archunit:archunit-junit5-api:0.13.1' - //testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.13.0' - testCompile "org.testfx:testfx-core:4.0.17-alpha-SNAPSHOT" - testCompile "org.testfx:testfx-junit5:4.0.17-alpha-SNAPSHOT" - testCompile "org.hamcrest:hamcrest-library:2.2" + testImplementation 'org.mockito:mockito-core:3.3.0' + testImplementation 'org.xmlunit:xmlunit-core:2.6.3' + testImplementation 'org.xmlunit:xmlunit-matchers:2.6.3' + testImplementation 'com.tngtech.archunit:archunit-junit5-api:0.13.1' + testImplementation "org.testfx:testfx-core:4.0.17-alpha-SNAPSHOT" + testImplementation "org.testfx:testfx-junit5:4.0.17-alpha-SNAPSHOT" + testImplementation "org.hamcrest:hamcrest-library:2.2" checkstyle 'com.puppycrawl.tools:checkstyle:8.29' xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.2' @@ -310,7 +299,6 @@ processResources { } } - task generateSource(dependsOn: ["generateBstGrammarSource", "generateSearchGrammarSource", "generateMedlineSource", @@ -379,7 +367,6 @@ task generateModsSource(type: XjcTask) { } tasks.withType(JavaCompile) { - // use UTF-8 options.encoding = 'UTF-8' } @@ -552,12 +539,6 @@ checkstyle { sourceSets = [] } -modernizer { - // We have more than 20 issues, which are not fixed yet. Nevertheless, we produce the modernizer output. - // See https://github.com/andrewgaul/modernizer-maven-plugin for more information on modernizer - failOnViolations = false -} - // Release tasks task deleteInstallerTemp(type: Delete) { delete "$buildDir/installer" @@ -582,41 +563,81 @@ jlink { // TODO: Remove the following correction to the merged module // The module descriptor automatically generated by the plugin for the merged module contained some invalid entries. - // Execute ./gradlew suggestMergedModuleInfo and include the incorrect directives here. + // Execute ./gradlew suggestMergedModuleInfo and include the suggested directives here. mergedModule { - requires 'java.logging' - requires 'jdk.xml.dom' - requires 'java.sql' - requires 'java.rmi' requires 'java.xml' requires 'com.sun.xml.txw2' - requires 'com.google.gson' requires 'java.desktop' - requires 'java.security.jgss' - requires 'jdk.jsobject' + requires 'org.objectweb.asm' + requires 'jdk.jfr' requires 'jdk.unsupported' + requires 'com.google.gson' requires 'java.management' requires 'java.naming' - requires 'jdk.unsupported.desktop' requires 'java.security.sasl' + requires 'com.sun.xml.fastinfoset' + requires 'jdk.security.jgss' + requires 'java.logging' + requires 'jdk.xml.dom' + requires 'java.sql' + requires 'java.rmi' + requires 'java.security.jgss' + requires 'com.oracle.truffle.regex' + requires 'jdk.jsobject' + requires 'jdk.management' + requires 'jdk.unsupported.desktop' + requires 'org.objectweb.asm.util' requires 'java.scripting' + requires 'org.objectweb.asm.commons' + requires 'org.graalvm.truffle' requires 'java.datatransfer' requires 'java.compiler' + requires 'java.sql.rowset' requires 'java.transaction.xa' - requires 'com.sun.xml.fastinfoset' + requires 'org.graalvm.sdk' requires 'org.slf4j' - uses 'com.airhacks.afterburner.injection.PresenterFactory' + uses 'org.apache.logging.log4j.util.PropertySource' + uses 'org.apache.logging.log4j.core.util.WatchEventService' + uses 'org.apache.logging.log4j.plugins.processor.PluginService' uses 'org.controlsfx.glyphfont.GlyphFont' uses 'com.airhacks.afterburner.views.ResourceLocator' + uses 'com.oracle.truffle.js.runtime.Evaluator' + uses 'org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory' + uses 'com.airhacks.afterburner.injection.PresenterFactory' + uses 'com.oracle.truffle.js.runtime.builtins.JSFunctionLookup' + uses 'org.apache.logging.log4j.spi.Provider' + uses 'org.mariadb.jdbc.tls.TlsSocketPlugin' + uses 'org.mariadb.jdbc.LocalInfileInterceptor' uses 'javax.xml.bind.JAXBContextFactory' - provides 'java.sql.Driver' with 'org.postgresql.Driver' + provides 'javax.annotation.processing.Processor' with 'org.apache.logging.log4j.plugins.processor.PluginProcessor' provides 'org.controlsfx.glyphfont.GlyphFont' with 'org.controlsfx.glyphfont.FontAwesome' - provides 'org.apache.commons.logging.LogFactory' with 'org.apache.logging.log4j.jcl.LogFactoryImpl' - provides 'org.slf4j.spi.SLF4JServiceProvider' with 'org.apache.logging.slf4j.SLF4JServiceProvider' + provides 'org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory' with 'org.apache.logging.log4j.core.message.ExtendedThreadInfoFactory' + provides 'org.mariadb.jdbc.tls.TlsSocketPlugin' with 'org.mariadb.jdbc.internal.protocol.tls.DefaultTlsSocketPlugin' provides 'com.microsoft.applicationinsights.core.dependencies.io.grpc.ServerProvider' with 'com.microsoft.applicationinsights.core.dependencies.io.grpc.netty.shaded.io.grpc.netty.NettyServerProvider' + provides 'com.oracle.truffle.js.runtime.Evaluator' with 'com.oracle.truffle.js.parser.GraalJSEvaluator' provides 'com.microsoft.applicationinsights.core.dependencies.io.grpc.NameResolverProvider' with 'com.microsoft.applicationinsights.core.dependencies.io.grpc.internal.DnsNameResolverProvider' - provides 'java.security.Provider' with 'org.bouncycastle.jce.provider.BouncyCastleProvider', 'org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider' + provides 'org.apache.logging.log4j.util.PropertySource' with 'org.apache.logging.log4j.util.EnvironmentPropertySource', + 'org.apache.logging.log4j.util.SystemPropertiesPropertySource' + provides 'java.sql.Driver' with 'org.postgresql.Driver' + provides 'org.apache.logging.log4j.plugins.processor.PluginService' with 'org.apache.logging.log4j.plugins.convert.plugins.Log4jPlugins' + provides 'org.mariadb.jdbc.authentication.AuthenticationPlugin' with 'org.mariadb.jdbc.internal.com.send.authentication.CachingSha2PasswordPlugin', + 'org.mariadb.jdbc.internal.com.send.authentication.ClearPasswordPlugin', + 'org.mariadb.jdbc.internal.com.send.authentication.Ed25519PasswordPlugin', + 'org.mariadb.jdbc.internal.com.send.authentication.NativePasswordPlugin', + 'org.mariadb.jdbc.internal.com.send.authentication.OldPasswordPlugin', + 'org.mariadb.jdbc.internal.com.send.authentication.SendGssApiAuthPacket', + 'org.mariadb.jdbc.internal.com.send.authentication.SendPamAuthPacket', + 'org.mariadb.jdbc.internal.com.send.authentication.Sha256PasswordPlugin' + provides 'org.mariadb.jdbc.credential.CredentialPlugin' with 'org.mariadb.jdbc.credential.aws.AwsIamCredentialPlugin', + 'org.mariadb.jdbc.credential.env.EnvCredentialPlugin', + 'org.mariadb.jdbc.credential.system.PropertiesCredentialPlugin' + provides 'org.apache.commons.logging.LogFactory' with 'org.apache.logging.log4j.jcl.LogFactoryImpl' + provides 'org.slf4j.spi.SLF4JServiceProvider' with 'org.apache.logging.slf4j.SLF4JServiceProvider' + provides 'org.apache.logging.log4j.spi.Provider' with 'org.apache.logging.log4j.core.impl.Log4jProvider' + provides 'java.security.Provider' with 'org.bouncycastle.jce.provider.BouncyCastleProvider', + 'org.bouncycastle.pqc.jcajce.provider.BouncyCastlePQCProvider' provides 'com.microsoft.applicationinsights.core.dependencies.io.grpc.ManagedChannelProvider' with 'com.microsoft.applicationinsights.core.dependencies.io.grpc.netty.shaded.io.grpc.netty.NettyChannelProvider' + provides 'com.oracle.truffle.js.runtime.builtins.JSFunctionLookup' with 'com.oracle.truffle.js.builtins.JSDefaultBuiltinLookup' } jpackage { diff --git a/docs/README.md b/docs/README.md index 77a97ec85c44..efaebcf04e8a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -2,9 +2,15 @@ This page presents all development informatation around JabRef. For users documentation see . +## Excersises + +Uni Basel offers a German (🇩🇪) Software Engineering course which uses JabRef as one example. +Look at [Exercise 5](https://github.com/unibas-marcelluethi/software-engineering/blob/master/docs/week5/exercises/practical-exercises.md) for an exercise where some important points of JabRef are touched. + ## How tos -- [Sync your fork with the JabRef repository](https://help.github.com/articles/syncing-a-fork/) +- External: [Sync your fork with the JabRef repository](https://help.github.com/articles/syncing-a-fork/) +- External (🇩🇪): Branches and pull requests: ## Command Line diff --git a/docs/code-quality.md b/docs/code-quality.md new file mode 100644 index 000000000000..717d9caf0390 --- /dev/null +++ b/docs/code-quality.md @@ -0,0 +1,12 @@ +# Code Quality + +We monitor the general source code quality at three places: + +* [codacy](https://www.codacy.com/) is a hosted service to monitor code quality. It thereby combines the results of available open source code quality checkers such as [Checkstyle](https://checkstyle.sourceforge.io/) or [PMD](https://pmd.github.io/). The code quality analysis for JabRef is available at , especially the [list of open issues](https://app.codacy.com/gh/JabRef/jabref/issues/index). In case a rule feels wrong, it is most likely a PMD rule. The JabRef team can change the configuration at . +* [codecov](https://codecov.io/) is a solution to check code coverage of test cases. The code coverage metrics for JabRef are available at . +* [Teamscale](https://www.cqse.eu/de/produkte/teamscale/landing/) is a popular German product analyzing code quality. The analysis results are available at . + +We strongly recommend to read following two books on code quality: + +* [Java by Comparison](java.by-comparison.com/) is a book by three JabRef developers which focuses on code improvements close to single statements. It is fast to read and one gains much information from each recommendation discussed in the book. +* [Effective Java](https://www.oreilly.com/library/view/effective-java-3rd/9780134686097/) is the standard book for advanced Java programming. Did you know that `enum` is the [recommended way to enforce a singleton instance of a class](https://learning.oreilly.com/library/view/effective-java-3rd/9780134686097/ch2.xhtml#lev3)? Did you know that one should [refer to objects by their interfaces](https://learning.oreilly.com/library/view/effective-java-3rd/9780134686097/ch9.xhtml#lev64)? diff --git a/docs/guidelines-for-setting-up-a-local-workspace.md b/docs/guidelines-for-setting-up-a-local-workspace.md index 1b803d7f70e7..cd4ed16b91b8 100644 --- a/docs/guidelines-for-setting-up-a-local-workspace.md +++ b/docs/guidelines-for-setting-up-a-local-workspace.md @@ -1,12 +1,12 @@ -# Setup a local workspace +# Set up a local workspace This guide explains how to set up your environment for development of JabRef. It includes information about prerequisites, configuring your IDE, and running JabRef locally to verify your setup. -For a complete step-by-step guide (using IntellJ as the IDE), have a look at the following video instructions: +For a complete step-by-step guide for Linux using IntellJ IDEA as the IDE, have a look at the following video instructions: -

- -

+ +JabRef development video tutorial + ## Prerequisites diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 0573733ae7ad..a90f0226983d 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -6,6 +6,7 @@ requires java.sql; // JavaFX + requires javafx.base; requires javafx.graphics; requires javafx.swing; requires javafx.controls; @@ -17,6 +18,7 @@ requires de.jensd.fx.fontawesomefx.commons; requires de.jensd.fx.fontawesomefx.materialdesignicons; requires org.controlsfx.controls; + requires org.fxmisc.richtext; provides com.airhacks.afterburner.views.ResourceLocator with org.jabref.gui.util.JabRefResourceLocator; @@ -62,7 +64,6 @@ requires org.graalvm.js; requires org.apache.xmpbox; requires de.saxsys.mvvmfx.validation; - requires richtextfx; requires com.google.gson; requires unirest.java; requires org.apache.httpcomponents.httpclient; @@ -72,9 +73,10 @@ requires java.string.similarity; requires ojdbc10; requires org.postgresql.jdbc; + requires org.mariadb.jdbc; + uses org.mariadb.jdbc.credential.CredentialPlugin; requires org.apache.commons.lang3; requires org.antlr.antlr4.runtime; requires flowless; requires org.apache.tika.core; - requires javafx.base; } diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 0bd1cfb51e66..2a353372a898 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -494,7 +494,7 @@ private Node createToolbar() { factory.createIconButton(StandardActions.GENERATE_CITE_KEYS, new OldDatabaseCommandWrapper(Actions.MAKE_KEY, this, stateManager)), factory.createIconButton(StandardActions.CLEANUP_ENTRIES, new OldDatabaseCommandWrapper(Actions.CLEANUP, this, stateManager)), new Separator(Orientation.VERTICAL), - factory.createIconButton(StandardActions.FORK_ME, new OpenBrowserAction("https://github.com/JabRef/jabref")), + factory.createIconButton(StandardActions.OPEN_GITHUB, new OpenBrowserAction("https://github.com/JabRef/jabref")), factory.createIconButton(StandardActions.OPEN_FACEBOOK, new OpenBrowserAction("https://www.facebook.com/JabRef/")), factory.createIconButton(StandardActions.OPEN_TWITTER, new OpenBrowserAction("https://twitter.com/jabref_org")) ); @@ -653,6 +653,7 @@ private MenuBar createMenu() { Menu edit = new Menu(Localization.lang("Edit")); Menu library = new Menu(Localization.lang("Library")); Menu quality = new Menu(Localization.lang("Quality")); + Menu lookup = new Menu(Localization.lang("Lookup")); Menu view = new Menu(Localization.lang("View")); Menu tools = new Menu(Localization.lang("Tools")); Menu options = new Menu(Localization.lang("Options")); @@ -716,18 +717,23 @@ private MenuBar createMenu() { new SeparatorMenuItem(), + factory.createMenuItem(StandardActions.REPLACE_ALL, new OldDatabaseCommandWrapper(Actions.REPLACE_ALL, this, stateManager)), + factory.createMenuItem(StandardActions.GENERATE_CITE_KEYS, new OldDatabaseCommandWrapper(Actions.MAKE_KEY, this, stateManager)), + + new SeparatorMenuItem(), + factory.createMenuItem(StandardActions.MANAGE_KEYWORDS, new ManageKeywordsAction(stateManager)) ); if (Globals.prefs.getBoolean(JabRefPreferences.SPECIALFIELDSENABLED)) { edit.getItems().addAll( + new SeparatorMenuItem(), SpecialFieldMenuItemFactory.createSpecialFieldMenuForActiveDatabase(SpecialField.RANKING, factory, undoManager), SpecialFieldMenuItemFactory.getSpecialFieldSingleItemForActiveDatabase(SpecialField.RELEVANCE, factory), SpecialFieldMenuItemFactory.getSpecialFieldSingleItemForActiveDatabase(SpecialField.QUALITY, factory), SpecialFieldMenuItemFactory.getSpecialFieldSingleItemForActiveDatabase(SpecialField.PRINTED, factory), SpecialFieldMenuItemFactory.createSpecialFieldMenuForActiveDatabase(SpecialField.PRIORITY, factory, undoManager), - SpecialFieldMenuItemFactory.createSpecialFieldMenuForActiveDatabase(SpecialField.READ_STATUS, factory, undoManager), - new SeparatorMenuItem() + SpecialFieldMenuItemFactory.createSpecialFieldMenuForActiveDatabase(SpecialField.READ_STATUS, factory, undoManager) ); } @@ -763,6 +769,10 @@ private MenuBar createMenu() { factory.createMenuItem(StandardActions.SET_FILE_LINKS, new AutoLinkFilesAction(this, prefs, stateManager, undoManager, Globals.TASK_EXECUTOR)) ); + lookup.getItems().addAll( + factory.createMenuItem(StandardActions.FIND_DUPLICATES, new DuplicateSearch(this, dialogService, stateManager)) + ); + // PushToApplication final PushToApplicationAction pushToApplicationAction = pushToApplicationsManager.getPushToApplicationAction(); final MenuItem pushToApplicationMenuItem = factory.createMenuItem(pushToApplicationAction.getActionInformation(), pushToApplicationAction); @@ -771,6 +781,9 @@ private MenuBar createMenu() { tools.getItems().addAll( factory.createMenuItem(StandardActions.PARSE_TEX, new ParseTexAction(stateManager)), factory.createMenuItem(StandardActions.NEW_SUB_LIBRARY_FROM_AUX, new NewSubLibraryAction(this, stateManager)), + + new SeparatorMenuItem(), + factory.createMenuItem(StandardActions.FIND_UNLINKED_FILES, new FindUnlinkedFilesAction(this, stateManager)), factory.createMenuItem(StandardActions.WRITE_XMP, new OldDatabaseCommandWrapper(Actions.WRITE_XMP, this, stateManager)), factory.createMenuItem(StandardActions.COPY_LINKED_FILES, new CopyFilesAction(stateManager, this.getDialogService())), @@ -782,8 +795,6 @@ private MenuBar createMenu() { new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.GENERATE_CITE_KEYS, new OldDatabaseCommandWrapper(Actions.MAKE_KEY, this, stateManager)), - factory.createMenuItem(StandardActions.REPLACE_ALL, new OldDatabaseCommandWrapper(Actions.REPLACE_ALL, this, stateManager)), factory.createMenuItem(StandardActions.SEND_AS_EMAIL, new OldDatabaseCommandWrapper(Actions.SEND_AS_EMAIL, this, stateManager)), pushToApplicationMenuItem, @@ -849,23 +860,19 @@ private MenuBar createMenu() { new SeparatorMenuItem(), + factory.createMenuItem(StandardActions.DONATE, new OpenBrowserAction("https://donations.jabref.org")), factory.createMenuItem(StandardActions.SEARCH_FOR_UPDATES, new SearchForUpdateAction(Globals.BUILD_INFO, prefs.getVersionPreferences(), dialogService, Globals.TASK_EXECUTOR)), factory.createSubMenu(StandardActions.WEB_MENU, factory.createMenuItem(StandardActions.OPEN_WEBPAGE, new OpenBrowserAction("https://jabref.org/")), factory.createMenuItem(StandardActions.OPEN_BLOG, new OpenBrowserAction("https://blog.jabref.org/")), factory.createMenuItem(StandardActions.OPEN_FACEBOOK, new OpenBrowserAction("https://www.facebook.com/JabRef/")), factory.createMenuItem(StandardActions.OPEN_TWITTER, new OpenBrowserAction("https://twitter.com/jabref_org")), + factory.createMenuItem(StandardActions.OPEN_GITHUB, new OpenBrowserAction("https://github.com/JabRef/jabref")), new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.FORK_ME, new OpenBrowserAction("https://github.com/JabRef/jabref")), factory.createMenuItem(StandardActions.OPEN_DEV_VERSION_LINK, new OpenBrowserAction("https://builds.jabref.org/master/")), - factory.createMenuItem(StandardActions.OPEN_CHANGELOG, new OpenBrowserAction("https://github.com/JabRef/jabref/blob/master/CHANGELOG.md")), - - new SeparatorMenuItem(), - - factory.createMenuItem(StandardActions.DONATE, new OpenBrowserAction("https://donations.jabref.org")) - + factory.createMenuItem(StandardActions.OPEN_CHANGELOG, new OpenBrowserAction("https://github.com/JabRef/jabref/blob/master/CHANGELOG.md")) ), factory.createMenuItem(StandardActions.ABOUT, new AboutAction()) ); diff --git a/src/main/java/org/jabref/gui/SaveOrderConfigDisplay.fxml b/src/main/java/org/jabref/gui/SaveOrderConfigDisplay.fxml index 64fac7cdc94d..17e458f2e81c 100644 --- a/src/main/java/org/jabref/gui/SaveOrderConfigDisplay.fxml +++ b/src/main/java/org/jabref/gui/SaveOrderConfigDisplay.fxml @@ -24,37 +24,38 @@ - + - - - + + + + - - - - - - + + + - diff --git a/src/main/java/org/jabref/gui/actions/StandardActions.java b/src/main/java/org/jabref/gui/actions/StandardActions.java index 8d63c2fc9ffc..930d710a4950 100644 --- a/src/main/java/org/jabref/gui/actions/StandardActions.java +++ b/src/main/java/org/jabref/gui/actions/StandardActions.java @@ -86,9 +86,9 @@ public enum StandardActions implements Action { TOOGLE_OO(Localization.lang("OpenOffice/LibreOffice"), IconTheme.JabRefIcons.FILE_OPENOFFICE, KeyBinding.OPEN_OPEN_OFFICE_LIBRE_OFFICE_CONNECTION), TOGGLE_WEB_SEARCH(Localization.lang("Web search"), Localization.lang("Toggle web search interface"), IconTheme.JabRefIcons.WWW, KeyBinding.WEB_SEARCH), - PARSE_TEX(Localization.lang("Search for Citations in LaTeX Files"), IconTheme.JabRefIcons.LATEX_CITATIONS), + PARSE_TEX(Localization.lang("Search for citations in LaTeX files..."), IconTheme.JabRefIcons.LATEX_CITATIONS), NEW_SUB_LIBRARY_FROM_AUX(Localization.lang("New sublibrary based on AUX file") + "...", Localization.lang("New BibTeX sublibrary") + Localization.lang("This feature generates a new library based on which entries are needed in an existing LaTeX document."), IconTheme.JabRefIcons.NEW), - WRITE_XMP(Localization.lang("Write XMP-metadata to PDFs"), Localization.lang("Will write XMP-metadata to the PDFs linked from selected entries."), KeyBinding.WRITE_XMP), + WRITE_XMP(Localization.lang("Write XMP metadata to PDFs"), Localization.lang("Will write XMP metadata to the PDFs linked from selected entries."), KeyBinding.WRITE_XMP), OPEN_FOLDER(Localization.lang("Open folder"), Localization.lang("Open folder"), KeyBinding.OPEN_FOLDER), OPEN_FILE(Localization.lang("Open file"), Localization.lang("Open file"), IconTheme.JabRefIcons.FILE, KeyBinding.OPEN_FILE), OPEN_CONSOLE(Localization.lang("Open terminal here"), Localization.lang("Open terminal here"), IconTheme.JabRefIcons.CONSOLE, KeyBinding.OPEN_CONSOLE), @@ -146,13 +146,13 @@ public enum StandardActions implements Action { HELP_NAME_FORMATTER(Localization.lang("Help on Name Formatting"), IconTheme.JabRefIcons.HELP, KeyBinding.HELP), HELP_SPECIAL_FIELDS(Localization.lang("Help on special fields"), IconTheme.JabRefIcons.HELP, KeyBinding.HELP), WEB_MENU(Localization.lang("JabRef resources")), - OPEN_WEBPAGE(Localization.lang("Website"), Localization.lang("Opens JabRef's website")), + OPEN_WEBPAGE(Localization.lang("Website"), Localization.lang("Opens JabRef's website"), IconTheme.JabRefIcons.HOME), OPEN_FACEBOOK("Facebook", Localization.lang("Opens JabRef's Facebook page"), IconTheme.JabRefIcons.FACEBOOK), OPEN_TWITTER("Twitter", Localization.lang("Opens JabRef's Twitter page"), IconTheme.JabRefIcons.TWITTER), OPEN_BLOG(Localization.lang("Blog"), Localization.lang("Opens JabRef's blog"), IconTheme.JabRefIcons.BLOG), OPEN_DEV_VERSION_LINK(Localization.lang("Development version"), Localization.lang("Opens a link where the current development version can be downloaded")), OPEN_CHANGELOG(Localization.lang("View change log"), Localization.lang("See what has been changed in the JabRef versions")), - FORK_ME(Localization.lang("Fork me on GitHub"), Localization.lang("Opens JabRef's GitHub page"), IconTheme.JabRefIcons.GITHUB), + OPEN_GITHUB("GitHub", Localization.lang("Opens JabRef's GitHub page"), IconTheme.JabRefIcons.GITHUB), DONATE(Localization.lang("Donate to JabRef"), Localization.lang("Donate to JabRef"), IconTheme.JabRefIcons.DONATE), OPEN_FORUM(Localization.lang("Online help forum"), Localization.lang("Online help forum"), IconTheme.JabRefIcons.FORUM), ERROR_CONSOLE(Localization.lang("View event log"), Localization.lang("Display all error messages")), diff --git a/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java b/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java index 7ef6dfc4d566..f75e08b97618 100644 --- a/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java +++ b/src/main/java/org/jabref/gui/cleanup/FieldFormatterCleanupsPanel.java @@ -78,6 +78,9 @@ public void setValues(FieldFormatterCleanups formatterCleanups) { } private void buildLayout() { + setHgap(10.0); + setVgap(4.0); + ColumnConstraints first = new ColumnConstraints(); first.setPrefWidth(25); ColumnConstraints second = new ColumnConstraints(); @@ -101,6 +104,7 @@ private void buildLayout() { add(cleanupEnabled, 0, 0, 4, 1); actionsList = new ListView<>(actions); + actionsList.setMinHeight(100.0); actionsList.getSelectionModel().setSelectionMode(SelectionMode.SINGLE); new ViewModelListCellFactory() .withText(action -> action.getField().getDisplayName() + ": " + action.getFormatter().getName()) @@ -161,6 +165,7 @@ private void updateDescription() { */ private GridPane getSelectorPanel() { GridPane builder = new GridPane(); + builder.setHgap(10.0); Set fields = FieldFactory.getCommonFields(); fields.add(InternalField.KEY_FIELD); Set fieldsString = fields.stream().map(Field::getDisplayName).sorted().collect(Collectors.toCollection(TreeSet::new)); diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index 9ef038f50b57..13546cbc64e3 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -65,7 +65,7 @@ public LatexCitationsTabViewModel(BibDatabaseContext databaseContext, Preference this.preferencesService = preferencesService; this.taskExecutor = taskExecutor; this.dialogService = dialogService; - this.directory = new SimpleObjectProperty<>(databaseContext.getMetaData().getLaTexFileDirectory(preferencesService.getUser()) + this.directory = new SimpleObjectProperty<>(databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getUser()) .orElseGet(preferencesService::getWorkingDir)); this.citationList = FXCollections.observableArrayList(); this.status = new SimpleObjectProperty<>(Status.IN_PROGRESS); @@ -126,7 +126,7 @@ private void cancelSearch() { } private Collection searchAndParse(String citeKey) throws IOException { - Path newDirectory = databaseContext.getMetaData().getLaTexFileDirectory(preferencesService.getUser()) + Path newDirectory = databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getUser()) .orElseGet(preferencesService::getWorkingDir); if (texParserResult == null || !newDirectory.equals(directory.get())) { @@ -168,7 +168,7 @@ public void setLatexDirectory() { .withInitialDirectory(directory.get()).build(); dialogService.showDirectorySelectionDialog(directoryDialogConfiguration).ifPresent(selectedDirectory -> - databaseContext.getMetaData().setLaTexFileDirectory(preferencesService.getUser(), selectedDirectory.toAbsolutePath())); + databaseContext.getMetaData().setLatexFileDirectory(preferencesService.getUser(), selectedDirectory.toAbsolutePath())); init(currentEntry); } diff --git a/src/main/java/org/jabref/gui/exporter/WriteXMPAction.java b/src/main/java/org/jabref/gui/exporter/WriteXMPAction.java index 043ceac725d4..6b4c736c9e05 100644 --- a/src/main/java/org/jabref/gui/exporter/WriteXMPAction.java +++ b/src/main/java/org/jabref/gui/exporter/WriteXMPAction.java @@ -70,15 +70,15 @@ public void init() { if (entries.isEmpty()) { dialogService.showErrorDialogAndWait( - Localization.lang("Write XMP-metadata"), + Localization.lang("Write XMP metadata"), Localization.lang("This operation requires one or more entries to be selected.")); shouldContinue = false; return; } else { boolean confirm = dialogService.showConfirmationDialogAndWait( - Localization.lang("Write XMP-metadata"), - Localization.lang("Write XMP-metadata for all PDFs in current library?")); + Localization.lang("Write XMP metadata"), + Localization.lang("Write XMP metadata for all PDFs in current library?")); if (confirm) { shouldContinue = false; return; @@ -93,7 +93,7 @@ public void init() { } optionsDialog.open(); - dialogService.notify(Localization.lang("Writing XMP-metadata...")); + dialogService.notify(Localization.lang("Writing XMP metadata...")); } private void writeXMP() { @@ -176,7 +176,7 @@ class OptionsDialog extends FXDialog { private final TextArea progressArea; public OptionsDialog() { - super(AlertType.NONE, Localization.lang("Writing XMP-metadata for selected entries..."), false); + super(AlertType.NONE, Localization.lang("Writing XMP metadata for selected entries..."), false); okButton.setDisable(true); okButton.setOnAction(e -> dispose()); okButton.setPrefSize(100, 30); diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedFileViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/LinkedFileViewModel.java index 103a352fd031..949a05b559fc 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedFileViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedFileViewModel.java @@ -369,7 +369,7 @@ public void edit() { } public void writeXMPMetadata() { - // Localization.lang("Writing XMP-metadata...") + // Localization.lang("Writing XMP metadata...") BackgroundTask writeTask = BackgroundTask.wrap(() -> { Optional file = linkedFile.findIn(databaseContext, filePreferences); if (!file.isPresent()) { @@ -386,7 +386,7 @@ public void writeXMPMetadata() { return null; }); - // Localization.lang("Finished writing XMP-metadata.") + // Localization.lang("Finished writing XMP metadata.") // TODO: Show progress taskExecutor.execute(writeTask); diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java index d41c7beafcf5..263c8c8ad0c2 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java @@ -151,7 +151,7 @@ private static Node createFileDisplay(LinkedFileViewModel linkedFile) { acceptAutoLinkedFile.getStyleClass().setAll("icon-button"); Button writeXMPMetadata = IconTheme.JabRefIcons.IMPORT.asButton(); - writeXMPMetadata.setTooltip(new Tooltip(Localization.lang("Write BibTeXEntry as XMP-metadata to PDF."))); + writeXMPMetadata.setTooltip(new Tooltip(Localization.lang("Write BibTeXEntry as XMP metadata to PDF."))); writeXMPMetadata.visibleProperty().bind(linkedFile.canWriteXMPMetadataProperty()); writeXMPMetadata.setOnAction(event -> linkedFile.writeXMPMetadata()); writeXMPMetadata.getStyleClass().setAll("icon-button"); diff --git a/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java b/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java index 5ab4a3b8e875..fc0dd3f3df8d 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java +++ b/src/main/java/org/jabref/gui/fieldeditors/URLUtil.java @@ -1,6 +1,5 @@ package org.jabref.gui.fieldeditors; -import java.io.UnsupportedEncodingException; import java.net.MalformedURLException; import java.net.URL; import java.net.URLDecoder; @@ -53,7 +52,7 @@ public static String cleanGoogleSearchURL(String url) { if (pair.startsWith("url=")) { String value = pair.substring(pair.indexOf('=') + 1); - String decode = URLDecoder.decode(value, StandardCharsets.UTF_8.name()); + String decode = URLDecoder.decode(value, StandardCharsets.UTF_8); // url? if (decode.matches(URL_EXP)) { return decode; @@ -61,7 +60,7 @@ public static String cleanGoogleSearchURL(String url) { } } return url; - } catch (UnsupportedEncodingException | MalformedURLException e) { + } catch (MalformedURLException e) { return url; } } diff --git a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java index 47a2c88f52f4..2a465886d3d4 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java @@ -392,7 +392,7 @@ public void openHelpPage() { private List getFileDirectoriesAsPaths() { List fileDirs = new ArrayList<>(); MetaData metaData = currentDatabase.getMetaData(); - metaData.getLaTexFileDirectory(preferencesService.getFilePreferences().getUser()).ifPresent(fileDirs::add); + metaData.getLatexFileDirectory(preferencesService.getFilePreferences().getUser()).ifPresent(fileDirs::add); return fileDirs; } diff --git a/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java index e8cb54656c76..2b0d70b4885b 100644 --- a/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupNodeViewModel.java @@ -291,10 +291,14 @@ public Optional getParent() { } public void draggedOn(GroupNodeViewModel target, DroppingMouseLocation mouseLocation) { + // No action, if the target is the same as the source + if (this.equals(target)) { + return; + } + Optional targetParent = target.getParent(); if (targetParent.isPresent()) { int targetIndex = target.getPositionInParent(); - // In case we want to move an item in the same parent // and the item is moved down, we need to adjust the target index if (targetParent.equals(getParent())) { diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index aad18e6af6d9..8932d44fc97f 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -201,6 +201,10 @@ public void initialize() { } } + if (groupsToMove.size() > 0) { + localDragboard.clearAll(); + } + // Put the group nodes as content Dragboard dragboard = treeTable.startDragAndDrop(TransferMode.MOVE); // Display the group when dragging diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index f41142d4fd82..42a3161f1004 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -301,6 +301,7 @@ public enum JabRefIcons implements JabRefIcon { REMOVE_ABBREVIATION(MaterialDesignIcon.PLAYLIST_MINUS), NEW_ENTRY_FROM_PLAIN_TEXT(MaterialDesignIcon.PLUS_BOX), REMOTE_DATABASE(MaterialDesignIcon.DATABASE); + HOME(MaterialDesignIcon.HOME); private final JabRefIcon icon; diff --git a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialog.fxml b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialog.fxml index 12f7febeb966..50faf887c78c 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialog.fxml +++ b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialog.fxml @@ -1,69 +1,83 @@ - - + - + + + + + + + + + + + + + + + - - - + + + + + + - - - + + + - - - - - - - - + + + + + + + - - - - - - - - -