diff --git a/.github/workflows/refresh-journal-lists.yml b/.github/workflows/refresh-journal-lists.yml index 3b0c2ec1445..f296bc588de 100644 --- a/.github/workflows/refresh-journal-lists.yml +++ b/.github/workflows/refresh-journal-lists.yml @@ -1,7 +1,11 @@ name: Refresh Journal Lists on: - # Allow to run manually + push: + paths: + - '.github/workflows/refresh-journal-lists.yml' + - 'buildSrc/build.gradle' + - 'src/main/java/org/jabref/logic/journals/**' workflow_dispatch: permissions: @@ -58,13 +62,13 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} branch: update-journallist - title: "[Bot] Update Journal abbrev list" - commit-message: Update journal abbrev list + title: "[Bot] Update journal abbreviation lists" + commit-message: Update journal abbreviation lists - name: Commit and push changes uses: EndBug/add-and-commit@v9 if: github.ref != 'refs/heads/main' with: - message: 'Update journal abbrev list' + message: 'Update journal abbreviation lists' committer_email: actions@github.com fetch: false push: true diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 407f65c9dc8..b069d04e199 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -1,4 +1,7 @@ -apply plugin: 'java' +plugins { + id 'java' + id 'org.openjfx.javafxplugin' version '0.0.14' +} repositories { mavenLocal() @@ -11,6 +14,11 @@ dependencies { implementation 'org.slf4j:slf4j-api:2.0.7' } +javafx { + version = "20" + modules = [ 'javafx.base' ] +} + sourceSets{ main { java { diff --git a/buildSrc/src/copied/java/org/jabref/logic/journals/JournalAbbreviationLoader.java b/buildSrc/src/copied/java/org/jabref/logic/journals/JournalAbbreviationLoader.java index 2c67a734a8b..1c0717a943c 100644 --- a/buildSrc/src/copied/java/org/jabref/logic/journals/JournalAbbreviationLoader.java +++ b/buildSrc/src/copied/java/org/jabref/logic/journals/JournalAbbreviationLoader.java @@ -1,7 +1,6 @@ package org.jabref.logic.journals; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.Collection; @@ -62,6 +61,6 @@ public static JournalAbbreviationRepository loadRepository(JournalAbbreviationPr } public static JournalAbbreviationRepository loadBuiltInRepository() { - return loadRepository(new JournalAbbreviationPreferences(Collections.emptyList(), StandardCharsets.UTF_8, true)); + return loadRepository(new JournalAbbreviationPreferences(Collections.emptyList(), true)); } } diff --git a/buildSrc/src/copied/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java b/buildSrc/src/copied/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java index 442fda33ddc..fb256bbe8ab 100644 --- a/buildSrc/src/copied/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java +++ b/buildSrc/src/copied/java/org/jabref/logic/journals/JournalAbbreviationPreferences.java @@ -1,37 +1,41 @@ package org.jabref.logic.journals; -import java.nio.charset.Charset; import java.util.List; +import javafx.beans.property.BooleanProperty; +import javafx.beans.property.SimpleBooleanProperty; +import javafx.collections.FXCollections; +import javafx.collections.ObservableList; + public class JournalAbbreviationPreferences { - private final Charset defaultEncoding; - private List externalJournalLists; - private boolean useFJournalField; + private final ObservableList externalJournalLists; + private final BooleanProperty useFJournalField; - public JournalAbbreviationPreferences(List externalJournalLists, Charset defaultEncoding, boolean useFJournalField) { - this.externalJournalLists = externalJournalLists; - this.defaultEncoding = defaultEncoding; - this.useFJournalField = useFJournalField; + public JournalAbbreviationPreferences(List externalJournalLists, + boolean useFJournalField) { + this.externalJournalLists = FXCollections.observableArrayList(externalJournalLists); + this.useFJournalField = new SimpleBooleanProperty(useFJournalField); } - public List getExternalJournalLists() { + public ObservableList getExternalJournalLists() { return externalJournalLists; } - public void setExternalJournalLists(List externalJournalLists) { - this.externalJournalLists = externalJournalLists; + public void setExternalJournalLists(List list) { + externalJournalLists.clear(); + externalJournalLists.addAll(list); } - public Charset getDefaultEncoding() { - return defaultEncoding; + public boolean shouldUseFJournalField() { + return useFJournalField.get(); } - public boolean useAMSFJournalFieldForAbbrevAndUnabbrev() { + public BooleanProperty useFJournalFieldProperty() { return useFJournalField; } - public void setUseAMSFJournalFieldForAbbrevAndUnabbrev(boolean useFJournalField) { - this.useFJournalField = useFJournalField; + public void setUseFJournalField(boolean useFJournalField) { + this.useFJournalField.set(useFJournalField); } } diff --git a/src/main/resources/journals/journal-list.mv b/src/main/resources/journals/journal-list.mv index aa7d89f38d4..5c1457274e6 100644 Binary files a/src/main/resources/journals/journal-list.mv and b/src/main/resources/journals/journal-list.mv differ