diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7bece4ad46d..dc16a47b170 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -11,7 +11,7 @@ The title of the PR must not reference an issue, because GitHub does not support - Please don't remove any items, just leave them unchecked if they are not applicable. --> -- [ ] Change in CHANGELOG.md described (if applicable) +- [ ] Change in `CHANGELOG.md` described in a way that is understandable for the average user (if applicable) - [ ] Tests created for changes (if applicable) - [ ] Manually tested changed features in running JabRef (always required) - [ ] Screenshots added in PR description (for UI changes) diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index ff5b9df74ef..230e6818721 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -5,18 +5,23 @@ jobs: automerge: name: Automerge Dependabot runs-on: ubuntu-latest - if: github.actor == 'dependabot[bot]' + if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]' steps: - name: 'Wait for status checks' id: waitforstatuschecks uses: "WyriHaximus/github-action-wait-for-status@v1.3" with: - ignoreActions: Automerge Dependabot + ignoreActions: Automerge Dependabot,Code coverage,Create snapcraft image,Deploy binaries on builds.jabref.org,codecov/project,markdown-link-check checkInterval: 13 env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - name: Auto approve + uses: hmarr/auto-approve-action@v2.0.0 + if: steps.waitforstatuschecks.outputs.status == 'success' + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" - name: Merge pull requests - uses: pascalgn/automerge-action@v0.13.0 + uses: pascalgn/automerge-action@v0.13.1 if: steps.waitforstatuschecks.outputs.status == 'success' env: MERGE_METHOD: "squash" diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 38b01adb35e..6cb29aaaf1e 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -42,7 +42,7 @@ jobs: name: Create installer and portable version for ${{ matrix.displayName }} steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.7.0 + uses: styfle/cancel-workflow-action@0.8.0 with: access_token: ${{ github.token }} - name: Fetch all history for all tags and branches @@ -50,12 +50,12 @@ jobs: with: fetch-depth: 0 - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.8 + uses: gittools/actions/gitversion/setup@v0.9.9 with: versionSpec: "5.x" - name: Run GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.8 + uses: gittools/actions/gitversion/execute@v0.9.9 - name: Set up JDK 15 for linux and mac uses: actions/setup-java@v1 with: @@ -162,12 +162,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.8 + uses: gittools/actions/gitversion/setup@v0.9.9 with: versionSpec: '5.x' - name: Run GitVersion id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.8 + uses: gittools/actions/gitversion/execute@v0.9.9 - name: Get linux binaries uses: actions/download-artifact@master with: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 655c92ef490..b645f193574 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -18,7 +18,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Cancel Previous Runs - uses: styfle/cancel-workflow-action@0.7.0 + uses: styfle/cancel-workflow-action@0.8.0 with: access_token: ${{ github.token }} - name: Checkout source diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index c7790f81828..00000000000 --- a/AUTHORS +++ /dev/null @@ -1,436 +0,0 @@ -# This file lists all individuals having contributed content to the repository. -# For how it is generated, see `scripts/generate-authors.sh`. -1160300608 -1160300614 -Aaron Chen -Abhishek Rai -Abraham Polk -Adam Rehn -Admir Obralija -Adrian Daerr -Akash Deep -Alain Vaucher -Aleksandrs Gusevs -Alessio Pollero -Alex Montgomery -Alex Petrov -Alex Tarrix -Alexander Girgis -Alexis Gallagher -Alexsandro Lauber -Ali Ayan -Ali Zhagparov -Alick Zhao -Allison Sampaio -Aman Jain -Ambrogio Oliva -Amish Shah -Andreas Amann -Andreas Buhr -Andreas Rudert -Andrew Collins -Andrew Kuncevich -Andrew Levit -André Schlichting -Andrés Sánchez -Anh Nghia Tran -Anita Armbruster -Antonio Ribeiro -Arno Blouin -Arthur Fröhlich -AtrusRiven -Atul Kaushik -August Janse -Ayachi Nene -Bartosz J. Kaczkowski -Bartłomiej Dach -Baruch Oltman -Behrouz Javanmardi -Benedikt Tutzer -Benjamin Köhler -Benjamin Schroth -Berk Gureken -Bernd Kalbfuss -Bernhard Tempel -Bharat Raghunathan -Bhargava Varadharajan -Bherwani Ayush -Bitor Tonixa Biriato Balença -Brian Quistorff -Brian Van Essen -Cai Zhichun -Caleb Tillman -captain123 -Carl Christian Snethlage -carlg0ransson -Carlos Morales -Carlos Silla -Carlos Silva -Catarina Gomes -Cerrianne Santos -Chamod Shehanka -Chelsey Ong -Chen Yuheng -Chris Brown -Christian Bartsch -Christian Kopf -Christoph Braun -Christoph Hochreiner -Christoph Schwentker -Christoph Treude -Christopher Oezbek -Christopher S. Lester -conorfos -cs464osu -Cyrille d'Haese -Dale Visser -Daniel Bruehl -Daniel Mair -Daniel Price -Daniel Rodrigues -Daniel Svärd -David Gleich -David Méndez -David Stevens -David Weitzman -Dawid Motyka -Dawid Owoc -Deepak Kumar -Dennis Tschechlov -DevSiroukane -Dilan Coss -dima -Dimitra Karadima -Domenico Cufalo -Dominik Schrempf -Dominik Traczyk -Dominik Voigt -Dominik Waßenhoven -Douglas Nassif Roma Junior -Eduard Braun -Eduardo Greco -eetian -Egon Willighagen -Eiswindyeti -Ellen Reitmayr -Erdem Derebasoglu -Erdem Derebaşoğlu -Eric Lau -Erik Putrycz -Ervin Kolenovic -Escoul -Ethan Harris -Fabian Bauer -Fabian Bieker -Fabiani Giovanni -Fabio Marcos -Fabrice Dessaint -Fancy Zhang -Fedor Bezrukov -Felix Berger -Felix Langner -Felix Luthman -Felix Wilke -Fernando Santagata -ffffatgoose -Fiyinfolu Eludire -Florian Beetz -Florian Straßer -Foivos Christoulakis -fpguy -Francois Charette -Frank Steimle -frasca80 -Fred Stevens -Frédéric Darboux -Galileo Sartor -Gennadiy Stakhovskiy -Geoffrey Taerim Kim -Gert Renckens -Giovanni Caldarola -Giri -Goutam Lavudiya -Graeme Stewart -Gregor Herrmann -Grzegorz Popiel -guenesaydin -Guillaume Gardey -Hakan Duran -Hannes Restel -Harinda Samarasekara -hemantgs -HifeFish -Hollyqqqqq -Houssem Nasri -hrandrianasolo -Hussain Arif -IfIWantedTo -Igor Chernyavsky -Igor Steinmacher -Illes Solt -Ingvar Jackal -Isaac Roles -Isabel Beckenbach -Jackson Ryan -Jan Frederik Maas -Jan Kubovy -Jan Schäfer -Janosch Kutscherauer -Jason Pickering -Jasper Vandemalle -Javier Muñoz Ferrara -jcampbell11245 -Jeff Kerr -Jeff Miller -Jeffrey Kuhn -Jeffrey Sander -Jens Döcke -joeyzgraggen -Johan Del Valle -Johannes Hupe -Johannes Manner -Johannes Theiner -John David -John Relph -John Zedlewski -Jonas Lähnemann -Jonas Moosmann -Jonatan Asketorp -Jonathan Powell -Jong-Ho Shinn -Jorge Tornero -josephshin93 -Joshua Ramon Enslin -José Jesús Sinohui Fernández -Julian Pfeifer -Julien Bénard -Jure Slak -József Pallagi -Jörg Lenhard -Jörg Wegner -Jörg Zieren -Jørgen Kvalsvik -Jürgen Lange -k3KAW8Pnf7mkmdSMPHz27 -Kai Mindermann -Kai Takac -Kaique Komata -Karsten Hiekmann -Kelly Click -Koji Yokota -KOLANICH -Kolja Brix -Kristoffer Gunnarsson -Krunoslav Zubrinic -Krzysztof A. Kościuszkiewicz -Kyle Johnson -Laura Hernández Gómez -Lavabit -Le-wi -Lee Patton -Leonardo Haddad -Leonhard Wolz -Li Yiming -Li Zhilin -Ling Wang -Linus Dietz -Lorenzo Genta -Lucas Beretti -Luciana de Melo e Abud -Lugduni Desrosiers -Luis Romero -Luis Valdez -Mairieli Wessel -Malik Atalla -Malte Deiseroth -Manas Singh -Manuel Siebeneicher -Manuel Wtfjoke -Marcel Luethi -Marco Aurélio Graciotto Silva -Marco Konersmann -Mariana Prudencio -Marius Kleiner -Mark Schenk -Martin Kähmer -Martin Stolle -Martin W. Kirst -Martina Catizone -Mathias Walter -Matthias Geiger -Matthias Mayr -Matthias Mueller -Matthijs van der Burgh -Mattia Bunel -Mattias Ulbrich -mcmoody -Meltem Demirköprü -MhhhxX -Michael Beckmann -Michael Falkenthal -Michael Lass -Michael Mauersberger -Michael McCann -Michael Schwarmi -Michael Spiegel -Michael Wrighton -Michal Rican -Michel Baylac -Michel Krämer -Mihu -Mike Smoot -mohamean -Mootez Saad -Morgan Lovato -Moritz Ringler -Morten Alver -ms111ds -muachilin -Muhammad Arsalan Badar -Mélanie Tremblay -Nadeem Mahmood -Nathan Dunn -Nathan Sheffield -Nick Mancuso -Nick S. Weatherley -Nico Schlömer -Nicolas Pavillon -Niffler -Nikita Borovikov -Niklas Schmitt -nikmilpv -NikodemKch -Nikolaus Koopmann -Nils Streijffert -Niv Ierushalmi -Nivedha Sunderraj -Nizar N. Batada -noravanq -obsluk00 -Olaf Lenz -Oliver Beckmann -Oliver Kopp -omer-rotem1 -Oscar Gustafsson -Owen Huang -P4trice -Param Mittal -Patrick Lin -Patrick Scheibe -Paul Krappatsch -Paul Martin -pavlapp -Peter Ansell -Philip Johnson -Prasan Yapa -Predrag Milanovic -Qing -Quentin Fritz -Rachel Wu -Raik Nagel -razvan05 -Redevectored -Renato Massao -Richard Schneeman -Robert Jäschke -Robin Lichtenthaeler -Rodrigo Paula da Silva -Rolf Green -Rolf Starre -Ronak Lakhotia -Roy Storey -Rudolf Seemann -Rui Kang -Ruy Minoru Ito Takata -Ryo Igarashi -S M Mahbub Murshed -S. Krause -Saivert -Sam Robertson -Samin Muhammad Ridwanul Karim -Samiya Caur -Sandro Speth -Sascha Hunold -Sascha Zeller -Saulius Gražulis -Saverio Mori -Schaggerlag -Scott Pogatetz -Scott Townsend -Seb Wills -Serban Iordache -Shadow Devil -Shikun Xiong -ShiqingLiu -Shitikanth -shubhamatlani -Simon Harrer -Simon Rutishauser -Songyu Wang -speed9 -Stanley Foerster -Stefan Feyer -Stefan Gerzmann -Stefan Kolb -Stefan Kufer -Stefan Robert -Stefan Scheffel -Stefano Gariazzo -Steffin Stanly -Stephan Lau -Stephan Rave -Stephen Beitzel -Stéphane Curet -Super-Tang -Sven Jäger -systemoperator -Thiago Toledo -Thomas Arildsen -Thomas F. Duellmann -Thomas Hu -Thomas Ilsche -Thorsten Dahlheimer -Tianjian Lei -Tim Kilian -Tim van Rossum -Tim Würtele -Timucin Merdin -Tobias Boceck -Tobias Bouschen -Tobias Denkinger -Tobias Diez -Tom Warnke -Tommy Samuelsson -Tomás Morales de Luna -Tony K -Toralf Senger -uid112001 -Ulrich Stärk -Ulrik Stervbo -UltimaBGD -Uwe Kuehn -Valentin Pons -Venceslas Roullier -Victor Figueira -Victor Michelan -Vincent Gagnon -Vincent W. Yang -Vlad Topala -Waida Fan -Waluyo Adi Siswanto -WangAooa -Ward Poelmans -Wenbo Yang -wuw -Yang Zongze -Yara Grassi Gouffon -Yash Kothari -Yichen Sun -Yifan Peng -Yunsheng Luo -Yurick Honda -zacmks -Zeabin -Zgarbul Andrey -Zhang Liang -ZhouSky diff --git a/CHANGELOG.md b/CHANGELOG.md index 008972b30c3..99b84dd7dbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,19 +11,24 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve ### Added +- We added zbmath to the public databases from which the bibliographic information of an existing entry can be updated. [#7437](https://github.com/JabRef/jabref/issues/7437) - We added the possibility to add a new entry via its zbMath ID (zbMATH can be chosen as ID type in the "Select entry type" window). [#7202](https://github.com/JabRef/jabref/issues/7202) - We added the extension support and the external application support (For Texshow, Texmaker and LyX) to the flatpak [#7248](https://github.com/JabRef/jabref/pull/7248) - We added some symbols and keybindings to the context menu in the entry editor. [#7268](https://github.com/JabRef/jabref/pull/7268) - We added keybindings for setting and clearing the read status. [#7264](https://github.com/JabRef/jabref/issues/7264) - We added two new fields to track the creation and most recent modification date and time for each entry. [koppor#130](https://github.com/koppor/jabref/issues/130) +- We added a feature that allows the user to copy highlighted text in the preview window. [#6962](https://github.com/JabRef/jabref/issues/6962) ### Changed +- The keywords added via "Manage content selectors" are now displayed in alphabetical order. [#3791](https://github.com/JabRef/jabref/issues/3791) - We improved the "Find unlinked files" dialog to show import results for each file. [#7209](https://github.com/JabRef/jabref/pull/7209) - The content of the field `timestamp` is migrated to `creationdate`. In case one configured "udpate timestampe", it is migrated to `modificationdate`. [koppor#130](https://github.com/koppor/jabref/issues/130) - The JabRef specific meta-data content in the main field such as priorities (prio1, prio2, ...) are migrated to their respective fields. They are removed from the keywords. [#6840](https://github.com/jabref/jabref/issues/6840) - We fixed an issue where groups generated from authors' last names did not include all entries of the authors' [#5833](https://github.com/JabRef/jabref/issues/5833) - The export to MS Office XML now uses the month name for the field `MonthAcessed` instead of the two digit number [#7354](https://github.com/JabRef/jabref/issues/7354) +- We included some standalone dialogs from the options menu in the main preference dialog and fixed some visual issues in the preferences dialog. [#7384](https://github.com/JabRef/jabref/pull/7384) +- We improved the linking of the `python3` interpreter via the shebang to dynamically use the systems default Python. Related to [JabRef-Browser-Extension #177](https://github.com/JabRef/JabRef-Browser-Extension/issues/177) ### Fixed @@ -40,7 +45,16 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where the Harvard RTF exporter did not use the new authors formatter and therefore did not export "organization" authors correctly. [4508](https://github.com/JabRef/jabref/issues/4508) - We fixed an issue where the field `urldate` was not exported to the corresponding fields `YearAccessed`, `MonthAccessed`, `DayAccessed` in MS Office XML [#7354](https://github.com/JabRef/jabref/issues/7354) - We fixed an issue where the password for a shared SQL database was only remembered if it was the same as the username [#6869](https://github.com/JabRef/jabref/issues/6869) +- We fixed an issue where some custom exports did not use the new authors formatter and therefore did not export authors correctly [#7356](https://github.com/JabRef/jabref/issues/7356) +- We fixed an issue where alt+keyboard shortcuts do not work [#6994](https://github.com/JabRef/jabref/issues/6994) - We fixed an issue where the file path is invisible in dark theme. [#7382](https://github.com/JabRef/jabref/issues/7382) +- We fixed an issue where the secondary sorting is not working for some special fields. [#7015](https://github.com/JabRef/jabref/issues/7015) +- We fixed an issue where changing the font size makes the font size field too small. [#7085](https://github.com/JabRef/jabref/issues/7085) +- We fixed an issue with TexGroups on Linux systems, where the modification of an aux-file did not trigger an auto-update for TexGroups. Furthermore, the detection of file modifications is now more reliable. [#7412](https://github.com/JabRef/jabref/pull/7412) +- We fixed an issue where the Unicode to Latex formatter produced wrong results for characters with a codepoint higher than Character.MAX_VALUE. [#7387](https://github.com/JabRef/jabref/issues/7387) +- We fixed an issue where a non valid value as font size results in an uncaught exception. [#7415](https://github.com/JabRef/jabref/issues/7415) +- We fixed an issue where "Merge citations" in the Openoffice/Libreoffice integration panel did not have a corresponding opposite. [#7454](https://github.com/JabRef/jabref/issues/7454) +- We fixed an issue where drag and drop of bib files for opening resulted in uncaught exceptions [#7464](https://github.com/JabRef/jabref/issues/7464) ### Removed @@ -83,7 +97,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We changed connect timeouts for server requests to 30 seconds in general and 5 seconds for GROBID server (special) and improved user notifications on connection issues. [7026](https://github.com/JabRef/jabref/pull/7026) - We changed the order of the library tab context menu items. [#7171](https://github.com/JabRef/jabref/issues/7171) - We changed the way linked files are opened on Linux to use the native openFile method, compatible with confined packages. [7037](https://github.com/JabRef/jabref/pull/7037) -- We refined the entry preview to show the full names of authors and editors, to list the editor only if no author is present, have the year ealier. [#7083](https://github.com/JabRef/jabref/issues/7083) +- We refined the entry preview to show the full names of authors and editors, to list the editor only if no author is present, have the year earlier. [#7083](https://github.com/JabRef/jabref/issues/7083) ### Fixed diff --git a/build.gradle b/build.gradle index 2273d0a127a..cd36fcb939b 100644 --- a/build.gradle +++ b/build.gradle @@ -10,11 +10,11 @@ import org.jabref.build.xjc.XjcTask plugins { id 'application' id "com.simonharrer.modernizer" version '2.1.0-1' - id 'me.champeau.gradle.jmh' version '0.5.2' + id 'me.champeau.gradle.jmh' version '0.5.3' id 'com.github.ben-manes.versions' version '0.36.0' id 'org.javamodularity.moduleplugin' version '1.7.0' id 'org.openjfx.javafxplugin' version '0.0.9' - id 'org.beryx.jlink' version '2.23.2' + id 'org.beryx.jlink' version '2.23.3' // nicer test outputs during running and completion // Homepage: https://github.com/radarsh/gradle-test-logger-plugin id 'com.adarshr.test-logger' version '2.1.1' @@ -115,8 +115,8 @@ dependencies { implementation 'commons-cli:commons-cli:1.4' - implementation 'org.libreoffice:libreoffice:7.0.4' - implementation 'org.libreoffice:unoloader:7.0.4' + implementation 'org.libreoffice:libreoffice:7.1.0' + implementation 'org.libreoffice:unoloader:7.1.0' implementation 'io.github.java-diff-utils:java-diff-utils:4.9' implementation 'info.debatty:java-string-similarity:2.0.0' @@ -127,18 +127,18 @@ dependencies { antlr4 'org.antlr:antlr4:4.9.1' implementation 'org.antlr:antlr4-runtime:4.9.1' - implementation (group: 'org.apache.lucene', name: 'lucene-queryparser', version: '8.7.0') { + implementation (group: 'org.apache.lucene', name: 'lucene-queryparser', version: '8.8.1') { exclude group: 'org.apache.lucene', module: 'lucene-sandbox' } implementation group: 'org.eclipse.jgit', name: 'org.eclipse.jgit', version: '5.10.0.202012080955-r' - implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.12.0-rc2' - implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.12.0-rc2' + implementation group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-yaml', version: '2.12.1' + implementation group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: '2.12.1' - implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.1' + implementation group: 'org.mariadb.jdbc', name: 'mariadb-java-client', version: '2.7.2' - implementation 'org.postgresql:postgresql:42.2.18' + implementation 'org.postgresql:postgresql:42.2.19' implementation ('com.oracle.ojdbc:ojdbc10:19.3.0.0') { // causing module issues @@ -153,19 +153,19 @@ dependencies { implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.5' // JavaFX stuff - implementation 'de.jensd:fontawesomefx-commons:11.0' - implementation 'de.jensd:fontawesomefx-materialdesignfont:1.7.22-11' + implementation 'org.kordamp.ikonli:ikonli-javafx:12.2.0' + implementation 'org.kordamp.ikonli:ikonli-materialdesign2-pack:12.2.0' implementation 'de.saxsys:mvvmfx-validation:1.9.0-SNAPSHOT' implementation 'de.saxsys:mvvmfx:1.8.0' implementation 'com.tobiasdiez:easybind:2.1.0' - implementation 'org.fxmisc.flowless:flowless:0.6.2' + implementation 'org.fxmisc.flowless:flowless:0.6.3' implementation 'org.fxmisc.richtext:richtextfx:0.10.4' implementation group: 'org.glassfish.hk2.external', name: 'jakarta.inject', version: '2.6.1' implementation 'com.jfoenix:jfoenix:9.0.10' - implementation 'org.controlsfx:controlsfx:11.0.3' + implementation 'org.controlsfx:controlsfx:11.1.0' implementation 'org.jsoup:jsoup:1.13.1' - implementation 'com.konghq:unirest-java:3.11.10' + implementation 'com.konghq:unirest-java:3.11.11' implementation 'org.slf4j:slf4j-api:2.0.0-alpha1' implementation group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '3.0.0-SNAPSHOT' @@ -194,24 +194,24 @@ dependencies { implementation 'com.vladsch.flexmark:flexmark-ext-gfm-strikethrough:0.62.2' implementation 'com.vladsch.flexmark:flexmark-ext-gfm-tasklist:0.62.2' - testImplementation 'io.github.classgraph:classgraph:4.8.98' - testImplementation 'org.junit.jupiter:junit-jupiter:5.7.0' - testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.7.0' - testImplementation 'org.junit.platform:junit-platform-launcher:1.7.0' + testImplementation 'io.github.classgraph:classgraph:4.8.102' + testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.7.1' + testImplementation 'org.junit.platform:junit-platform-launcher:1.7.1' - testImplementation 'net.bytebuddy:byte-buddy-parent:1.10.19' + testImplementation 'net.bytebuddy:byte-buddy-parent:1.10.21' testRuntime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' testRuntime group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT' - testImplementation 'org.mockito:mockito-core:3.7.7' + testImplementation 'org.mockito:mockito-core:3.8.0' testImplementation 'org.xmlunit:xmlunit-core:2.8.2' testImplementation 'org.xmlunit:xmlunit-matchers:2.8.2' - testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.15.0' - testImplementation 'com.tngtech.archunit:archunit-junit5-api:0.15.0' + testRuntime 'com.tngtech.archunit:archunit-junit5-engine:0.17.0' + testImplementation 'com.tngtech.archunit:archunit-junit5-api:0.17.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" - checkstyle 'com.puppycrawl.tools:checkstyle:8.39' + checkstyle 'com.puppycrawl.tools:checkstyle:8.41' xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.3' } @@ -230,11 +230,6 @@ dependencyUpdates.resolutionStrategy = { selection.reject('Release candidate') } } - rules.withModule("de.jensd:fontawesomefx-materialdesignfont") { ComponentSelection selection -> - if (selection.candidate.version ==~ /2.0.26.*/) { - selection.reject('1.7.22-11 is actually newer (strange version system)') - } - } rules.withModule("org.javamodularity.moduleplugin:org.javamodularity.moduleplugin.gradle.plugin") { ComponentSelection selection -> if (selection.candidate.version ==~ /1.6.0/) { selection.reject("Does not work due to bug, see https://github.com/JabRef/jabref/pull/5270") diff --git a/buildres/linux/jabrefHost.py b/buildres/linux/jabrefHost.py index 72e2eacbbfa..bbe02decfc6 100755 --- a/buildres/linux/jabrefHost.py +++ b/buildres/linux/jabrefHost.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import json import logging diff --git a/docs/adr/0016-mutable-preferences-objects.md b/docs/adr/0016-mutable-preferences-objects.md index 96fadaf5e6f..98934527ee2 100644 --- a/docs/adr/0016-mutable-preferences-objects.md +++ b/docs/adr/0016-mutable-preferences-objects.md @@ -6,8 +6,8 @@ To create an immutable preferences object every time seems to be a waste of time ## Considered Options -* Create a new object every time a preferences object should be altered by a with*-method, similar to a builder. -* Alter the existing object and return it. +* Alter the existing object and return it (by a `with*` -method, similar to a builder, but changing the object at hand). +* Create a new object every time a preferences object should be altered. ## Decision Outcome diff --git a/docs/advanced-reading/ui-recommendations.md b/docs/advanced-reading/ui-recommendations.md index 1fdf8b75367..e264d2bc2a1 100644 --- a/docs/advanced-reading/ui-recommendations.md +++ b/docs/advanced-reading/ui-recommendations.md @@ -14,3 +14,10 @@ More information: [http://ux.stackexchange.com/a/768](http://ux.stackexchange.com/a/768) +## Form validation + +* Only validate input after leaving the field (or after the user stopped typing for some time) +* The user shouldn't be able to submit the form if there are errors +* However, disabling the submit button in case there are errors is also not optimal. Instead, clicking the submit button should highlight the errors. +* Empty required files shouldn't be marked as invalid until the user a) tries to submit the form or b) focused the field, deleted it contents and then left the field (see [Example](https://www.w3schools.com/tags/tryit.asp?filename=tryhtml5_input_required) +* Ideally, the error message should be shown below the text field and not as a tooltip (so that users quickly understand what's the problem). For example as here [in Boostrap](https://mdbootstrap.com/docs/jquery/forms/validation/?#custom-styles) diff --git a/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md b/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md index 658642cffe0..9599ebfb70e 100644 --- a/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md +++ b/docs/getting-into-the-code/guidelines-for-setting-up-a-local-workspace.md @@ -64,7 +64,7 @@ We recommend to install IntelliJ IDEA using [JetBrains Toolbox App](https://www. On Ubuntu Linux, you can follow the [documentation from the Ubuntu Community](https://help.ubuntu.com/community/EclipseIDE#Download_Eclipse) or the [step-by-step guideline from Krizna](https://www.krizna.com/ubuntu/install-eclipse-in-ubuntu-12-04/) to install Eclipse. On Windows, download it from [www.eclipse.org](http://www.eclipse.org/downloads/) and run the installer. -Eclipse JEE 2020-09 or newer is required. For Eclipse 2020-09 you need to install [Java 15 Support](https://marketplace.eclipse.org/content/java-15-support-eclipse-2020-09-417). +Eclipse JEE 2020-12 or newer is required. ### Other Tooling diff --git a/docs/readings-on-coding/javafx.md b/docs/readings-on-coding/javafx.md index b85c6f230b4..f3ce7981bc0 100644 --- a/docs/readings-on-coding/javafx.md +++ b/docs/readings-on-coding/javafx.md @@ -140,7 +140,6 @@ The view consists a FXML file `MyDialog.fxml` which defines the structure and th * [curated list of awesome JavaFX frameworks, libraries, books and etc...](https://github.com/mhrimaz/AwesomeJavaFX) * [ControlsFX](http://fxexperience.com/controlsfx/features/) amazing collection of controls -* [jIconFont](http://jiconfont.github.io/googlematerialdesignicons) or [fontawesomefx](https://bitbucket.org/Jerady/fontawesomefx/) * [Undo manager](https://github.com/FXMisc/UndoFX) * [Docking manager](https://github.com/alexbodogit/AnchorFX) [or](https://github.com/RobertBColton/DockFX) * [additional bindings](https://github.com/lestard/advanced-bindings) or [EasyBind](https://github.com/TomasMikula/EasyBind) @@ -149,9 +148,9 @@ The view consists a FXML file `MyDialog.fxml` which defines the structure and th * [mvvm framework](https://github.com/sialcasa/mvvmFX/wiki) * [CSS Reference](http://docs.oracle.com/javafx/2/api/javafx/scene/doc-files/cssref.html) * [JFoenix](https://github.com/jfoenixadmin/JFoenix) Material Designs look & feel -* [FontAwesomeFX](https://bitbucket.org/Jerady/fontawesomefx/overview): supports different icon fonts * [JavaFX Documentation project](https://fxdocs.github.io/docs/html5/index.html): Collected information on JavaFX in a central place * [FXExperience](http://fxexperience.com/) JavaFX Links of the week +* [Foojay](https://foojay.io/) Java and JavaFX tutorials ## Features missing in JavaFX diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 3619fe63b0c..f8eba5b2f48 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -15,8 +15,18 @@ requires afterburner.fx; requires com.jfoenix; requires de.saxsys.mvvmfx; - requires de.jensd.fx.fontawesomefx.commons; - requires de.jensd.fx.fontawesomefx.materialdesignicons; + + requires org.kordamp.ikonli.core; + requires org.kordamp.ikonli.javafx; + requires org.kordamp.ikonli.materialdesign2; + uses org.kordamp.ikonli.IkonHandler; + uses org.kordamp.ikonli.IkonProvider; + + provides org.kordamp.ikonli.IkonHandler + with org.jabref.gui.icon.JabRefIkonHandler; + provides org.kordamp.ikonli.IkonProvider + with org.jabref.gui.icon.JabrefIconProvider; + requires org.controlsfx.controls; requires org.fxmisc.richtext; requires com.tobiasdiez.easybind; diff --git a/src/main/java/org/jabref/gui/Base.css b/src/main/java/org/jabref/gui/Base.css index eacdf4815ac..9296ab3a7d8 100644 --- a/src/main/java/org/jabref/gui/Base.css +++ b/src/main/java/org/jabref/gui/Base.css @@ -1224,3 +1224,7 @@ TextFlow * { .mainTable-header { -fx-fill: -fx-mid-text-color; } + +.fontsizeSpinner{ + -fx-pref-width: 5em; +} diff --git a/src/main/java/org/jabref/gui/FXDialog.java b/src/main/java/org/jabref/gui/FXDialog.java index f1c93adbdee..7b485c24876 100644 --- a/src/main/java/org/jabref/gui/FXDialog.java +++ b/src/main/java/org/jabref/gui/FXDialog.java @@ -47,7 +47,7 @@ public FXDialog(AlertType type, String title) { public FXDialog(AlertType type, boolean isModal) { super(type); - setDialogIcon(IconTheme.getJabRefImageFX()); + setDialogIcon(IconTheme.getJabRefImage()); Stage dialogWindow = getDialogWindow(); dialogWindow.setOnCloseRequest(evt -> this.close()); diff --git a/src/main/java/org/jabref/gui/JabRefDialogService.java b/src/main/java/org/jabref/gui/JabRefDialogService.java index ca88c9c7914..a3bf7ea74f0 100644 --- a/src/main/java/org/jabref/gui/JabRefDialogService.java +++ b/src/main/java/org/jabref/gui/JabRefDialogService.java @@ -133,7 +133,7 @@ public static String shortenDialogMessage(String dialogMessage) { @Override public Optional showChoiceDialogAndWait(String title, String content, String okButtonLabel, T defaultChoice, Collection choices) { ChoiceDialog choiceDialog = new ChoiceDialog<>(defaultChoice, choices); - ((Stage) choiceDialog.getDialogPane().getScene().getWindow()).getIcons().add(IconTheme.getJabRefImageFX()); + ((Stage) choiceDialog.getDialogPane().getScene().getWindow()).getIcons().add(IconTheme.getJabRefImage()); ButtonType okButtonType = new ButtonType(okButtonLabel, ButtonBar.ButtonData.OK_DONE); choiceDialog.getDialogPane().getButtonTypes().setAll(ButtonType.CANCEL, okButtonType); choiceDialog.setHeaderText(title); @@ -287,7 +287,7 @@ public void showProgressDialog(String title, String content, Task task) { progressDialog.setTitle(title); progressDialog.setContentText(content); progressDialog.setGraphic(null); - ((Stage) progressDialog.getDialogPane().getScene().getWindow()).getIcons().add(IconTheme.getJabRefImageFX()); + ((Stage) progressDialog.getDialogPane().getScene().getWindow()).getIcons().add(IconTheme.getJabRefImage()); progressDialog.setOnCloseRequest(evt -> task.cancel()); DialogPane dialogPane = progressDialog.getDialogPane(); dialogPane.getButtonTypes().add(ButtonType.CANCEL); diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 154efbc6aa4..ab97e04e22d 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -17,6 +17,7 @@ import javafx.beans.binding.StringBinding; import javafx.beans.value.ChangeListener; import javafx.beans.value.ObservableValue; +import javafx.collections.transformation.FilteredList; import javafx.concurrent.Task; import javafx.geometry.Orientation; import javafx.scene.Group; @@ -60,7 +61,6 @@ import org.jabref.gui.contentselector.ManageContentSelectorAction; import org.jabref.gui.copyfiles.CopyFilesAction; import org.jabref.gui.customentrytypes.CustomizeEntryAction; -import org.jabref.gui.customizefields.SetupGeneralFieldsAction; import org.jabref.gui.desktop.JabRefDesktop; import org.jabref.gui.dialogs.AutosaveUiManager; import org.jabref.gui.documentviewer.ShowDocumentViewerAction; @@ -75,7 +75,6 @@ import org.jabref.gui.entryeditor.PreviewSwitchAction; import org.jabref.gui.exporter.ExportCommand; import org.jabref.gui.exporter.ExportToClipboardAction; -import org.jabref.gui.exporter.ManageCustomExportsAction; import org.jabref.gui.exporter.SaveAction; import org.jabref.gui.exporter.SaveAllAction; import org.jabref.gui.exporter.SaveDatabaseAction; @@ -90,15 +89,12 @@ import org.jabref.gui.help.SearchForUpdateAction; import org.jabref.gui.importer.ImportCommand; import org.jabref.gui.importer.ImportEntriesDialog; -import org.jabref.gui.importer.ManageCustomImportsAction; import org.jabref.gui.importer.NewDatabaseAction; import org.jabref.gui.importer.NewEntryAction; import org.jabref.gui.importer.actions.OpenDatabaseAction; import org.jabref.gui.importer.fetcher.LookupIdentifierAction; import org.jabref.gui.integrity.IntegrityCheckAction; import org.jabref.gui.journals.AbbreviateAction; -import org.jabref.gui.journals.ManageJournalsAction; -import org.jabref.gui.keyboard.CustomizeKeyBindingAction; import org.jabref.gui.keyboard.KeyBinding; import org.jabref.gui.keyboard.KeyBindingRepository; import org.jabref.gui.libraryproperties.LibraryPropertiesAction; @@ -108,7 +104,6 @@ import org.jabref.gui.metadata.PreambleEditor; import org.jabref.gui.preferences.ShowPreferencesAction; import org.jabref.gui.preview.CopyCitationAction; -import org.jabref.gui.protectedterms.ManageProtectedTermsAction; import org.jabref.gui.push.PushToApplicationAction; import org.jabref.gui.push.PushToApplicationsManager; import org.jabref.gui.search.GlobalSearchBar; @@ -579,14 +574,17 @@ public void init() { initDragAndDrop(); // Bind global state + FilteredList filteredTabs = new FilteredList<>(tabbedPane.getTabs()); + filteredTabs.setPredicate(tab -> tab instanceof LibraryTab); // This variable cannot be inlined, since otherwise the list created by EasyBind is being garbage collected - openDatabaseList = EasyBind.map(tabbedPane.getTabs(), tab -> ((LibraryTab) tab).getBibDatabaseContext()); + openDatabaseList = EasyBind.map(filteredTabs, tab -> ((LibraryTab) tab).getBibDatabaseContext()); EasyBind.bindContent(stateManager.getOpenDatabases(), openDatabaseList); stateManager.activeDatabaseProperty().bind( EasyBind.map(tabbedPane.getSelectionModel().selectedItemProperty(), selectedTab -> Optional.ofNullable(selectedTab) + .filter(tab -> tab instanceof LibraryTab) .map(tab -> (LibraryTab) tab) .map(LibraryTab::getBibDatabaseContext))); @@ -607,7 +605,7 @@ public void init() { * cut/paste/copy operations would some times occur in the wrong tab. */ EasyBind.subscribe(tabbedPane.getSelectionModel().selectedItemProperty(), tab -> { - if (tab == null) { + if ((tab == null) || (!(tab instanceof LibraryTab))) { stateManager.setSelectedEntries(Collections.emptyList()); mainStage.titleProperty().unbind(); mainStage.setTitle(FRAME_TITLE); @@ -829,41 +827,28 @@ private MenuBar createMenu() { SidePaneComponent groups = sidePaneManager.getComponent(SidePaneType.GROUPS); SidePaneComponent openOffice = sidePaneManager.getComponent(SidePaneType.OPEN_OFFICE); - view.getItems().add(new SeparatorMenuItem()); - view.setOnShowing(event -> { - view.getItems().clear(); - view.getItems().addAll( - factory.createCheckMenuItem(webSearch.getToggleAction(), webSearch.getToggleCommand(), sidePaneManager.isComponentVisible(SidePaneType.WEB_SEARCH)), - factory.createCheckMenuItem(groups.getToggleAction(), groups.getToggleCommand(), sidePaneManager.isComponentVisible(SidePaneType.GROUPS)), - factory.createCheckMenuItem(openOffice.getToggleAction(), openOffice.getToggleCommand(), sidePaneManager.isComponentVisible(SidePaneType.OPEN_OFFICE)), + view.getItems().addAll( + factory.createCheckMenuItem(webSearch.getToggleAction(), webSearch.getToggleCommand(), sidePaneManager.isComponentVisible(SidePaneType.WEB_SEARCH)), + factory.createCheckMenuItem(groups.getToggleAction(), groups.getToggleCommand(), sidePaneManager.isComponentVisible(SidePaneType.GROUPS)), + factory.createCheckMenuItem(openOffice.getToggleAction(), openOffice.getToggleCommand(), sidePaneManager.isComponentVisible(SidePaneType.OPEN_OFFICE)), - new SeparatorMenuItem(), + new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.NEXT_PREVIEW_STYLE, new PreviewSwitchAction(PreviewSwitchAction.Direction.NEXT, this, stateManager)), - factory.createMenuItem(StandardActions.PREVIOUS_PREVIEW_STYLE, new PreviewSwitchAction(PreviewSwitchAction.Direction.PREVIOUS, this, stateManager)), + factory.createMenuItem(StandardActions.NEXT_PREVIEW_STYLE, new PreviewSwitchAction(PreviewSwitchAction.Direction.NEXT, this, stateManager)), + factory.createMenuItem(StandardActions.PREVIOUS_PREVIEW_STYLE, new PreviewSwitchAction(PreviewSwitchAction.Direction.PREVIOUS, this, stateManager)), - new SeparatorMenuItem(), + new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.SHOW_PDF_VIEWER, new ShowDocumentViewerAction(stateManager, prefs)), - factory.createMenuItem(StandardActions.EDIT_ENTRY, new OpenEntryEditorAction(this, stateManager)), - factory.createMenuItem(StandardActions.OPEN_CONSOLE, new OpenConsoleAction(stateManager)) - ); - }); + factory.createMenuItem(StandardActions.SHOW_PDF_VIEWER, new ShowDocumentViewerAction(stateManager, prefs)), + factory.createMenuItem(StandardActions.EDIT_ENTRY, new OpenEntryEditorAction(this, stateManager)), + factory.createMenuItem(StandardActions.OPEN_CONSOLE, new OpenConsoleAction(stateManager)) + ); options.getItems().addAll( factory.createMenuItem(StandardActions.SHOW_PREFS, new ShowPreferencesAction(this, Globals.TASK_EXECUTOR)), new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.SETUP_GENERAL_FIELDS, new SetupGeneralFieldsAction()), - factory.createMenuItem(StandardActions.MANAGE_CUSTOM_IMPORTS, new ManageCustomImportsAction()), - factory.createMenuItem(StandardActions.MANAGE_CUSTOM_EXPORTS, new ManageCustomExportsAction()), - factory.createMenuItem(StandardActions.MANAGE_JOURNALS, new ManageJournalsAction()), - factory.createMenuItem(StandardActions.CUSTOMIZE_KEYBINDING, new CustomizeKeyBindingAction()), - factory.createMenuItem(StandardActions.MANAGE_PROTECTED_TERMS, new ManageProtectedTermsAction()), - - new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.MANAGE_CONTENT_SELECTORS, new ManageContentSelectorAction(this, stateManager)), factory.createMenuItem(StandardActions.CUSTOMIZE_ENTRY_TYPES, new CustomizeEntryAction(stateManager, Globals.entryTypesManager)) ); diff --git a/src/main/java/org/jabref/gui/JabRefGUI.java b/src/main/java/org/jabref/gui/JabRefGUI.java index bf6dce8c2fe..f1dfdbc7006 100644 --- a/src/main/java/org/jabref/gui/JabRefGUI.java +++ b/src/main/java/org/jabref/gui/JabRefGUI.java @@ -57,7 +57,6 @@ public JabRefGUI(Stage mainStage, List databases, boolean isBlank) } private void openWindow(Stage mainStage) { - IconTheme.loadFonts(); LOGGER.debug("Initializing frame"); mainFrame.init(); diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index 0aec18fde81..88648beff2b 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -184,6 +184,7 @@ public void onDatabaseLoadingSucceed(ParserResult result) { Globals.stateManager.activeDatabaseProperty().bind( EasyBind.map(frame.getTabbedPane().getSelectionModel().selectedItemProperty(), selectedTab -> Optional.ofNullable(selectedTab) + .filter(tab -> tab instanceof LibraryTab) .map(tab -> (LibraryTab) tab) .map(LibraryTab::getBibDatabaseContext))); } diff --git a/src/main/java/org/jabref/gui/actions/StandardActions.java b/src/main/java/org/jabref/gui/actions/StandardActions.java index 70ae5642647..7687ce82990 100644 --- a/src/main/java/org/jabref/gui/actions/StandardActions.java +++ b/src/main/java/org/jabref/gui/actions/StandardActions.java @@ -127,7 +127,7 @@ public enum StandardActions implements Action { EDIT_STRINGS(Localization.lang("Edit string constants"), IconTheme.JabRefIcons.EDIT_STRINGS, KeyBinding.EDIT_STRINGS), FIND_DUPLICATES(Localization.lang("Find duplicates"), IconTheme.JabRefIcons.FIND_DUPLICATES), - MERGE_ENTRIES(Localization.lang("Merge entries"), IconTheme.JabRefIcons.MERGE_ENTRIES), + MERGE_ENTRIES(Localization.lang("Merge entries"), IconTheme.JabRefIcons.MERGE_ENTRIES, KeyBinding.MERGE_ENTRIES), RESOLVE_DUPLICATE_KEYS(Localization.lang("Resolve duplicate citation keys"), Localization.lang("Find and remove duplicate citation keys"), KeyBinding.RESOLVE_DUPLICATE_CITATION_KEYS), CHECK_INTEGRITY(Localization.lang("Check integrity"), KeyBinding.CHECK_INTEGRITY), FIND_UNLINKED_FILES(Localization.lang("Search for unlinked local files"), IconTheme.JabRefIcons.SEARCH, KeyBinding.FIND_UNLINKED_FILES), diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.java b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.java index ac61606744c..4d004e980c3 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.java @@ -2,6 +2,8 @@ import java.util.Collection; +import javax.inject.Inject; + import javafx.beans.property.ListProperty; import javafx.beans.property.ObjectProperty; import javafx.fxml.FXML; @@ -27,16 +29,16 @@ public class CitationKeyPatternPanel extends TableView patternColumn; @FXML public TableColumn actionsColumn; + @Inject private PreferencesService preferences; + private CitationKeyPatternPanelViewModel viewModel; private long lastKeyPressTime; private String tableSearchTerm; - public CitationKeyPatternPanel(PreferencesService preferences, Collection entryTypeList, AbstractCitationKeyPattern keyPattern) { + public CitationKeyPatternPanel() { super(); - viewModel = new CitationKeyPatternPanelViewModel(preferences, entryTypeList, keyPattern); - ViewLoader.view(this) .root(this) .load(); @@ -44,6 +46,8 @@ public CitationKeyPatternPanel(PreferencesService preferences, Collection entryTypeList, AbstractCitationKeyPattern keyPattern) { + viewModel.setValues(entryTypeList, keyPattern); } public void resetAll() { diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelViewModel.java b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelViewModel.java index fa3a1978b29..95416561b23 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelViewModel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanelViewModel.java @@ -36,17 +36,14 @@ public class CitationKeyPatternPanelViewModel { private final ListProperty patternListProperty = new SimpleListProperty<>(); private final ObjectProperty defaultItemProperty = new SimpleObjectProperty<>(); - private final AbstractCitationKeyPattern initialKeyPattern; - private final Collection bibEntryTypeList; + private final PreferencesService preferences; - public CitationKeyPatternPanelViewModel(PreferencesService preferences, Collection entryTypeList, AbstractCitationKeyPattern initialKeyPattern) { + public CitationKeyPatternPanelViewModel(PreferencesService preferences) { this.preferences = preferences; - this.bibEntryTypeList = entryTypeList; - this.initialKeyPattern = initialKeyPattern; } - public void setValues() { + public void setValues(Collection entryTypeList, AbstractCitationKeyPattern initialKeyPattern) { String defaultPattern; if ((initialKeyPattern.getDefaultValue() == null) || initialKeyPattern.getDefaultValue().isEmpty()) { defaultPattern = ""; @@ -58,17 +55,17 @@ public void setValues() { patternListProperty.setValue(FXCollections.observableArrayList()); patternListProperty.add(defaultItemProperty.getValue()); - bibEntryTypeList.stream() - .map(BibEntryType::getType) - .forEach(entryType -> { - String pattern; - if (initialKeyPattern.isDefaultValue(entryType)) { - pattern = ""; - } else { - pattern = initialKeyPattern.getPatterns().get(entryType).get(0); - } - patternListProperty.add(new CitationKeyPatternPanelItemModel(entryType, pattern)); - }); + entryTypeList.stream() + .map(BibEntryType::getType) + .forEach(entryType -> { + String pattern; + if (initialKeyPattern.isDefaultValue(entryType)) { + pattern = ""; + } else { + pattern = initialKeyPattern.getPatterns().get(entryType).get(0); + } + patternListProperty.add(new CitationKeyPatternPanelItemModel(entryType, pattern)); + }); } public void setItemToDefaultPattern(CitationKeyPatternPanelItemModel item) { diff --git a/src/main/java/org/jabref/gui/contentselector/ContentSelectorDialogViewModel.java b/src/main/java/org/jabref/gui/contentselector/ContentSelectorDialogViewModel.java index d83a4de4469..fa8e5b00787 100644 --- a/src/main/java/org/jabref/gui/contentselector/ContentSelectorDialogViewModel.java +++ b/src/main/java/org/jabref/gui/contentselector/ContentSelectorDialogViewModel.java @@ -2,6 +2,7 @@ import java.util.ArrayList; import java.util.Arrays; +import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -153,8 +154,8 @@ private void addKeywordIfUnique(Field field, String keywordToAdd) { List existingKeywords = fieldKeywordsMap.getOrDefault(field, new ArrayList<>()); existingKeywords.add(keywordToAdd); + existingKeywords.sort(Comparator.naturalOrder()); fieldKeywordsMap.put(field, existingKeywords); - keywords.add(keywordToAdd); populateKeywords(field); } diff --git a/src/main/java/org/jabref/gui/customizefields/CustomizeGeneralFieldsDialog.fxml b/src/main/java/org/jabref/gui/customizefields/CustomizeGeneralFieldsDialog.fxml deleted file mode 100644 index fe006e915c4..00000000000 --- a/src/main/java/org/jabref/gui/customizefields/CustomizeGeneralFieldsDialog.fxml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - -