From 980dea4e6bf1cadf755930375a330a0790a06cf4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:26:00 +0100 Subject: [PATCH 01/14] Bump archunit-junit5-api from 0.21.0 to 0.22.0 (#8252) Bumps [archunit-junit5-api](https://github.com/TNG/ArchUnit) from 0.21.0 to 0.22.0. - [Release notes](https://github.com/TNG/ArchUnit/releases) - [Commits](https://github.com/TNG/ArchUnit/compare/v0.21.0...v0.22.0) --- updated-dependencies: - dependency-name: com.tngtech.archunit:archunit-junit5-api dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3e5c3633dc16..bceb56347dbb 100644 --- a/build.gradle +++ b/build.gradle @@ -218,7 +218,7 @@ dependencies { testImplementation 'org.xmlunit:xmlunit-core:2.8.3' testImplementation 'org.xmlunit:xmlunit-matchers:2.8.3' testRuntimeOnly 'com.tngtech.archunit:archunit-junit5-engine:0.22.0' - testImplementation 'com.tngtech.archunit:archunit-junit5-api:0.21.0' + testImplementation 'com.tngtech.archunit:archunit-junit5-api:0.22.0' 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" From 8a3b77be83f0a5799679e8bc9c11c4d009067e5c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:26:16 +0100 Subject: [PATCH 02/14] Bump antlr4 from 4.9.2 to 4.9.3 (#8251) Bumps [antlr4](https://github.com/antlr/antlr4) from 4.9.2 to 4.9.3. - [Release notes](https://github.com/antlr/antlr4/releases) - [Changelog](https://github.com/antlr/antlr4/blob/master/CHANGES.txt) - [Commits](https://github.com/antlr/antlr4/compare/4.9.2...4.9.3) --- updated-dependencies: - dependency-name: org.antlr:antlr4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index bceb56347dbb..a24c104640cb 100644 --- a/build.gradle +++ b/build.gradle @@ -139,7 +139,7 @@ dependencies { antlr3 'org.antlr:antlr:3.5.2' implementation 'org.antlr:antlr-runtime:3.5.2' - antlr4 'org.antlr:antlr4:4.9.2' + antlr4 'org.antlr:antlr4:4.9.3' implementation 'org.antlr:antlr4-runtime:4.9.3' implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '5.13.0.202109080827-r' From 6293196ee2e351f3031b9e2ef8317ba4cf887100 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:26:29 +0100 Subject: [PATCH 03/14] Bump byte-buddy-parent from 1.12.0 to 1.12.1 (#8249) Bumps [byte-buddy-parent](https://github.com/raphw/byte-buddy) from 1.12.0 to 1.12.1. - [Release notes](https://github.com/raphw/byte-buddy/releases) - [Changelog](https://github.com/raphw/byte-buddy/blob/master/release-notes.md) - [Commits](https://github.com/raphw/byte-buddy/compare/byte-buddy-1.12.0...byte-buddy-1.12.1) --- updated-dependencies: - dependency-name: net.bytebuddy:byte-buddy-parent dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index a24c104640cb..0cffd946459b 100644 --- a/build.gradle +++ b/build.gradle @@ -211,7 +211,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' testImplementation 'org.junit.platform:junit-platform-launcher:1.8.1' - testImplementation 'net.bytebuddy:byte-buddy-parent:1.12.0' + testImplementation 'net.bytebuddy:byte-buddy-parent:1.12.1' testRuntimeOnly group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' testRuntimeOnly group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT' testImplementation 'org.mockito:mockito-core:4.0.0' From a52a67726fc7e80045cbd684173e1bd23d288de8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:26:39 +0100 Subject: [PATCH 04/14] Bump commons-cli from 1.4 to 1.5.0 (#8250) Bumps commons-cli from 1.4 to 1.5.0. --- updated-dependencies: - dependency-name: commons-cli:commons-cli dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 0cffd946459b..3818d82bb2eb 100644 --- a/build.gradle +++ b/build.gradle @@ -128,7 +128,7 @@ dependencies { // required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635 implementation 'org.bouncycastle:bcprov-jdk15on:1.69' - implementation 'commons-cli:commons-cli:1.4' + implementation 'commons-cli:commons-cli:1.5.0' implementation 'org.libreoffice:libreoffice:7.2.2' implementation 'org.libreoffice:unoloader:7.2.2' From 9955a331469335fbb292372bf55e9834a0cb6f7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Nov 2021 16:26:49 +0100 Subject: [PATCH 05/14] Bump gittools/actions from 0.9.10 to 0.9.11 (#8248) Bumps [gittools/actions](https://github.com/gittools/actions) from 0.9.10 to 0.9.11. - [Release notes](https://github.com/gittools/actions/releases) - [Commits](https://github.com/gittools/actions/compare/v0.9.10...v0.9.11) --- updated-dependencies: - dependency-name: gittools/actions dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/deployment.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 485cbda548f3..f6f24eabe87e 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -54,12 +54,12 @@ jobs: with: fetch-depth: 0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.10 + uses: gittools/actions/gitversion/setup@v0.9.11 with: versionSpec: "5.x" - name: Run GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.10 + uses: gittools/actions/gitversion/execute@v0.9.11 - name: Set up JDK uses: actions/setup-java@v2 with: @@ -155,12 +155,12 @@ jobs: - name: Fetch all history for all tags and branches run: git fetch --prune --unshallow - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.10 + uses: gittools/actions/gitversion/setup@v0.9.11 with: versionSpec: '5.x' - name: Run GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.10 + uses: gittools/actions/gitversion/execute@v0.9.11 - name: Get linux binaries uses: actions/download-artifact@master with: From 1c463be8bf410cf6b6af31dce82ffd1dd5879a4b Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Mon, 15 Nov 2021 17:59:06 +0100 Subject: [PATCH 06/14] Replace styfle/cancel-workflow-action@0.9.1 by GitHub's "concurrency" feature (#8243) --- .github/workflows/check-links.yaml | 1 + .github/workflows/deployment.yml | 8 ++++---- .github/workflows/gource.yml | 1 + .github/workflows/snap.yml | 4 ++++ .github/workflows/tests-fetchers.yml | 4 ++++ .github/workflows/tests.yml | 12 +++++++----- 6 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-links.yaml b/.github/workflows/check-links.yaml index bfc618d021d9..2077d20ff802 100644 --- a/.github/workflows/check-links.yaml +++ b/.github/workflows/check-links.yaml @@ -7,6 +7,7 @@ on: schedule: # Run on the first of each month at 9:00 AM (See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07) - cron: "0 9 1 * *" + workflow_dispatch: jobs: markdown-link-check: diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index f6f24eabe87e..670407e4d4fb 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -26,6 +26,10 @@ env: GRADLE_OPTS: -Xmx4g -Dorg.gradle.daemon=false -Dorg.gradle.vfs.watch=false JAVA_OPTS: -Xmx4g +concurrency: + group: ${{ github.head_ref }} + cancel-in-progress: true + jobs: build: strategy: @@ -45,10 +49,6 @@ jobs: runs-on: ${{ matrix.os }} name: Create installer and portable version for ${{ matrix.displayName }} steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - name: Fetch all history for all tags and branches uses: actions/checkout@v2 with: diff --git a/.github/workflows/gource.yml b/.github/workflows/gource.yml index a9281f17b2fd..bf04acc1d4c7 100644 --- a/.github/workflows/gource.yml +++ b/.github/workflows/gource.yml @@ -6,6 +6,7 @@ on: - gource schedule: - cron: '15 3 1 1,4,7,10 *' + workflow_dispatch: jobs: action: diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml index c190256444fa..564ad5f09716 100644 --- a/.github/workflows/snap.yml +++ b/.github/workflows/snap.yml @@ -9,6 +9,10 @@ on: # run on each day - cron: "33 4 * * *" +concurrency: + group: snap-${{ github.head_ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest diff --git a/.github/workflows/tests-fetchers.yml b/.github/workflows/tests-fetchers.yml index 83ae6ef2685a..f670c0ee1abc 100644 --- a/.github/workflows/tests-fetchers.yml +++ b/.github/workflows/tests-fetchers.yml @@ -27,6 +27,10 @@ env: AstrophysicsDataSystemAPIKey: ${{ secrets.AstrophysicsDataSystemAPIKey_FOR_TESTS }} IEEEAPIKey: ${{ secrets.IEEEAPIKey_FOR_TESTS }} +concurrency: + group: fetcher-tests-${{ github.head_ref }} + cancel-in-progress: true + jobs: fetchertests: name: Fetcher tests diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index fe26e4e8fdc4..ba680d86435e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -3,9 +3,11 @@ name: Tests on: push: branches: - - master + - main + - main-release pull_request: # always run on pull requests + workflow_dispatch: env: SpringerNatureAPIKey: ${{ secrets.SpringerNatureAPIKey }} @@ -14,15 +16,15 @@ env: GRADLE_OPTS: -Xmx4g JAVA_OPTS: -Xmx4g +concurrency: + group: tests-${{ github.head_ref }} + cancel-in-progress: true + jobs: checkstyle: name: Checkstyle runs-on: ubuntu-latest steps: - - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - name: Checkout source uses: actions/checkout@v2 - name: Set up JDK From f3bd58a1a06ff8ecb061babd527ee61b960d88d8 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Tue, 16 Nov 2021 13:51:10 +0100 Subject: [PATCH 07/14] [Bot] Update CSL styles (#8245) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Squashed 'buildres/csl/csl-styles/' changes from 3a6a0a7bc1..0654e1649b 0654e1649b Create scandinavian-journal-of-information-systems.csl (#5716) ce2d537f49 Update journal-of-computer-applications-in-archaeology.csl (#5715) 755d3d3759 Create human-rights-law-review.csl (#5626) 0feda948b2 Create journal-of-intercultural-studies.csl (#5709) ae4756d2d2 Update acta-universitatis-agriculturae-sueciae.csl (#5713) 323d9ac2a1 Update mohr-siebeck-recht.csl (#5559) 15530a89ab Bch corr (#5712) 094a1afa28 Create forschungsjournal-soziale-bewegungen-fjsb.csl (#5699) cb91566f92 initialize authors and editors (#5714) 2d5cfff679 Create cancer-biomarkers.csl (#5703) 5e264d542b Update multidisciplinary-digital-publishing-institute.csl (#5708) 46e961fca9 Create klinische-padiatrie.csl (#5711) e81e8774eb Create bulletin-archeologique-des-ecoles-francaises-a-l-etranger.csl (#5704) 0029c5a265 Create polar-research.csl 🧊 (#5702) 7db1361c6e Update vancouver-imperial-college-london.csl (#5641) b953e9f98f Update iso690-author-date-fr-no-abstract.csl (#5706) 91eda8c18c Update thieme-german.csl (#5710) ebe0787d4a Update harvard-imperial-college-london.csl (#5643) 2d4db76c81 Fix UNESCO IIEP in text 436cbf4059 Create revue-archeologique-de-narbonnaise.csl (#5688) 5150bcfe58 Create journal-of-computer-assisted-tomography.csl (#5690) dd6f050f1d Create anti-trafficking-review.csl (#5658) 08e622f480 Create the-angle-orthodontist.csl (#5685) c6a1907a05 journal-of-palm-oil-research.csl fix several errors (#5686) 6cbe29db2b Create bern-university-of-applied-sciences-school-of-agricultural-for… (#5684) f590dc1a5b Update biomed-central.csl (#5701) 1efce81f8a Update turabian-author-date.csl (#5695) 12dbba5632 Create tyndale-bulletin (#5673) b0746dbde3 Create Engineered Regeneration (#5682) e38b9535b8 wikipedia citation template (#5662) 5e7f731f50 Create early-music-history.csl (#5679) 86443f3745 Create zeitschrift-fur-politik.csl (#5676) 68f19962e3 Create annals-of-work-exposures-and-health.csl (#5666) 1ba9dc6e2d Create brazilian-journal-of-psychiatry.csl (#5672) 438f92c130 fix error for speech in ama styles (#5693) 7a0c2d34e4 set initialize-with-hyphen to false (#5689) 3bd2765fa7 Update emu-austral-ornithology.csl (#5671) 31492b2e52 fix various errors in natura-croatica.csl (#5687) 94d6b23502 Update iso690-author-date-cs.csl (#5677) 5d017da4ee minor update on the "Haute école de gestion de Genève - ISO 690" style (#5665) 2cad8f6763 add ibid/subsequent to comparative-politics.csl (#5669) de0b1163bc Create taylor-and-francis-vancouver-national-library-of-medicine.csl (#5650) ed87f99320 Update bulletin-de-correspondance-hellenique.csl (#5663) git-subtree-dir: buildres/csl/csl-styles git-subtree-split: 0654e1649b308356e22cbfcc04e39fe3e757b0ca * Squashed 'buildres/csl/csl-locales/' changes from 0cc3885f61..d5ee85de8e d5ee85de8e Period after Übers. added (#241) git-subtree-dir: buildres/csl/csl-locales git-subtree-split: d5ee85de8e74d4109509014758b6f496a968ff03 * fix merge error Co-authored-by: github actions Co-authored-by: Siedlerchr --- ...cta-universitatis-agriculturae-sueciae.csl | 14 +- .../csl-styles/anti-trafficking-review.csl | 384 +++++++++++ ...cultural-forest-and-food-sciences-hafl.csl | 280 ++++++++ buildres/csl/csl-styles/biomed-central.csl | 29 +- .../bulletin-de-correspondance-hellenique.csl | 631 +++++++++--------- buildres/csl/csl-styles/cancer-biomarkers.csl | 151 +++++ ...que-des-ecoles-francaises-a-l-etranger.csl | 21 + .../dependent/klinische-padiatrie.csl | 18 - ...schungsjournal-soziale-bewegungen-fjsb.csl | 178 +++++ .../harvard-imperial-college-london.csl | 62 +- .../csl-styles/human-rights-law-review.csl | 624 +++++++++++++++++ .../iso690-author-date-fr-no-abstract.csl | 417 ++++++------ ...f-computer-applications-in-archaeology.csl | 26 +- ...ournal-of-computer-assisted-tomography.csl | 210 ++++++ .../journal-of-intercultural-studies.csl | 313 +++++++++ .../journal-of-oil-palm-research.csl | 53 +- .../csl/csl-styles/klinische-padiatrie.csl | 135 ++++ .../csl/csl-styles/mohr-siebeck-recht.csl | 4 +- ...ciplinary-digital-publishing-institute.csl | 21 +- buildres/csl/csl-styles/polar-research.csl | 271 ++++++++ .../revue-archeologique-de-narbonnaise.csl | 309 +++++++++ ...inavian-journal-of-information-systems.csl | 368 ++++++++++ .../csl/csl-styles/the-angle-orthodontist.csl | 241 +++++++ buildres/csl/csl-styles/thieme-german.csl | 55 +- .../csl/csl-styles/turabian-author-date.csl | 63 +- ...nal-institute-for-educational-planning.csl | 2 +- .../vancouver-imperial-college-london.csl | 74 +- .../csl-styles/turabian-author-date.csl | 63 +- 28 files changed, 4301 insertions(+), 716 deletions(-) create mode 100644 buildres/csl/csl-styles/anti-trafficking-review.csl create mode 100644 buildres/csl/csl-styles/bern-university-of-applied-sciences-school-of-agricultural-forest-and-food-sciences-hafl.csl create mode 100644 buildres/csl/csl-styles/cancer-biomarkers.csl create mode 100644 buildres/csl/csl-styles/dependent/bulletin-archeologique-des-ecoles-francaises-a-l-etranger.csl delete mode 100644 buildres/csl/csl-styles/dependent/klinische-padiatrie.csl create mode 100644 buildres/csl/csl-styles/forschungsjournal-soziale-bewegungen-fjsb.csl create mode 100644 buildres/csl/csl-styles/human-rights-law-review.csl create mode 100644 buildres/csl/csl-styles/journal-of-computer-assisted-tomography.csl create mode 100644 buildres/csl/csl-styles/journal-of-intercultural-studies.csl create mode 100644 buildres/csl/csl-styles/klinische-padiatrie.csl create mode 100644 buildres/csl/csl-styles/polar-research.csl create mode 100644 buildres/csl/csl-styles/revue-archeologique-de-narbonnaise.csl create mode 100644 buildres/csl/csl-styles/scandinavian-journal-of-information-systems.csl create mode 100644 buildres/csl/csl-styles/the-angle-orthodontist.csl diff --git a/buildres/csl/csl-styles/acta-universitatis-agriculturae-sueciae.csl b/buildres/csl/csl-styles/acta-universitatis-agriculturae-sueciae.csl index 279f1a7f259a..8a0830b34560 100644 --- a/buildres/csl/csl-styles/acta-universitatis-agriculturae-sueciae.csl +++ b/buildres/csl/csl-styles/acta-universitatis-agriculturae-sueciae.csl @@ -15,7 +15,7 @@ Style as per the May 2019 guidelines. - 2021-04-22T13:05:29+00:00 + 2021-11-10T10:39:01+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -279,20 +279,12 @@ - - - - - + - - - - - + diff --git a/buildres/csl/csl-styles/anti-trafficking-review.csl b/buildres/csl/csl-styles/anti-trafficking-review.csl new file mode 100644 index 000000000000..fd177bb1a6d6 --- /dev/null +++ b/buildres/csl/csl-styles/anti-trafficking-review.csl @@ -0,0 +1,384 @@ + + diff --git a/buildres/csl/csl-styles/bern-university-of-applied-sciences-school-of-agricultural-forest-and-food-sciences-hafl.csl b/buildres/csl/csl-styles/bern-university-of-applied-sciences-school-of-agricultural-forest-and-food-sciences-hafl.csl new file mode 100644 index 000000000000..a372a9e4ef43 --- /dev/null +++ b/buildres/csl/csl-styles/bern-university-of-applied-sciences-school-of-agricultural-forest-and-food-sciences-hafl.csl @@ -0,0 +1,280 @@ + + diff --git a/buildres/csl/csl-styles/biomed-central.csl b/buildres/csl/csl-styles/biomed-central.csl index 9e2cb8a095bd..7e135c42721e 100644 --- a/buildres/csl/csl-styles/biomed-central.csl +++ b/buildres/csl/csl-styles/biomed-central.csl @@ -12,10 +12,13 @@ Sebastian Karcher + + Patrick O'Brien + - 2017-03-15T17:11:28+00:00 + 2021-11-02T17:11:28+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -87,22 +90,22 @@ - + - - + + - - - - - - - - - + + + + + + + + + diff --git a/buildres/csl/csl-styles/bulletin-de-correspondance-hellenique.csl b/buildres/csl/csl-styles/bulletin-de-correspondance-hellenique.csl index 67aea3380e28..ffb7b7117d01 100644 --- a/buildres/csl/csl-styles/bulletin-de-correspondance-hellenique.csl +++ b/buildres/csl/csl-styles/bulletin-de-correspondance-hellenique.csl @@ -1,345 +1,346 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buildres/csl/csl-styles/cancer-biomarkers.csl b/buildres/csl/csl-styles/cancer-biomarkers.csl new file mode 100644 index 000000000000..19cd2c1f0ddd --- /dev/null +++ b/buildres/csl/csl-styles/cancer-biomarkers.csl @@ -0,0 +1,151 @@ + + diff --git a/buildres/csl/csl-styles/dependent/bulletin-archeologique-des-ecoles-francaises-a-l-etranger.csl b/buildres/csl/csl-styles/dependent/bulletin-archeologique-des-ecoles-francaises-a-l-etranger.csl new file mode 100644 index 000000000000..898f98c5ffaa --- /dev/null +++ b/buildres/csl/csl-styles/dependent/bulletin-archeologique-des-ecoles-francaises-a-l-etranger.csl @@ -0,0 +1,21 @@ + + diff --git a/buildres/csl/csl-styles/dependent/klinische-padiatrie.csl b/buildres/csl/csl-styles/dependent/klinische-padiatrie.csl deleted file mode 100644 index 067b8c0ffb5e..000000000000 --- a/buildres/csl/csl-styles/dependent/klinische-padiatrie.csl +++ /dev/null @@ -1,18 +0,0 @@ - - diff --git a/buildres/csl/csl-styles/forschungsjournal-soziale-bewegungen-fjsb.csl b/buildres/csl/csl-styles/forschungsjournal-soziale-bewegungen-fjsb.csl new file mode 100644 index 000000000000..ddc24bf679fa --- /dev/null +++ b/buildres/csl/csl-styles/forschungsjournal-soziale-bewegungen-fjsb.csl @@ -0,0 +1,178 @@ + + diff --git a/buildres/csl/csl-styles/harvard-imperial-college-london.csl b/buildres/csl/csl-styles/harvard-imperial-college-london.csl index e09043e5dba5..72b72707f730 100644 --- a/buildres/csl/csl-styles/harvard-imperial-college-london.csl +++ b/buildres/csl/csl-styles/harvard-imperial-college-london.csl @@ -1,5 +1,5 @@ - diff --git a/buildres/csl/csl-styles/iso690-author-date-fr-no-abstract.csl b/buildres/csl/csl-styles/iso690-author-date-fr-no-abstract.csl index 62c82084a702..e385ade44377 100644 --- a/buildres/csl/csl-styles/iso690-author-date-fr-no-abstract.csl +++ b/buildres/csl/csl-styles/iso690-author-date-fr-no-abstract.csl @@ -7,7 +7,7 @@ Pierre-Amiel Giraud - pierre-amiel.giraud@u-bordeaux3.fr + pierre-amiel.giraud@u-bordeaux-montaigne.fr Raphael Grolimund @@ -16,29 +16,21 @@ Style based on ISO 690:2010(F), V1, derived from Mellifluo, Grolimund, Hardegger and Giraud version. - 2020-11-19T21:30:00+00:00 + 2021-11-05T21:30:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License - + - Anon. [sans date] in en ligne consulté le disponible à l'adresse - p. + trad. + éd. - - - - - - - - @@ -57,42 +49,46 @@ - + - - - - - - - - - - - - + + + + - + - + + + + + + + + + + + + - - - - - - - + - - - + + + + + + + + + + @@ -116,31 +112,36 @@ - - - - - - - - - - - - - - - - + + + + + + + + + - - - + + + + + + + + + + + + + + + @@ -161,14 +162,39 @@ - - + + + + + + + + + + + - + + + + + + + + + - + + + + + + + + + @@ -181,7 +207,7 @@ - + @@ -214,55 +240,30 @@ - - - - - - - - - - - - - - - - - - - - + + + + + - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - @@ -314,12 +315,10 @@ - - - - - - + + + + @@ -331,14 +330,17 @@ - - - + + + - + + @@ -346,196 +348,225 @@ - - - - + + + + + + - - + - + - - - + + + + + + - + - - - + + + + + + - + - - + - - - + + + + + + - - - + + - + - - - + + + + + + - + - + - - - + + + + + + - - + + - + - - - + + + + + + - - + - + - - - + + + + + + - + - - - + + + + + + - - + - + - - - + + + + + + - - + - + - - - + + + + + + - + - + - - - + + + + + + - + - + - - - + + + + + + - - + + - + - - - - - + + diff --git a/buildres/csl/csl-styles/journal-of-computer-applications-in-archaeology.csl b/buildres/csl/csl-styles/journal-of-computer-applications-in-archaeology.csl index d0e8c8f7610e..30a660cd2c32 100644 --- a/buildres/csl/csl-styles/journal-of-computer-applications-in-archaeology.csl +++ b/buildres/csl/csl-styles/journal-of-computer-applications-in-archaeology.csl @@ -11,11 +11,15 @@ Patrick O'Brien obrienpat86@gmail.com + + Ronald Visser + r.m.visser@saxion.nl + 2514-8362 Harvard author-date style edited for Journal of Computer Applications in Archaeology. - 2017-05-24T15:41:19+00:00 + 2017-05-28T00:39:40+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -25,7 +29,7 @@ - + @@ -34,8 +38,8 @@ - - + + + + @@ -93,13 +114,12 @@ - + - @@ -126,6 +146,29 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/buildres/csl/csl-styles/klinische-padiatrie.csl b/buildres/csl/csl-styles/klinische-padiatrie.csl new file mode 100644 index 000000000000..e805412b748a --- /dev/null +++ b/buildres/csl/csl-styles/klinische-padiatrie.csl @@ -0,0 +1,135 @@ + + diff --git a/buildres/csl/csl-styles/mohr-siebeck-recht.csl b/buildres/csl/csl-styles/mohr-siebeck-recht.csl index 6c0b7ce13193..696873cf32f1 100644 --- a/buildres/csl/csl-styles/mohr-siebeck-recht.csl +++ b/buildres/csl/csl-styles/mohr-siebeck-recht.csl @@ -12,7 +12,7 @@ Kommentare sind als "report" zu kategorisieren, um richtig zitiert werden zu können. Gibt es keinen einheitlichen Autor oder Herausgeber bei Kommentaren, sondern nur einen Redakteur, ist dieser als Translator anzugeben, um im Literaturverzeichnis ordnungsgemäß zu erscheinen. - 2015-07-06T20:30:41+00:00 + 2021-07-14T20:30:41+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -47,7 +47,7 @@ - + diff --git a/buildres/csl/csl-styles/multidisciplinary-digital-publishing-institute.csl b/buildres/csl/csl-styles/multidisciplinary-digital-publishing-institute.csl index 793c4e000088..944ddc1905a0 100644 --- a/buildres/csl/csl-styles/multidisciplinary-digital-publishing-institute.csl +++ b/buildres/csl/csl-styles/multidisciplinary-digital-publishing-institute.csl @@ -1,5 +1,5 @@ - diff --git a/buildres/csl/csl-styles/revue-archeologique-de-narbonnaise.csl b/buildres/csl/csl-styles/revue-archeologique-de-narbonnaise.csl new file mode 100644 index 000000000000..454f5cfffef8 --- /dev/null +++ b/buildres/csl/csl-styles/revue-archeologique-de-narbonnaise.csl @@ -0,0 +1,309 @@ + + diff --git a/buildres/csl/csl-styles/scandinavian-journal-of-information-systems.csl b/buildres/csl/csl-styles/scandinavian-journal-of-information-systems.csl new file mode 100644 index 000000000000..596efbfcd6cd --- /dev/null +++ b/buildres/csl/csl-styles/scandinavian-journal-of-information-systems.csl @@ -0,0 +1,368 @@ + + diff --git a/buildres/csl/csl-styles/the-angle-orthodontist.csl b/buildres/csl/csl-styles/the-angle-orthodontist.csl new file mode 100644 index 000000000000..e40ee9cb2321 --- /dev/null +++ b/buildres/csl/csl-styles/the-angle-orthodontist.csl @@ -0,0 +1,241 @@ + + diff --git a/buildres/csl/csl-styles/thieme-german.csl b/buildres/csl/csl-styles/thieme-german.csl index 178193cb771c..89e9063c9714 100644 --- a/buildres/csl/csl-styles/thieme-german.csl +++ b/buildres/csl/csl-styles/thieme-german.csl @@ -1,6 +1,5 @@ diff --git a/buildres/csl/csl-styles/unesco-international-institute-for-educational-planning.csl b/buildres/csl/csl-styles/unesco-international-institute-for-educational-planning.csl index 2cb8bfa3704d..3d6141e31d5d 100644 --- a/buildres/csl/csl-styles/unesco-international-institute-for-educational-planning.csl +++ b/buildres/csl/csl-styles/unesco-international-institute-for-educational-planning.csl @@ -71,7 +71,7 @@ - + diff --git a/buildres/csl/csl-styles/vancouver-imperial-college-london.csl b/buildres/csl/csl-styles/vancouver-imperial-college-london.csl index 9f12aa3946b1..6d55fb8c1f12 100644 --- a/buildres/csl/csl-styles/vancouver-imperial-college-london.csl +++ b/buildres/csl/csl-styles/vancouver-imperial-college-london.csl @@ -9,10 +9,14 @@ Sebastian Karcher + + S. Mackenzie + + - Vancouver style according to the Imperial College London Guidelines - 2014-09-06T16:03:01+00:00 + Vancouver style from Imperial College London Library - 2021 + 2021-11-10T09:54:55+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -30,7 +34,7 @@ - - + - + @@ -67,7 +76,6 @@ - @@ -77,10 +85,9 @@ - - + @@ -94,9 +101,13 @@ - - - + + + + + + + @@ -106,15 +117,9 @@ - - - - - - @@ -145,11 +150,6 @@ - - - - - @@ -177,7 +177,7 @@ - + @@ -196,7 +196,7 @@ - + @@ -230,6 +230,12 @@ + + + + + + @@ -237,14 +243,6 @@ - - - - - - - diff --git a/src/main/resources/csl-styles/turabian-author-date.csl b/src/main/resources/csl-styles/turabian-author-date.csl index e3ca2a00faa2..afb896007ffb 100644 --- a/src/main/resources/csl-styles/turabian-author-date.csl +++ b/src/main/resources/csl-styles/turabian-author-date.csl @@ -10,10 +10,15 @@ Tony Chuang zcchuang@tiu.edu + + J. David Stark + david@jdavidstark.com + https://www.jdavidstark.com/ + The author-date variant of the Turabian 9th edition - Based on Chicago 17th (author-date) - 2020-05-16T19:15:00+00:00 + 2021-10-29T15:28:42+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License @@ -274,9 +279,6 @@ - - - @@ -285,6 +287,10 @@ + + + + @@ -430,12 +436,9 @@ - - - - - - + + + @@ -445,6 +448,10 @@ + + + + @@ -624,23 +631,27 @@ - - - - + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - + + From 578c1062d37f43ec590e918fbdcc3a16d6c6e8bc Mon Sep 17 00:00:00 2001 From: MLEP Date: Wed, 17 Nov 2021 21:15:05 +0100 Subject: [PATCH 08/14] Add of ADRs 22 and 23 (#8256) --- docs/adr.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/adr.md b/docs/adr.md index eba92a988b28..c95471e06e70 100644 --- a/docs/adr.md +++ b/docs/adr.md @@ -24,6 +24,8 @@ Architectural decisions for JabRef: * [ADR-0019](https://github.com/JabRef/jabref/blob/master/docs/adr/0019-implement-special-fields-as-seperate-fields.md) - Implement special fields as seperate fields * [ADR-0020](https://github.com/JabRef/jabref/blob/master/docs/adr/0020-use-Jackson-to-parse-study-yml.md) - Use Jackson to parse study.yml * [ADR-0021](https://github.com/JabRef/jabref/blob/master/docs/adr/0021-keep-study-as-a-dto.md) - Keep study as a DTO +* [ADR-0022](https://github.com/JabRef/jabref/blob/master/docs/adr/0022-remove-stop-words-during-query-transformation.md) - Remove stop words during query transformation +* [ADR-0023](https://github.com/JabRef/jabref/blob/master/docs/adr/0023-localized-preferences.md) - Localized Preferences For new ADRs, please use [template.md](https://github.com/JabRef/jabref/tree/master/docs/adr/template.md) as basis. More information on the used format is available at [https://adr.github.io/madr/](https://adr.github.io/madr/). General information about architectural decision records is available at [https://adr.github.io/](https://adr.github.io/). Then add them to the above list. From d0d3d5ec51a4615799ec017d70de75b7dd52a886 Mon Sep 17 00:00:00 2001 From: Evan Pickett Date: Sat, 20 Nov 2021 12:33:34 -0800 Subject: [PATCH 09/14] Clicking a DOI link in the preview pane no longer crashes (#8255) * Fixed DOI link causing exception; now opens in browser * Added to changelog * Fixed checkstyle issue * Removed awt package references * Browser opens with JabrefDesktop * Switched to using LOGGER --- CHANGELOG.md | 1 + .../org/jabref/gui/preview/PreviewViewer.java | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51958628e8c9..fc3dbcaec253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -66,6 +66,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - The default directory of the "LaTeX Citations" tab is now the directory of the currently opened database (and not the directory chosen at the last open file dialog or the last database save) [koppor#538](https://github.com/koppor/jabref/issues/538) - We fixed an issue where right-clicking on a tab and selecting close will close the focused tab even if it is not the tab we right-clicked [#8193](https://github.com/JabRef/jabref/pull/8193) - We fixed an issue where selecting a citation style in the preferences would sometimes produce an exception [#7860](https://github.com/JabRef/jabref/issues/7860) +- We fixed an issue where an exception would occur when clicking on a DOI link in the preview pane [#7706](https://github.com/JabRef/jabref/issues/7706) ### Removed diff --git a/src/main/java/org/jabref/gui/preview/PreviewViewer.java b/src/main/java/org/jabref/gui/preview/PreviewViewer.java index 56e571c3819c..96369916d41b 100644 --- a/src/main/java/org/jabref/gui/preview/PreviewViewer.java +++ b/src/main/java/org/jabref/gui/preview/PreviewViewer.java @@ -1,5 +1,7 @@ package org.jabref.gui.preview; +import java.io.IOException; +import java.net.MalformedURLException; import java.util.Objects; import java.util.Optional; import java.util.regex.Pattern; @@ -17,6 +19,7 @@ import org.jabref.gui.DialogService; import org.jabref.gui.Globals; import org.jabref.gui.StateManager; +import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.gui.util.BackgroundTask; import org.jabref.gui.util.TaskExecutor; import org.jabref.gui.util.Theme; @@ -30,6 +33,10 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.events.EventTarget; +import org.w3c.dom.html.HTMLAnchorElement; /** * Displays an BibEntry using the given layout format. @@ -137,6 +144,26 @@ public PreviewViewer(BibDatabaseContext database, DialogService dialogService, S registered = true; } highlightSearchPattern(); + + // https://stackoverflow.com/questions/15555510/javafx-stop-opening-url-in-webview-open-in-browser-instead + NodeList anchorList = previewView.getEngine().getDocument().getElementsByTagName("a"); + for (int i = 0; i < anchorList.getLength(); i++) { + Node node = anchorList.item(i); + EventTarget eventTarget = (EventTarget) node; + eventTarget.addEventListener("click", evt -> { + EventTarget target = evt.getCurrentTarget(); + HTMLAnchorElement anchorElement = (HTMLAnchorElement) target; + String href = anchorElement.getHref(); + try { + JabRefDesktop.openBrowser(href); + } catch (MalformedURLException exception) { + LOGGER.error("Invalid URL", exception); + } catch (IOException exception) { + LOGGER.error("Invalid URL Input", exception); + } + evt.preventDefault(); + }, false); + } }); } From 5c96ddf0852dd1968926220d545cdbff36db5af6 Mon Sep 17 00:00:00 2001 From: Christoph Date: Sun, 21 Nov 2021 12:42:31 +0100 Subject: [PATCH 10/14] Fix some fetcher tests (#8258) --- .../jabref/logic/importer/fetcher/ACMPortalFetcherTest.java | 5 ++--- .../java/org/jabref/logic/importer/fetcher/ArXivTest.java | 4 ++-- .../org/jabref/logic/importer/fetcher/IsbnFetcherTest.java | 2 +- .../logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java | 2 +- .../importer/fileformat/PdfMergeMetadataImporterTest.java | 4 +++- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java index 4781ab4fb869..b758f7bcc06d 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ACMPortalFetcherTest.java @@ -12,6 +12,7 @@ import org.jabref.model.entry.types.StandardEntryType; import org.jabref.testutils.category.FetcherTest; +import com.google.common.base.Optional; import org.apache.lucene.queryparser.flexible.core.QueryNodeParseException; import org.apache.lucene.queryparser.flexible.core.parser.SyntaxParser; import org.apache.lucene.queryparser.flexible.standard.parser.StandardSyntaxParser; @@ -20,7 +21,6 @@ import static org.jabref.logic.importer.fetcher.transformers.AbstractQueryTransformer.NO_EXPLICIT_FIELD; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; @FetcherTest class ACMPortalFetcherTest { @@ -57,8 +57,7 @@ void searchByQueryFindsEntry() throws Exception { for (BibEntry bibEntry : fetchedEntries) { bibEntry.clearField(StandardField.ABSTRACT); } - assertFalse(fetchedEntries.isEmpty()); - assertEquals(searchEntry, fetchedEntries.get(0)); + assertEquals(Optional.of(searchEntry), fetchedEntries.stream().findFirst()); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java b/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java index 018262e1fea7..52930702d6e4 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/ArXivTest.java @@ -98,7 +98,7 @@ void findFullTextByTitle() throws IOException { void findFullTextByTitleWithCurlyBracket() throws IOException { entry.setField(StandardField.TITLE, "Machine versus {Human} {Attention} in {Deep} {Reinforcement} {Learning} {Tasks}"); - assertEquals(Optional.of(new URL("http://arxiv.org/pdf/2010.15942v2")), fetcher.findFullText(entry)); + assertEquals(Optional.of(new URL("http://arxiv.org/pdf/2010.15942v3")), fetcher.findFullText(entry)); } @Test @@ -130,7 +130,7 @@ void findFullTextByTitleWithCurlyBracketAndPartOfAuthor() throws IOException { entry.setField(StandardField.TITLE, "Machine versus {Human} {Attention} in {Deep} {Reinforcement} {Learning} {Tasks}"); entry.setField(StandardField.AUTHOR, "Zhang, Ruohan and Guo"); - assertEquals(Optional.of(new URL("http://arxiv.org/pdf/2010.15942v2")), fetcher.findFullText(entry)); + assertEquals(Optional.of(new URL("http://arxiv.org/pdf/2010.15942v3")), fetcher.findFullText(entry)); } @Test diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java index 61811fc38197..8554135e2680 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IsbnFetcherTest.java @@ -38,7 +38,7 @@ void setUp() { bibEntry.setField(StandardField.PUBLISHER, "Addison Wesley"); bibEntry.setField(StandardField.YEAR, "2018"); bibEntry.setField(StandardField.AUTHOR, "Bloch, Joshua"); - bibEntry.setField(StandardField.DATE, "2018-01-01"); + bibEntry.setField(StandardField.DATE, "2018-01-31"); bibEntry.setField(new UnknownField("ean"), "9780134685991"); bibEntry.setField(StandardField.ISBN, "0134685997"); bibEntry.setField(StandardField.URL, "https://www.ebook.de/de/product/28983211/joshua_bloch_effective_java.html"); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java index c7b8a5516183..86221b563447 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/IsbnViaEbookDeFetcherTest.java @@ -29,7 +29,7 @@ public void setUp() { bibEntry.setField(StandardField.PUBLISHER, "Addison Wesley"); bibEntry.setField(StandardField.YEAR, "2018"); bibEntry.setField(StandardField.AUTHOR, "Bloch, Joshua"); - bibEntry.setField(StandardField.DATE, "2018-01-01"); + bibEntry.setField(StandardField.DATE, "2018-01-31"); bibEntry.setField(new UnknownField("ean"), "9780134685991"); bibEntry.setField(StandardField.ISBN, "0134685997"); bibEntry.setField(StandardField.URL, "https://www.ebook.de/de/product/28983211/joshua_bloch_effective_java.html"); diff --git a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java index 6bbd6f144063..fbf2eb763dd1 100644 --- a/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java +++ b/src/test/java/org/jabref/logic/importer/fileformat/PdfMergeMetadataImporterTest.java @@ -13,6 +13,7 @@ import org.jabref.model.entry.field.StandardField; import org.jabref.model.entry.field.UnknownField; import org.jabref.model.entry.types.StandardEntryType; +import org.jabref.testutils.category.FetcherTest; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -22,6 +23,7 @@ import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +@FetcherTest class PdfMergeMetadataImporterTest { private PdfMergeMetadataImporter importer; @@ -71,7 +73,7 @@ void importWorksAsExpected() throws Exception { expected.setField(StandardField.DOI, "10.1002/9781118257517"); // From ISBN (contained on first page verbatim bib entry) - expected.setField(StandardField.DATE, "2018-01-01"); + expected.setField(StandardField.DATE, "2018-01-31"); expected.setField(new UnknownField("ean"), "9780134685991"); expected.setField(StandardField.ISBN, "0134685997"); expected.setField(StandardField.URL, "https://www.ebook.de/de/product/28983211/joshua_bloch_effective_java.html"); From 1d66af62ebee7693d15413e450eb37821f2ec0e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Nov 2021 19:49:35 +0100 Subject: [PATCH 11/14] Bump classgraph from 4.8.130 to 4.8.135 (#8268) Bumps [classgraph](https://github.com/classgraph/classgraph) from 4.8.130 to 4.8.135. - [Release notes](https://github.com/classgraph/classgraph/releases) - [Commits](https://github.com/classgraph/classgraph/compare/classgraph-4.8.130...classgraph-4.8.135) --- updated-dependencies: - dependency-name: io.github.classgraph:classgraph dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 3818d82bb2eb..b2b6e74d4fce 100644 --- a/build.gradle +++ b/build.gradle @@ -207,7 +207,7 @@ dependencies { implementation group: 'net.harawata', name: 'appdirs', version: '1.2.1' - testImplementation 'io.github.classgraph:classgraph:4.8.130' + testImplementation 'io.github.classgraph:classgraph:4.8.135' testImplementation 'org.junit.jupiter:junit-jupiter:5.8.1' testImplementation 'org.junit.platform:junit-platform-launcher:1.8.1' From 354c961ddc036dd69dc4c0c74909936b4bfa6f44 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Nov 2021 19:50:18 +0100 Subject: [PATCH 12/14] Bump mockito-core from 4.0.0 to 4.1.0 (#8267) Bumps [mockito-core](https://github.com/mockito/mockito) from 4.0.0 to 4.1.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.0.0...v4.1.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index b2b6e74d4fce..c0137f2ee884 100644 --- a/build.gradle +++ b/build.gradle @@ -214,7 +214,7 @@ dependencies { testImplementation 'net.bytebuddy:byte-buddy-parent:1.12.1' testRuntimeOnly group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' testRuntimeOnly group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT' - testImplementation 'org.mockito:mockito-core:4.0.0' + testImplementation 'org.mockito:mockito-core:4.1.0' testImplementation 'org.xmlunit:xmlunit-core:2.8.3' testImplementation 'org.xmlunit:xmlunit-matchers:2.8.3' testRuntimeOnly 'com.tngtech.archunit:archunit-junit5-engine:0.22.0' From 66667f3c79484bd2b1a7786e3e91e9ffb330862e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Nov 2021 19:50:29 +0100 Subject: [PATCH 13/14] Bump checkstyle from 9.0.1 to 9.1 (#8266) Bumps [checkstyle](https://github.com/checkstyle/checkstyle) from 9.0.1 to 9.1. - [Release notes](https://github.com/checkstyle/checkstyle/releases) - [Commits](https://github.com/checkstyle/checkstyle/compare/checkstyle-9.0.1...checkstyle-9.1) --- updated-dependencies: - dependency-name: com.puppycrawl.tools:checkstyle dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index c0137f2ee884..ba1c9f958b30 100644 --- a/build.gradle +++ b/build.gradle @@ -223,7 +223,7 @@ dependencies { testImplementation "org.testfx:testfx-junit5:4.0.17-alpha-SNAPSHOT" testImplementation "org.hamcrest:hamcrest-library:2.2" - checkstyle 'com.puppycrawl.tools:checkstyle:9.0.1' + checkstyle 'com.puppycrawl.tools:checkstyle:9.1' xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.3' } From ab13b2a7040b4a4f276efa1af05f6df307f5f249 Mon Sep 17 00:00:00 2001 From: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Date: Mon, 22 Nov 2021 19:50:51 +0100 Subject: [PATCH 14/14] Observable Preferences H (WorkingDir, getUser, NameFormatter, Version, SpecialFields) (#8260) * Refactored setWorkingDirectory * Refactored getWorkingDirectory and getUser and fixed minor ide suggestions * Refactored NameFormatterPreferences * Refactored VersionPreferences * Refactored SpecialFieldsPreferences, removed orphaned autosync prefs * Fixed Checkstyle and tests * Fixed l10n * Fixed test --- .../org/jabref/cli/ArgumentProcessor.java | 24 ++-- src/main/java/org/jabref/gui/JabRefFrame.java | 29 ++--- src/main/java/org/jabref/gui/JabRefGUI.java | 4 +- src/main/java/org/jabref/gui/LibraryTab.java | 3 - .../jabref/gui/auximport/FromAuxDialog.java | 2 +- .../gui/copyfiles/CopySingleFileAction.java | 14 +-- .../LatexCitationsTabViewModel.java | 16 +-- .../gui/exporter/SaveDatabaseAction.java | 4 +- .../UnlinkedFilesDialogViewModel.java | 21 ++-- .../gui/fieldeditors/LinkedFilesEditor.java | 2 +- .../LinkedFilesEditorViewModel.java | 2 +- .../gui/groups/GroupDialogViewModel.java | 10 +- .../org/jabref/gui/help/NewVersionDialog.java | 8 +- .../gui/help/SearchForUpdateAction.java | 2 +- .../org/jabref/gui/help/VersionWorker.java | 21 ++-- .../importer/actions/OpenDatabaseAction.java | 6 +- .../LibraryPropertiesDialogViewModel.java | 14 +-- .../gui/linkedfile/AttachFileAction.java | 14 +-- .../linkedfile/LinkedFileEditDialogView.java | 4 +- .../LinkedFilesEditDialogViewModel.java | 16 +-- .../jabref/gui/maintable/RightClickMenu.java | 16 ++- .../StyleSelectDialogViewModel.java | 2 +- .../CustomImporterTabViewModel.java | 2 +- .../linkedfiles/LinkedFilesTabViewModel.java | 18 ++- .../nameformatter/NameFormatterTab.java | 2 +- .../NameFormatterTabViewModel.java | 22 ++-- .../NewProtectedTermsFileDialog.java | 6 +- .../ProtectedTermsTabViewModel.java | 4 +- .../gui/preferences/table/TableTab.fxml | 12 -- .../gui/preferences/table/TableTab.java | 4 - .../preferences/table/TableTabViewModel.java | 37 +----- .../gui/push/AbstractPushToApplication.java | 2 +- .../gui/push/PushToApplicationSettings.java | 6 +- .../java/org/jabref/gui/push/PushToEmacs.java | 2 +- .../jabref/gui/push/PushToEmacsSettings.java | 6 +- .../java/org/jabref/gui/push/PushToLyx.java | 2 +- .../jabref/gui/push/PushToLyxSettings.java | 6 +- .../java/org/jabref/gui/push/PushToVim.java | 2 +- .../jabref/gui/push/PushToVimSettings.java | 6 +- .../shared/SharedDatabaseLoginDialogView.java | 14 +-- .../SharedDatabaseLoginDialogViewModel.java | 53 +++++---- .../gui/slr/ExistingStudySearchAction.java | 4 +- .../SpecialFieldDatabaseChangeListener.java | 35 ------ .../SpecialFieldMenuItemFactory.java | 7 +- .../SpecialFieldsPreferences.java | 27 ++--- .../texparser/ParseLatexDialogViewModel.java | 6 +- .../importer/ImportFormatPreferences.java | 13 +-- .../format/NameFormatterPreferences.java | 25 +++- .../org/jabref/logic/util/io/FileUtil.java | 9 +- .../jabref/preferences/FilePreferences.java | 19 ++- .../jabref/preferences/JabRefPreferences.java | 109 ++++++++---------- .../preferences/PreferencesService.java | 19 --- .../preferences/VersionPreferences.java | 15 ++- src/main/resources/l10n/JabRef_en.properties | 5 - .../gui/exporter/SaveDatabaseActionTest.java | 16 +-- .../gui/groups/GroupDialogViewModelTest.java | 8 +- .../org/jabref/logic/crawler/CrawlerTest.java | 1 - .../StudyDatabaseToFetcherConverterTest.java | 1 - .../logic/crawler/StudyRepositoryTest.java | 1 - 59 files changed, 337 insertions(+), 423 deletions(-) delete mode 100644 src/main/java/org/jabref/gui/specialfields/SpecialFieldDatabaseChangeListener.java diff --git a/src/main/java/org/jabref/cli/ArgumentProcessor.java b/src/main/java/org/jabref/cli/ArgumentProcessor.java index 74b9c84d3c21..37009e28f254 100644 --- a/src/main/java/org/jabref/cli/ArgumentProcessor.java +++ b/src/main/java/org/jabref/cli/ArgumentProcessor.java @@ -310,20 +310,20 @@ private void writeMetadatatoPDFsOfEntry(BibDatabaseContext databaseContext, Stri try { if (writeXMP) { if (xmpPdfExporter.exportToAllFilesOfEntry(databaseContext, encoding, filePreferences, entry, List.of(entry))) { - System.out.println(String.format("Successfully written XMP metadata on at least one linked file of %s", citeKey)); + System.out.printf("Successfully written XMP metadata on at least one linked file of %s%n", citeKey); } else { - System.err.println(String.format("Cannot write XMP metadata on any linked files of %s. Make sure there is at least one linked file and the path is correct.", citeKey)); + System.err.printf("Cannot write XMP metadata on any linked files of %s. Make sure there is at least one linked file and the path is correct.%n", citeKey); } } if (embeddBibfile) { if (embeddedBibFilePdfExporter.exportToAllFilesOfEntry(databaseContext, encoding, filePreferences, entry, List.of(entry))) { - System.out.println(String.format("Successfully embedded metadata on at least one linked file of %s", citeKey)); + System.out.printf("Successfully embedded metadata on at least one linked file of %s%n", citeKey); } else { - System.out.println(String.format("Cannot embedd metadata on any linked files of %s. Make sure there is at least one linked file and the path is correct.", citeKey)); + System.out.printf("Cannot embedd metadata on any linked files of %s. Make sure there is at least one linked file and the path is correct.%n", citeKey); } } } catch (Exception e) { - LOGGER.error(String.format("Failed writing metadata on a linked file of %s.", citeKey)); + LOGGER.error("Failed writing metadata on a linked file of {}.", citeKey); } } @@ -331,7 +331,7 @@ private void writeMetadatatoPdfByCitekey(BibDatabaseContext databaseContext, Bib for (String citeKey : citeKeys) { List bibEntryList = dataBase.getEntriesByCitationKey(citeKey); if (bibEntryList.isEmpty()) { - System.err.println(String.format("Skipped - Cannot find %s in library.", citeKey)); + System.err.printf("Skipped - Cannot find %s in library.%n", citeKey); continue; } for (BibEntry entry : bibEntryList) { @@ -350,25 +350,25 @@ private void writeMetadatatoPdfByFileNames(BibDatabaseContext databaseContext, B try { if (writeXMP) { if (xmpPdfExporter.exportToFileByPath(databaseContext, dataBase, encoding, filePreferences, filePath)) { - System.out.println(String.format("Successfully written XMP metadata of at least one entry to %s", fileName)); + System.out.printf("Successfully written XMP metadata of at least one entry to %s%n", fileName); } else { - System.out.println(String.format("File %s is not linked to any entry in database.", fileName)); + System.out.printf("File %s is not linked to any entry in database.%n", fileName); } } if (embeddBibfile) { if (embeddedBibFilePdfExporter.exportToFileByPath(databaseContext, dataBase, encoding, filePreferences, filePath)) { - System.out.println(String.format("Successfully embedded XMP metadata of at least one entry to %s", fileName)); + System.out.printf("Successfully embedded XMP metadata of at least one entry to %s%n", fileName); } else { - System.out.println(String.format("File %s is not linked to any entry in database.", fileName)); + System.out.printf("File %s is not linked to any entry in database.%n", fileName); } } } catch (IOException e) { LOGGER.error("Error accessing file '{}'.", fileName); } catch (Exception e) { - LOGGER.error(String.format("Error writing entry to %s.", fileName)); + LOGGER.error("Error writing entry to {}.", fileName); } } else { - LOGGER.error(String.format("Skipped - PDF %s does not exist", fileName)); + LOGGER.error("Skipped - PDF {} does not exist", fileName); } } } diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 073371ea4bf3..bc911a31ac2d 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -754,19 +754,20 @@ private MenuBar createMenu() { factory.createMenuItem(StandardActions.MASS_SET_FIELDS, new MassSetFieldsAction(stateManager, dialogService, undoManager)) ); - if (prefs.getSpecialFieldsPreferences().isSpecialFieldsEnabled()) { - edit.getItems().addAll( - new SeparatorMenuItem(), - // ToDo: SpecialField needs the active BasePanel to mark it as changed. - // Refactor BasePanel, should mark the BibDatabaseContext or the UndoManager as dirty instead! - SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.RANKING, factory, this, dialogService, prefs, undoManager, stateManager), - SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.RELEVANCE, factory, this, dialogService, prefs, undoManager, stateManager), - SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.QUALITY, factory, this, dialogService, prefs, undoManager, stateManager), - SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.PRINTED, factory, this, dialogService, prefs, undoManager, stateManager), - SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.PRIORITY, factory, this, dialogService, prefs, undoManager, stateManager), - SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.READ_STATUS, factory, this, dialogService, prefs, undoManager, stateManager) - ); - } + SeparatorMenuItem specialFieldsSeparator = new SeparatorMenuItem(); + specialFieldsSeparator.visibleProperty().bind(prefs.getSpecialFieldsPreferences().specialFieldsEnabledProperty()); + + edit.getItems().addAll( + specialFieldsSeparator, + // ToDo: SpecialField needs the active BasePanel to mark it as changed. + // Refactor BasePanel, should mark the BibDatabaseContext or the UndoManager as dirty instead! + SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.RANKING, factory, this, dialogService, prefs, undoManager, stateManager), + SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.RELEVANCE, factory, this, dialogService, prefs, undoManager, stateManager), + SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.QUALITY, factory, this, dialogService, prefs, undoManager, stateManager), + SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.PRINTED, factory, this, dialogService, prefs, undoManager, stateManager), + SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.PRIORITY, factory, this, dialogService, prefs, undoManager, stateManager), + SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.READ_STATUS, factory, this, dialogService, prefs, undoManager, stateManager) + ); // @formatter:off library.getItems().addAll( @@ -1192,7 +1193,7 @@ private Boolean confirmEmptyEntry(LibraryTab libraryTab, BibDatabaseContext cont if (response.isPresent() && response.get().equals(deleteEmptyEntries)) { // The user wants to delete. try { - for (BibEntry currentEntry : new ArrayList(context.getEntries())) { + for (BibEntry currentEntry : new ArrayList<>(context.getEntries())) { if (currentEntry.getFields().isEmpty()) { context.getDatabase().removeEntries(Collections.singletonList(currentEntry)); } diff --git a/src/main/java/org/jabref/gui/JabRefGUI.java b/src/main/java/org/jabref/gui/JabRefGUI.java index c139ae93a26c..4edab4cd9ff0 100644 --- a/src/main/java/org/jabref/gui/JabRefGUI.java +++ b/src/main/java/org/jabref/gui/JabRefGUI.java @@ -59,9 +59,9 @@ public JabRefGUI(Stage mainStage, List databases, boolean isBlank, openWindow(mainStage); new VersionWorker(Globals.BUILD_INFO.version, - preferencesService.getVersionPreferences().getIgnoredVersion(), mainFrame.getDialogService(), - Globals.TASK_EXECUTOR) + Globals.TASK_EXECUTOR, + preferencesService.getVersionPreferences()) .checkForNewVersionDelayed(); } diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index 2e75f23a18fd..cf5504b591f8 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -31,7 +31,6 @@ import org.jabref.gui.importer.actions.OpenDatabaseAction; import org.jabref.gui.maintable.MainTable; import org.jabref.gui.maintable.MainTableDataModel; -import org.jabref.gui.specialfields.SpecialFieldDatabaseChangeListener; import org.jabref.gui.undo.CountingUndoManager; import org.jabref.gui.undo.NamedCompound; import org.jabref.gui.undo.UndoableFieldChange; @@ -465,8 +464,6 @@ public void editEntryAndFocusField(BibEntry entry, Field field) { } private void createMainTable() { - bibDatabaseContext.getDatabase().registerListener(SpecialFieldDatabaseChangeListener.INSTANCE); - mainTable = new MainTable(tableModel, this, bibDatabaseContext, diff --git a/src/main/java/org/jabref/gui/auximport/FromAuxDialog.java b/src/main/java/org/jabref/gui/auximport/FromAuxDialog.java index 7280deb98190..ae7de0b43e0b 100644 --- a/src/main/java/org/jabref/gui/auximport/FromAuxDialog.java +++ b/src/main/java/org/jabref/gui/auximport/FromAuxDialog.java @@ -93,7 +93,7 @@ private void browseButtonClicked() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .addExtensionFilter(StandardFileType.AUX) .withDefaultExtension(StandardFileType.AUX) - .withInitialDirectory(preferences.getWorkingDir()).build(); + .withInitialDirectory(preferences.getFilePreferences().getWorkingDirectory()).build(); dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(file -> auxFileField.setText(file.toAbsolutePath().toString())); } } diff --git a/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java b/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java index 72ec5c642665..29bc0716b597 100644 --- a/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java +++ b/src/main/java/org/jabref/gui/copyfiles/CopySingleFileAction.java @@ -14,40 +14,40 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.LinkedFile; import org.jabref.model.util.OptionalUtil; -import org.jabref.preferences.PreferencesService; +import org.jabref.preferences.FilePreferences; public class CopySingleFileAction extends SimpleCommand { private final LinkedFile linkedFile; private final DialogService dialogService; private final BibDatabaseContext databaseContext; - private final PreferencesService preferencesService; + private final FilePreferences filePreferences; private final BiFunction resolvePathFilename = (path, file) -> path.resolve(file.getFileName()); - public CopySingleFileAction(LinkedFile linkedFile, DialogService dialogService, BibDatabaseContext databaseContext, PreferencesService preferencesService) { + public CopySingleFileAction(LinkedFile linkedFile, DialogService dialogService, BibDatabaseContext databaseContext, FilePreferences filePreferences) { this.linkedFile = linkedFile; this.dialogService = dialogService; this.databaseContext = databaseContext; - this.preferencesService = preferencesService; + this.filePreferences = filePreferences; this.executable.bind(Bindings.createBooleanBinding( () -> !linkedFile.isOnlineLink() - && linkedFile.findIn(databaseContext, preferencesService.getFilePreferences()).isPresent(), + && linkedFile.findIn(databaseContext, this.filePreferences).isPresent(), linkedFile.linkProperty())); } @Override public void execute() { DirectoryDialogConfiguration dirDialogConfiguration = new DirectoryDialogConfiguration.Builder() - .withInitialDirectory(preferencesService.getWorkingDir()) + .withInitialDirectory(filePreferences.getWorkingDirectory()) .build(); Optional exportPath = dialogService.showDirectorySelectionDialog(dirDialogConfiguration); exportPath.ifPresent(this::copyFileToDestination); } private void copyFileToDestination(Path exportPath) { - Optional fileToExport = linkedFile.findIn(databaseContext, preferencesService.getFilePreferences()); + Optional fileToExport = linkedFile.findIn(databaseContext, filePreferences); Optional newPath = OptionalUtil.combine(Optional.of(exportPath), fileToExport, resolvePathFilename); if (newPath.isPresent()) { diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index 7673eb62d2b8..fbfbb5c37e3c 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -60,14 +60,16 @@ enum Status { private LatexParserResult latexParserResult; private BibEntry currentEntry; - public LatexCitationsTabViewModel(BibDatabaseContext databaseContext, PreferencesService preferencesService, - TaskExecutor taskExecutor, DialogService dialogService) { + public LatexCitationsTabViewModel(BibDatabaseContext databaseContext, + PreferencesService preferencesService, + TaskExecutor taskExecutor, + DialogService dialogService) { this.databaseContext = databaseContext; this.preferencesService = preferencesService; this.taskExecutor = taskExecutor; this.dialogService = dialogService; - this.directory = new SimpleObjectProperty(databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getUser()) - .orElse(FileUtil.getInitialDirectory(databaseContext, preferencesService))); + this.directory = new SimpleObjectProperty<>(databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getFilePreferences().getUser()) + .orElse(FileUtil.getInitialDirectory(databaseContext, preferencesService.getFilePreferences().getWorkingDirectory()))); this.citationList = FXCollections.observableArrayList(); this.status = new SimpleObjectProperty<>(Status.IN_PROGRESS); this.searchError = new SimpleStringProperty(""); @@ -128,8 +130,8 @@ private void cancelSearch() { private Collection searchAndParse(String citeKey) throws IOException { // we need to check whether the user meanwhile set the LaTeX file directory or the database changed locations - Path newDirectory = databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getUser()) - .orElse(FileUtil.getInitialDirectory(databaseContext, preferencesService)); + Path newDirectory = databaseContext.getMetaData().getLatexFileDirectory(preferencesService.getFilePreferences().getUser()) + .orElse(FileUtil.getInitialDirectory(databaseContext, preferencesService.getFilePreferences().getWorkingDirectory())); if (latexParserResult == null || !newDirectory.equals(directory.get())) { directory.set(newDirectory); @@ -170,7 +172,7 @@ public void setLatexDirectory() { .withInitialDirectory(directory.get()).build(); dialogService.showDirectorySelectionDialog(directoryDialogConfiguration).ifPresent(selectedDirectory -> - databaseContext.getMetaData().setLatexFileDirectory(preferencesService.getUser(), selectedDirectory.toAbsolutePath())); + databaseContext.getMetaData().setLatexFileDirectory(preferencesService.getFilePreferences().getUser(), selectedDirectory.toAbsolutePath())); init(currentEntry); } diff --git a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java index 9757b8856159..5ae882116e90 100644 --- a/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java +++ b/src/main/java/org/jabref/gui/exporter/SaveDatabaseAction.java @@ -160,10 +160,10 @@ private Optional askForSavePath() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .addExtensionFilter(StandardFileType.BIBTEX_DB) .withDefaultExtension(StandardFileType.BIBTEX_DB) - .withInitialDirectory(preferences.getWorkingDir()) + .withInitialDirectory(preferences.getFilePreferences().getWorkingDirectory()) .build(); Optional selectedPath = dialogService.showFileSaveDialog(fileDialogConfiguration); - selectedPath.ifPresent(path -> preferences.setWorkingDirectory(path.getParent())); + selectedPath.ifPresent(path -> preferences.getFilePreferences().setWorkingDirectory(path.getParent())); if (selectedPath.isPresent()) { Path savePath = selectedPath.get(); // Workaround for linux systems not adding file extension diff --git a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java index 69c62af874a8..c516be37f862 100644 --- a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java +++ b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogViewModel.java @@ -80,8 +80,13 @@ public class UnlinkedFilesDialogViewModel { private final FunctionBasedValidator scanDirectoryValidator; - public UnlinkedFilesDialogViewModel(DialogService dialogService, ExternalFileTypes externalFileTypes, UndoManager undoManager, - FileUpdateMonitor fileUpdateMonitor, PreferencesService preferences, StateManager stateManager, TaskExecutor taskExecutor) { + public UnlinkedFilesDialogViewModel(DialogService dialogService, + ExternalFileTypes externalFileTypes, + UndoManager undoManager, + FileUpdateMonitor fileUpdateMonitor, + PreferencesService preferences, + StateManager stateManager, + TaskExecutor taskExecutor) { this.preferences = preferences; this.dialogService = dialogService; this.taskExecutor = taskExecutor; @@ -95,9 +100,9 @@ public UnlinkedFilesDialogViewModel(DialogService dialogService, ExternalFileTyp stateManager); this.fileFilterList = FXCollections.observableArrayList( - new FileExtensionViewModel(StandardFileType.ANY_FILE, externalFileTypes), - new FileExtensionViewModel(StandardFileType.BIBTEX_DB, externalFileTypes), - new FileExtensionViewModel(StandardFileType.PDF, externalFileTypes)); + new FileExtensionViewModel(StandardFileType.ANY_FILE, externalFileTypes), + new FileExtensionViewModel(StandardFileType.BIBTEX_DB, externalFileTypes), + new FileExtensionViewModel(StandardFileType.PDF, externalFileTypes)); this.dateFilterList = FXCollections.observableArrayList(DateRange.values()); @@ -175,7 +180,7 @@ public void startExport() { } FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() - .withInitialDirectory(preferences.getWorkingDir()) + .withInitialDirectory(preferences.getFilePreferences().getWorkingDirectory()) .addExtensionFilter(StandardFileType.TXT) .withDefaultExtension(StandardFileType.TXT) .build(); @@ -218,12 +223,12 @@ public void cancelTasks() { public void browseFileDirectory() { DirectoryDialogConfiguration directoryDialogConfiguration = new DirectoryDialogConfiguration.Builder() - .withInitialDirectory(preferences.getWorkingDir()).build(); + .withInitialDirectory(preferences.getFilePreferences().getWorkingDirectory()).build(); dialogService.showDirectorySelectionDialog(directoryDialogConfiguration) .ifPresent(selectedDirectory -> { directoryPath.setValue(selectedDirectory.toAbsolutePath().toString()); - preferences.setWorkingDirectory(selectedDirectory.toAbsolutePath()); + preferences.getFilePreferences().setWorkingDirectory(selectedDirectory.toAbsolutePath()); }); } diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java index a13eeb6a3104..36aba630f549 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditor.java @@ -275,7 +275,7 @@ private ContextMenu createContextMenuForFile(LinkedFileViewModel linkedFile) { factory.createMenuItem(StandardActions.RENAME_FILE_TO_NAME, new ContextAction(StandardActions.RENAME_FILE_TO_NAME, linkedFile, preferencesService)), factory.createMenuItem(StandardActions.MOVE_FILE_TO_FOLDER, new ContextAction(StandardActions.MOVE_FILE_TO_FOLDER, linkedFile, preferencesService)), factory.createMenuItem(StandardActions.MOVE_FILE_TO_FOLDER_AND_RENAME, new ContextAction(StandardActions.MOVE_FILE_TO_FOLDER_AND_RENAME, linkedFile, preferencesService)), - factory.createMenuItem(StandardActions.COPY_FILE_TO_FOLDER, new CopySingleFileAction(linkedFile.getFile(), dialogService, databaseContext, preferencesService)), + factory.createMenuItem(StandardActions.COPY_FILE_TO_FOLDER, new CopySingleFileAction(linkedFile.getFile(), dialogService, databaseContext, preferencesService.getFilePreferences())), factory.createMenuItem(StandardActions.REMOVE_LINK, new ContextAction(StandardActions.REMOVE_LINK, linkedFile, preferencesService)), factory.createMenuItem(StandardActions.DELETE_FILE, new ContextAction(StandardActions.DELETE_FILE, linkedFile, preferencesService)) ); diff --git a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditorViewModel.java b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditorViewModel.java index e3f542e4a95a..f9c7f1e67e54 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditorViewModel.java +++ b/src/main/java/org/jabref/gui/fieldeditors/LinkedFilesEditorViewModel.java @@ -137,7 +137,7 @@ public ListProperty filesProperty() { public void addNewFile() { Path workingDirectory = databaseContext.getFirstExistingFileDir(preferences.getFilePreferences()) - .orElse(preferences.getWorkingDir()); + .orElse(preferences.getFilePreferences().getWorkingDirectory()); FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory(workingDirectory) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java index 7714fcdcfa09..522d129bb089 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java @@ -83,7 +83,7 @@ public class GroupDialogViewModel { private final BooleanProperty keywordGroupRegexProperty = new SimpleBooleanProperty(); private final StringProperty searchGroupSearchTermProperty = new SimpleStringProperty(""); - private final ObjectProperty> searchFlagsProperty = new SimpleObjectProperty(EnumSet.noneOf(SearchFlags.class)); + private final ObjectProperty> searchFlagsProperty = new SimpleObjectProperty<>(EnumSet.noneOf(SearchFlags.class)); private final BooleanProperty autoGroupKeywordsOptionProperty = new SimpleBooleanProperty(); private final StringProperty autoGroupKeywordsFieldProperty = new SimpleStringProperty(""); @@ -236,7 +236,7 @@ private void setupValidation() { return false; } return FileUtil.getFileExtension(input) - .map(extension -> extension.toLowerCase().equals("aux")) + .map(extension -> extension.equalsIgnoreCase("aux")) .orElse(false); } }, @@ -273,7 +273,7 @@ private void setupValidation() { * @return an absolute path if LatexFileDirectory exists; otherwise, returns input */ private Path getAbsoluteTexGroupPath(String input) { - Optional latexFileDirectory = currentDatabase.getMetaData().getLatexFileDirectory(preferencesService.getUser()); + Optional latexFileDirectory = currentDatabase.getMetaData().getLatexFileDirectory(preferencesService.getFilePreferences().getUser()); return latexFileDirectory.map(path -> path.resolve(input)).orElse(Path.of(input)); } @@ -436,8 +436,8 @@ public void texGroupBrowse() { .addExtensionFilter(StandardFileType.AUX) .withDefaultExtension(StandardFileType.AUX) .withInitialDirectory(currentDatabase.getMetaData() - .getLatexFileDirectory(preferencesService.getUser()) - .orElse(FileUtil.getInitialDirectory(currentDatabase, preferencesService))).build(); + .getLatexFileDirectory(preferencesService.getFilePreferences().getUser()) + .orElse(FileUtil.getInitialDirectory(currentDatabase, preferencesService.getFilePreferences().getWorkingDirectory()))).build(); dialogService.showFileOpenDialog(fileDialogConfiguration) .ifPresent(file -> texGroupFilePathProperty.setValue( FileUtil.relativize(file.toAbsolutePath(), getFileDirectoriesAsPaths()).toString() diff --git a/src/main/java/org/jabref/gui/help/NewVersionDialog.java b/src/main/java/org/jabref/gui/help/NewVersionDialog.java index 5c61943d2aa7..2ab73b250a50 100644 --- a/src/main/java/org/jabref/gui/help/NewVersionDialog.java +++ b/src/main/java/org/jabref/gui/help/NewVersionDialog.java @@ -7,14 +7,12 @@ import javafx.scene.control.Label; import javafx.scene.layout.VBox; -import org.jabref.gui.Globals; import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.gui.util.BaseDialog; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.Version; -import org.jabref.preferences.VersionPreferences; -public class NewVersionDialog extends BaseDialog { +public class NewVersionDialog extends BaseDialog { public NewVersionDialog(Version currentVersion, Version latestVersion) { this.setTitle(Localization.lang("New version available")); @@ -25,11 +23,11 @@ public NewVersionDialog(Version currentVersion, Version latestVersion) { this.getDialogPane().getButtonTypes().addAll(btnIgnoreUpdate, btnDownloadUpdate, btnRemindMeLater); this.setResultConverter(button -> { if (button == btnIgnoreUpdate) { - Globals.prefs.storeVersionPreferences(new VersionPreferences(latestVersion)); + return false; } else if (button == btnDownloadUpdate) { JabRefDesktop.openBrowserShowPopup(Version.JABREF_DOWNLOAD_URL); } - return null; + return true; }); Button defaultButton = (Button) this.getDialogPane().lookupButton(btnDownloadUpdate); defaultButton.setDefaultButton(true); diff --git a/src/main/java/org/jabref/gui/help/SearchForUpdateAction.java b/src/main/java/org/jabref/gui/help/SearchForUpdateAction.java index 5e39a0e6d7c8..ddf013c2ded8 100644 --- a/src/main/java/org/jabref/gui/help/SearchForUpdateAction.java +++ b/src/main/java/org/jabref/gui/help/SearchForUpdateAction.java @@ -22,7 +22,7 @@ public SearchForUpdateAction(BuildInfo buildInfo, VersionPreferences versionPref @Override public void execute() { - new VersionWorker(buildInfo.version, versionPreferences.getIgnoredVersion(), dialogService, taskExecutor) + new VersionWorker(buildInfo.version, dialogService, taskExecutor, versionPreferences) .checkForNewVersionAsync(); } } diff --git a/src/main/java/org/jabref/gui/help/VersionWorker.java b/src/main/java/org/jabref/gui/help/VersionWorker.java index 139565c9df88..e22ed8aa5837 100644 --- a/src/main/java/org/jabref/gui/help/VersionWorker.java +++ b/src/main/java/org/jabref/gui/help/VersionWorker.java @@ -11,6 +11,7 @@ import org.jabref.gui.util.TaskExecutor; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.Version; +import org.jabref.preferences.VersionPreferences; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -32,19 +33,19 @@ public class VersionWorker { */ private final Version installedVersion; - /** - * The version which was previously ignored by the user - */ - private final Version toBeIgnored; - private final DialogService dialogService; private final TaskExecutor taskExecutor; + private final VersionPreferences versionPreferences; - public VersionWorker(Version installedVersion, Version toBeIgnored, DialogService dialogService, TaskExecutor taskExecutor) { + public VersionWorker(Version installedVersion, + + DialogService dialogService, + TaskExecutor taskExecutor, + VersionPreferences versionPreferences) { this.installedVersion = Objects.requireNonNull(installedVersion); - this.toBeIgnored = Objects.requireNonNull(toBeIgnored); this.dialogService = Objects.requireNonNull(dialogService); this.taskExecutor = Objects.requireNonNull(taskExecutor); + this.versionPreferences = versionPreferences; } /** @@ -88,13 +89,15 @@ private void showConnectionError(Exception exception, boolean manualExecution) { */ private void showUpdateInfo(Optional newerVersion, boolean manualExecution) { // no new version could be found, only respect the ignored version on automated version checks - if (!newerVersion.isPresent() || (newerVersion.get().equals(toBeIgnored) && !manualExecution)) { + if (newerVersion.isEmpty() || (newerVersion.get().equals(versionPreferences.getIgnoredVersion()) && !manualExecution)) { if (manualExecution) { dialogService.notify(Localization.lang("JabRef is up-to-date.")); } } else { // notify the user about a newer version - dialogService.showCustomDialogAndWait(new NewVersionDialog(installedVersion, newerVersion.get())); + if (dialogService.showCustomDialogAndWait(new NewVersionDialog(installedVersion, newerVersion.get())).orElse(true)) { + versionPreferences.setIgnoredVersion(newerVersion.get()); + } } } } diff --git a/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java b/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java index bd1bbee5af4b..39b22f76f558 100644 --- a/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java +++ b/src/main/java/org/jabref/gui/importer/actions/OpenDatabaseAction.java @@ -94,10 +94,10 @@ public void execute() { */ private Path getInitialDirectory() { if (frame.getBasePanelCount() == 0) { - return preferencesService.getWorkingDir(); + return preferencesService.getFilePreferences().getWorkingDirectory(); } else { Optional databasePath = frame.getCurrentLibraryTab().getBibDatabaseContext().getDatabasePath(); - return databasePath.map(Path::getParent).orElse(preferencesService.getWorkingDir()); + return databasePath.map(Path::getParent).orElse(preferencesService.getFilePreferences().getWorkingDirectory()); } } @@ -181,7 +181,7 @@ private ParserResult loadDatabase(Path file) throws Exception { dialogService.notify(Localization.lang("Opening") + ": '" + file + "'"); - preferencesService.setWorkingDirectory(fileToLoad.getParent()); + preferencesService.getFilePreferences().setWorkingDirectory(fileToLoad.getParent()); if (BackupManager.backupFileDiffers(fileToLoad)) { BackupUIManager.showRestoreBackupDialog(dialogService, fileToLoad); diff --git a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialogViewModel.java b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialogViewModel.java index f3a37a6092d6..d07206d881bc 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialogViewModel.java +++ b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesDialogViewModel.java @@ -75,7 +75,7 @@ public LibraryPropertiesDialogViewModel(BibDatabaseContext databaseContext, Dial this.initialSaveOrderConfig = initialMetaData.getSaveOrderConfig().orElseGet(preferences::getExportSaveOrder); this.directoryDialogConfiguration = new DirectoryDialogConfiguration.Builder() - .withInitialDirectory(preferences.getWorkingDir()).build(); + .withInitialDirectory(preferences.getFilePreferences().getWorkingDirectory()).build(); setValues(); } @@ -88,8 +88,8 @@ void setValues() { selectedEncodingPropety.setValue(initialMetaData.getEncoding().orElse(preferences.getGeneralPreferences().getDefaultEncoding())); selectedDatabaseModeProperty.setValue(initialMetaData.getMode().orElse(BibDatabaseMode.BIBLATEX)); generalFileDirectoryProperty.setValue(initialMetaData.getDefaultFileDirectory().orElse("").trim()); - userSpecificFileDirectoryProperty.setValue(initialMetaData.getUserFileDirectory(preferences.getUser()).orElse("").trim()); - laTexFileDirectoryProperty.setValue(initialMetaData.getLatexFileDirectory(preferences.getUser()).map(Path::toString).orElse("")); + userSpecificFileDirectoryProperty.setValue(initialMetaData.getUserFileDirectory(preferences.getFilePreferences().getUser()).orElse("").trim()); + laTexFileDirectoryProperty.setValue(initialMetaData.getLatexFileDirectory(preferences.getFilePreferences().getUser()).map(Path::toString).orElse("")); libraryProtectedProperty.setValue(initialMetaData.isProtected()); // SaveOrderConfigPanel @@ -134,16 +134,16 @@ void storeSettings() { String userSpecificFileDirectory = userSpecificFileDirectoryProperty.getValue(); if (userSpecificFileDirectory.isEmpty()) { - newMetaData.clearUserFileDirectory(preferences.getUser()); + newMetaData.clearUserFileDirectory(preferences.getFilePreferences().getUser()); } else { - newMetaData.setUserFileDirectory(preferences.getUser(), userSpecificFileDirectory); + newMetaData.setUserFileDirectory(preferences.getFilePreferences().getUser(), userSpecificFileDirectory); } String latexFileDirectory = laTexFileDirectoryProperty.getValue(); if (latexFileDirectory.isEmpty()) { - newMetaData.clearLatexFileDirectory(preferences.getUser()); + newMetaData.clearLatexFileDirectory(preferences.getFilePreferences().getUser()); } else { - newMetaData.setLatexFileDirectory(preferences.getUser(), Path.of(latexFileDirectory)); + newMetaData.setLatexFileDirectory(preferences.getFilePreferences().getUser(), Path.of(latexFileDirectory)); } if (libraryProtectedProperty.getValue()) { diff --git a/src/main/java/org/jabref/gui/linkedfile/AttachFileAction.java b/src/main/java/org/jabref/gui/linkedfile/AttachFileAction.java index a0b6ff4602da..00e0c1f3b4bc 100644 --- a/src/main/java/org/jabref/gui/linkedfile/AttachFileAction.java +++ b/src/main/java/org/jabref/gui/linkedfile/AttachFileAction.java @@ -17,23 +17,23 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; import org.jabref.model.entry.LinkedFile; -import org.jabref.preferences.PreferencesService; +import org.jabref.preferences.FilePreferences; public class AttachFileAction extends SimpleCommand { private final LibraryTab libraryTab; private final StateManager stateManager; private final DialogService dialogService; - private final PreferencesService preferencesService; + private final FilePreferences filePreferences; public AttachFileAction(LibraryTab libraryTab, DialogService dialogService, StateManager stateManager, - PreferencesService preferencesService) { + FilePreferences filePreferences) { this.libraryTab = libraryTab; this.stateManager = stateManager; this.dialogService = dialogService; - this.preferencesService = preferencesService; + this.filePreferences = filePreferences; this.executable.bind(ActionHelper.needsEntriesSelected(1, stateManager)); } @@ -54,8 +54,8 @@ public void execute() { BibEntry entry = stateManager.getSelectedEntries().get(0); - Path workingDirectory = databaseContext.getFirstExistingFileDir(preferencesService.getFilePreferences()) - .orElse(preferencesService.getWorkingDir()); + Path workingDirectory = databaseContext.getFirstExistingFileDir(filePreferences) + .orElse(filePreferences.getWorkingDirectory()); FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .withInitialDirectory(workingDirectory) @@ -63,7 +63,7 @@ public void execute() { dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(newFile -> { LinkedFile linkedFile = LinkedFilesEditorViewModel.fromFile(newFile, - databaseContext.getFileDirectories(preferencesService.getFilePreferences()), + databaseContext.getFileDirectories(filePreferences), ExternalFileTypes.getInstance()); LinkedFileEditDialogView dialog = new LinkedFileEditDialogView(linkedFile); diff --git a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogView.java b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogView.java index 5ea1e9fb3440..b470265e78dd 100644 --- a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogView.java +++ b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogView.java @@ -32,7 +32,7 @@ public class LinkedFileEditDialogView extends BaseDialog { private LinkedFilesEditDialogViewModel viewModel; private final LinkedFile linkedFile; - private ExternalFileTypes externalFileTypes; + private final ExternalFileTypes externalFileTypes; public LinkedFileEditDialogView(LinkedFile linkedFile) { this.linkedFile = linkedFile; @@ -56,7 +56,7 @@ public LinkedFileEditDialogView(LinkedFile linkedFile) { @FXML private void initialize() { - viewModel = new LinkedFilesEditDialogViewModel(linkedFile, stateManager.getActiveDatabase().get(), dialogService, preferences, externalFileTypes); + viewModel = new LinkedFilesEditDialogViewModel(linkedFile, stateManager.getActiveDatabase().get(), dialogService, preferences.getFilePreferences(), externalFileTypes); fileType.itemsProperty().bindBidirectional(viewModel.externalFileTypeProperty()); description.textProperty().bindBidirectional(viewModel.descriptionProperty()); link.textProperty().bindBidirectional(viewModel.linkProperty()); diff --git a/src/main/java/org/jabref/gui/linkedfile/LinkedFilesEditDialogViewModel.java b/src/main/java/org/jabref/gui/linkedfile/LinkedFilesEditDialogViewModel.java index b69789282f9a..2d5175bd3d4c 100644 --- a/src/main/java/org/jabref/gui/linkedfile/LinkedFilesEditDialogViewModel.java +++ b/src/main/java/org/jabref/gui/linkedfile/LinkedFilesEditDialogViewModel.java @@ -25,7 +25,7 @@ import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.LinkedFile; import org.jabref.model.util.FileHelper; -import org.jabref.preferences.PreferencesService; +import org.jabref.preferences.FilePreferences; import com.tobiasdiez.easybind.EasyBind; import com.tobiasdiez.easybind.optional.ObservableOptionalValue; @@ -40,13 +40,13 @@ public class LinkedFilesEditDialogViewModel extends AbstractViewModel { private final ObservableOptionalValue monadicSelectedExternalFileType; private final BibDatabaseContext database; private final DialogService dialogService; - private final PreferencesService preferences; + private final FilePreferences filePreferences; private final ExternalFileTypes externalFileTypes; - public LinkedFilesEditDialogViewModel(LinkedFile linkedFile, BibDatabaseContext database, DialogService dialogService, PreferencesService preferences, ExternalFileTypes externalFileTypes) { + public LinkedFilesEditDialogViewModel(LinkedFile linkedFile, BibDatabaseContext database, DialogService dialogService, FilePreferences filePreferences, ExternalFileTypes externalFileTypes) { this.database = database; this.dialogService = dialogService; - this.preferences = preferences; + this.filePreferences = filePreferences; this.externalFileTypes = externalFileTypes; allExternalFileTypes.set(FXCollections.observableArrayList(externalFileTypes.getExternalFileTypeSelection())); @@ -71,9 +71,9 @@ private void setExternalFileTypeByExtension(String link) { public void openBrowseDialog() { String fileText = link.get(); - Optional file = FileHelper.find(database, fileText, preferences.getFilePreferences()); + Optional file = FileHelper.find(database, fileText, filePreferences); - Path workingDir = file.orElse(preferences.getWorkingDir()); + Path workingDir = file.orElse(filePreferences.getWorkingDirectory()); String fileName = Path.of(fileText).getFileName().toString(); FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() @@ -83,7 +83,7 @@ public void openBrowseDialog() { dialogService.showFileOpenDialog(fileDialogConfiguration).ifPresent(path -> { // Store the directory for next time: - preferences.setWorkingDirectory(path); + filePreferences.setWorkingDirectory(path); link.set(relativize(path)); setExternalFileTypeByExtension(link.getValueSafe()); @@ -140,7 +140,7 @@ public LinkedFile getNewLinkedFile() { } private String relativize(Path filePath) { - List fileDirectories = database.getFileDirectories(preferences.getFilePreferences()); + List fileDirectories = database.getFileDirectories(filePreferences); return FileUtil.relativize(filePath, fileDirectories).toString(); } } diff --git a/src/main/java/org/jabref/gui/maintable/RightClickMenu.java b/src/main/java/org/jabref/gui/maintable/RightClickMenu.java index de00201399be..31fd414d1b0a 100644 --- a/src/main/java/org/jabref/gui/maintable/RightClickMenu.java +++ b/src/main/java/org/jabref/gui/maintable/RightClickMenu.java @@ -57,18 +57,16 @@ public static ContextMenu create(BibEntryTableViewModel entry, contextMenu.getItems().add(new SeparatorMenuItem()); - if (preferencesService.getSpecialFieldsPreferences().isSpecialFieldsEnabled()) { - contextMenu.getItems().add(SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.RANKING, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); - contextMenu.getItems().add(SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.RELEVANCE, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); - contextMenu.getItems().add(SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.QUALITY, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); - contextMenu.getItems().add(SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.PRINTED, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); - contextMenu.getItems().add(SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.PRIORITY, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); - contextMenu.getItems().add(SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.READ_STATUS, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); - } + contextMenu.getItems().add(SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.RANKING, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); + contextMenu.getItems().add(SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.RELEVANCE, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); + contextMenu.getItems().add(SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.QUALITY, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); + contextMenu.getItems().add(SpecialFieldMenuItemFactory.getSpecialFieldSingleItem(SpecialField.PRINTED, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); + contextMenu.getItems().add(SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.PRIORITY, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); + contextMenu.getItems().add(SpecialFieldMenuItemFactory.createSpecialFieldMenu(SpecialField.READ_STATUS, factory, libraryTab.frame(), dialogService, preferencesService, undoManager, stateManager)); contextMenu.getItems().add(new SeparatorMenuItem()); - contextMenu.getItems().add(factory.createMenuItem(StandardActions.ATTACH_FILE, new AttachFileAction(libraryTab, dialogService, stateManager, preferencesService))); + contextMenu.getItems().add(factory.createMenuItem(StandardActions.ATTACH_FILE, new AttachFileAction(libraryTab, dialogService, stateManager, preferencesService.getFilePreferences()))); contextMenu.getItems().add(factory.createMenuItem(StandardActions.OPEN_FOLDER, new OpenFolderAction(dialogService, stateManager, preferencesService))); contextMenu.getItems().add(factory.createMenuItem(StandardActions.OPEN_EXTERNAL_FILE, new OpenExternalFileAction(dialogService, stateManager, preferencesService))); contextMenu.getItems().add(factory.createMenuItem(StandardActions.OPEN_URL, new OpenUrlAction(dialogService, stateManager, preferencesService))); diff --git a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogViewModel.java b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogViewModel.java index bd307cd93bac..2fccfd5a3323 100644 --- a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogViewModel.java +++ b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogViewModel.java @@ -62,7 +62,7 @@ public void addStyleFile() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .addExtensionFilter(Localization.lang("Style file"), StandardFileType.JSTYLE) .withDefaultExtension(Localization.lang("Style file"), StandardFileType.JSTYLE) - .withInitialDirectory(preferencesService.getWorkingDir()) + .withInitialDirectory(preferencesService.getFilePreferences().getWorkingDirectory()) .build(); Optional path = dialogService.showFileOpenDialog(fileDialogConfiguration); path.map(Path::toAbsolutePath).map(Path::toString).ifPresent(stylePath -> { diff --git a/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTabViewModel.java b/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTabViewModel.java index 4e0ec263e83b..218c76d940ad 100644 --- a/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/customimporter/CustomImporterTabViewModel.java @@ -84,7 +84,7 @@ public void addImporter() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .addExtensionFilter(StandardFileType.CLASS, StandardFileType.JAR, StandardFileType.ZIP) .withDefaultExtension(StandardFileType.CLASS) - .withInitialDirectory(preferences.getWorkingDir()) + .withInitialDirectory(preferences.getFilePreferences().getWorkingDirectory()) .build(); Optional selectedFile = dialogService.showFileOpenDialog(fileDialogConfiguration); diff --git a/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java b/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java index 783f6069acae..eca825e896ff 100644 --- a/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/linkedfiles/LinkedFilesTabViewModel.java @@ -42,15 +42,13 @@ public class LinkedFilesTabViewModel implements PreferenceTabViewModel { private final Validator mainFileDirValidator; private final DialogService dialogService; - private final PreferencesService preferences; private final FilePreferences filePreferences; - private final AutoLinkPreferences initialAutoLinkPreferences; + private final AutoLinkPreferences autoLinkPreferences; public LinkedFilesTabViewModel(DialogService dialogService, PreferencesService preferences) { this.dialogService = dialogService; - this.preferences = preferences; this.filePreferences = preferences.getFilePreferences(); - this.initialAutoLinkPreferences = preferences.getAutoLinkPreferences(); + this.autoLinkPreferences = preferences.getAutoLinkPreferences(); mainFileDirValidator = new FunctionBasedValidator<>( mainFileDirectoryProperty, @@ -82,13 +80,13 @@ public void setValues() { fileDirectoryPatternProperty.setValue(filePreferences.getFileDirectoryPattern()); // Autolink preferences - switch (initialAutoLinkPreferences.getCitationKeyDependency()) { + switch (autoLinkPreferences.getCitationKeyDependency()) { case START -> autolinkFileStartsBibtexProperty.setValue(true); case EXACT -> autolinkFileExactBibtexProperty.setValue(true); case REGEX -> autolinkUseRegexProperty.setValue(true); } - autolinkRegexKeyProperty.setValue(initialAutoLinkPreferences.getRegularExpression()); + autolinkRegexKeyProperty.setValue(autoLinkPreferences.getRegularExpression()); } @Override @@ -102,14 +100,14 @@ public void storeSettings() { // Autolink preferences if (autolinkFileStartsBibtexProperty.getValue()) { - preferences.getAutoLinkPreferences().setCitationKeyDependency(AutoLinkPreferences.CitationKeyDependency.START); + autoLinkPreferences.setCitationKeyDependency(AutoLinkPreferences.CitationKeyDependency.START); } else if (autolinkFileExactBibtexProperty.getValue()) { - preferences.getAutoLinkPreferences().setCitationKeyDependency(AutoLinkPreferences.CitationKeyDependency.EXACT); + autoLinkPreferences.setCitationKeyDependency(AutoLinkPreferences.CitationKeyDependency.EXACT); } else if (autolinkUseRegexProperty.getValue()) { - preferences.getAutoLinkPreferences().setCitationKeyDependency(AutoLinkPreferences.CitationKeyDependency.REGEX); + autoLinkPreferences.setCitationKeyDependency(AutoLinkPreferences.CitationKeyDependency.REGEX); } - preferences.getAutoLinkPreferences().setRegularExpression(autolinkRegexKeyProperty.getValue()); + autoLinkPreferences.setRegularExpression(autolinkRegexKeyProperty.getValue()); } ValidationStatus mainFileDirValidationStatus() { diff --git a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTab.java b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTab.java index 997abc78d9bd..03038872af25 100644 --- a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTab.java +++ b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTab.java @@ -44,7 +44,7 @@ public String getTabName() { } public void initialize() { - this.viewModel = new NameFormatterTabViewModel(dialogService, preferencesService); + this.viewModel = new NameFormatterTabViewModel(preferencesService.getNameFormatterPreferences()); formatterNameColumn.setSortable(true); formatterNameColumn.setReorderable(false); diff --git a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTabViewModel.java b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTabViewModel.java index d04633244460..3bcfb75cc5f5 100644 --- a/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/nameformatter/NameFormatterTabViewModel.java @@ -9,11 +9,9 @@ import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; -import org.jabref.gui.DialogService; import org.jabref.gui.preferences.PreferenceTabViewModel; import org.jabref.logic.layout.format.NameFormatterPreferences; import org.jabref.model.strings.StringUtil; -import org.jabref.preferences.PreferencesService; public class NameFormatterTabViewModel implements PreferenceTabViewModel { @@ -21,21 +19,17 @@ public class NameFormatterTabViewModel implements PreferenceTabViewModel { private final StringProperty addFormatterNameProperty = new SimpleStringProperty(); private final StringProperty addFormatterStringProperty = new SimpleStringProperty(); - private final DialogService dialogService; - private final PreferencesService preferences; - private final NameFormatterPreferences initialNameFormatterPreferences; + private final NameFormatterPreferences nameFormatterPreferences; - NameFormatterTabViewModel(DialogService dialogService, PreferencesService preferences) { - this.dialogService = dialogService; - this.preferences = preferences; - this.initialNameFormatterPreferences = preferences.getNameFormatterPreferences(); + NameFormatterTabViewModel(NameFormatterPreferences preferences) { + this.nameFormatterPreferences = preferences; } @Override public void setValues() { formatterListProperty.clear(); - List names = initialNameFormatterPreferences.getNameFormatterKey(); - List formats = initialNameFormatterPreferences.getNameFormatterValue(); + List names = nameFormatterPreferences.getNameFormatterKey(); + List formats = nameFormatterPreferences.getNameFormatterValue(); for (int i = 0; i < names.size(); i++) { if (i < formats.size()) { @@ -57,10 +51,8 @@ public void storeSettings() { formats.add(formatterListItem.getFormat()); } - NameFormatterPreferences newNameFormatterPreferences = new NameFormatterPreferences( - names, - formats); - preferences.storeNameFormatterPreferences(newNameFormatterPreferences); + nameFormatterPreferences.setNameFormatterKey(names); + nameFormatterPreferences.setNameFormatterValue(formats); } public void addFormatter() { diff --git a/src/main/java/org/jabref/gui/preferences/protectedterms/NewProtectedTermsFileDialog.java b/src/main/java/org/jabref/gui/preferences/protectedterms/NewProtectedTermsFileDialog.java index 679fc56f17a3..7802e7fde1b3 100644 --- a/src/main/java/org/jabref/gui/preferences/protectedterms/NewProtectedTermsFileDialog.java +++ b/src/main/java/org/jabref/gui/preferences/protectedterms/NewProtectedTermsFileDialog.java @@ -16,14 +16,14 @@ import org.jabref.logic.l10n.Localization; import org.jabref.logic.protectedterms.ProtectedTermsList; import org.jabref.logic.util.StandardFileType; -import org.jabref.preferences.PreferencesService; +import org.jabref.preferences.FilePreferences; public class NewProtectedTermsFileDialog extends BaseDialog { private final TextField newFile = new TextField(); private final DialogService dialogService; - public NewProtectedTermsFileDialog(List termsLists, DialogService dialogService, PreferencesService preferencesService) { + public NewProtectedTermsFileDialog(List termsLists, DialogService dialogService, FilePreferences filePreferences) { this.dialogService = dialogService; this.setTitle(Localization.lang("New protected terms file")); @@ -31,7 +31,7 @@ public NewProtectedTermsFileDialog(List termsLists, FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .addExtensionFilter(Localization.lang("Protected terms file"), StandardFileType.TERMS) .withDefaultExtension(Localization.lang("Protected terms file"), StandardFileType.TERMS) - .withInitialDirectory(preferencesService.getWorkingDir()) + .withInitialDirectory(filePreferences.getWorkingDirectory()) .build(); Button browse = new Button(Localization.lang("Browse")); diff --git a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTabViewModel.java b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTabViewModel.java index c3cc950660c1..2382ea04263c 100644 --- a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTabViewModel.java @@ -92,7 +92,7 @@ public void addFile() { FileDialogConfiguration fileDialogConfiguration = new FileDialogConfiguration.Builder() .addExtensionFilter(Localization.lang("Protected terms file"), StandardFileType.TERMS) .withDefaultExtension(Localization.lang("Protected terms file"), StandardFileType.TERMS) - .withInitialDirectory(preferences.getWorkingDir()) + .withInitialDirectory(preferences.getFilePreferences().getWorkingDirectory()) .build(); dialogService.showFileOpenDialog(fileDialogConfiguration) @@ -121,7 +121,7 @@ public void removeList(ProtectedTermsListItemModel itemModel) { } public void createNewFile() { - dialogService.showCustomDialogAndWait(new NewProtectedTermsFileDialog(termsFilesProperty, dialogService, preferences)); + dialogService.showCustomDialogAndWait(new NewProtectedTermsFileDialog(termsFilesProperty, dialogService, preferences.getFilePreferences())); } public void edit(ProtectedTermsListItemModel file) { diff --git a/src/main/java/org/jabref/gui/preferences/table/TableTab.fxml b/src/main/java/org/jabref/gui/preferences/table/TableTab.fxml index c65b263263f5..0ff264f489f4 100644 --- a/src/main/java/org/jabref/gui/preferences/table/TableTab.fxml +++ b/src/main/java/org/jabref/gui/preferences/table/TableTab.fxml @@ -17,7 +17,6 @@ xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml" fx:controller="org.jabref.gui.preferences.table.TableTab"> - @@ -88,17 +87,6 @@