diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000000..498a52431af --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,38 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/java +{ + "name": "Java", + "image": "mcr.microsoft.com/vscode/devcontainers/base:bullseye", + + // Configure tool-specific properties. + "customizations": { + // Configure properties specific to VS Code. + "vscode": { + // Set *default* container specific settings.json values on container create. + "settings": { + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "vscjava.vscode-java-pack" + ] + } + }, + + "onCreateCommand": "gradle assemble", + + // Need to connect as root otherwise we run into issues with gradle. + // default option is "vscode". More info: https://aka.ms/vscode-remote/containers/non-root. + "remoteUser": "root", + "features": { + // Adds a lightweight desktop that can be accessed using a VNC viewer or the web + "desktop-lite": "latest", + + // Install java + "java": { + "version": "18", + "installGradle": true, + "jdkDistro": "sem" + } + } +} diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 9783e2a9aaa..807af23a0ae 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -9,7 +9,7 @@ jobs: steps: - name: 'Wait for status checks' id: waitforstatuschecks - uses: "WyriHaximus/github-action-wait-for-status@v1.6" + uses: "WyriHaximus/github-action-wait-for-status@v1.7.1" with: ignoreActions: Automerge Dependabot,Code coverage,Create snapcraft image,Deploy binaries on builds.jabref.org,codecov/project,markdown-link-check checkInterval: 13 diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 121fb51d795..de3c8f2b508 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -130,7 +130,7 @@ jobs: get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "${{ steps.gitversion.outputs.AssemblySemVer }}","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}"} get-childitem -Path build/distribution/* | rename-item -NewName {$_.name -replace "portable","${{ steps.gitversion.outputs.Major }}.${{ steps.gitversion.outputs.Minor }}-portable"} - name: Upload to GitHub workflow artifacts store - uses: actions/upload-artifact@master + uses: actions/upload-artifact@v3 with: name: JabRef-${{ matrix.displayName }} path: build/distribution diff --git a/.github/workflows/gource.yml b/.github/workflows/gource.yml index 253ef9702a8..48c9e55d1e7 100644 --- a/.github/workflows/gource.yml +++ b/.github/workflows/gource.yml @@ -49,7 +49,7 @@ jobs: run: | mv gource/gource.mp4 gource-videos/jabref-complete.mp4 - name: 'Upload gource video' - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: Gource path: ./gource-videos/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e4cfe3ac8a..09770b0aa12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve ### Changed +- Genres are now mapped correctly to entry types when importing MODS files. [#9185](https://github.com/JabRef/jabref/issues/9185) - We improved the Citavi Importer to also import so called Knowledge-items into the field `comment` of the corresponding entry [#9025](https://github.com/JabRef/jabref/issues/9025) - We removed wrapping of string constants when writing to a `.bib` file. - We call backup files `.bak` and temporary writing files now `.sav`. @@ -33,10 +34,11 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - The global default directory for storing PDFs is now the subdirectory "JabRef" in the user's home. - We reworked the Define study parameters dialog. [#9123](https://github.com/JabRef/jabref/pull/9123) - We simplified the actions to fast-resolve duplicates to 'Keep Left', 'Keep Right', 'Keep Both' and 'Keep Merged'. [#9056](https://github.com/JabRef/jabref/issues/9056) - +- We fixed an issue where a message about changed metadata would occur on saving although nothing changed. [#9159](https://github.com/JabRef/jabref/issues/9159) ### Fixed +- We fixed the display of the "Customize Entry Types" dialogue title [#9198](https://github.com/JabRef/jabref/issues/9198) - We fixed an issue where author names with tilde accents (for example ñ) were marked as "Names are not in the standard BibTex format" [#8071](https://github.com/JabRef/jabref/issues/8071) - We fixed an issue where the possibility to generate a subdatabase from an aux file was writing empty files when called from the commandline [#9115](https://github.com/JabRef/jabref/issues/9115), [forum#3516](https://discourse.jabref.org/t/export-subdatabase-from-aux-file-on-macos-command-line/3516) - We fixed the display of issue, number, eid and pages fields in the entry preview. [#8607](https://github.com/JabRef/jabref/pull/8607), [#8372](https://github.com/JabRef/jabref/issues/8372), [Koppor#514](https://github.com/koppor/jabref/issues/514), [forum#2390](https://discourse.jabref.org/t/unable-to-edit-my-bibtex-file-that-i-used-before-vers-5-1/2390), [forum#3462](https://discourse.jabref.org/t/jabref-5-6-need-help-with-export-from-jabref-to-microsoft-word-entry-preview-of-apa-7-not-rendering-correctly/3462) @@ -52,6 +54,8 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where JabRef would not exit when a connection to a LibreOffice document was established previously and the document is still open. [#9075](https://github.com/JabRef/jabref/issues/9075) - We fixed an issue about selecting the save order in the preferences. [#9175](https://github.com/JabRef/jabref/issues/9147) - We fixed an issue where the CSS styles are missing in some dialogs. [#9150](https://github.com/JabRef/jabref/pull/9150) +- We fixed an issue where pdfs were re-indexed on each startup. [#9166](https://github.com/JabRef/jabref/pull/9166) +- We fixed an issue where Capitalize didn't capitalize words after hyphen characters. [#9157](https://github.com/JabRef/jabref/issues/9157) ### Removed diff --git a/build.gradle b/build.gradle index 659d362f4ba..7c4576b1e1b 100644 --- a/build.gradle +++ b/build.gradle @@ -132,8 +132,8 @@ dependencies { implementation 'commons-cli:commons-cli:1.5.0' - implementation 'org.libreoffice:libreoffice:7.4.0' - implementation 'org.libreoffice:unoloader:7.4.0' + implementation 'org.libreoffice:libreoffice:7.4.1' + implementation 'org.libreoffice:unoloader:7.4.1' implementation 'io.github.java-diff-utils:java-diff-utils:4.12' implementation 'info.debatty:java-string-similarity:2.0.0' @@ -160,9 +160,11 @@ dependencies { exclude module: "jsr305" } - implementation group: 'jakarta.annotation', name: 'jakarta.annotation-api', version: '1.3.5' + implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1' + implementation 'jakarta.inject:jakarta.inject-api:2.0.1' - // JavaFX stuff + + implementation 'com.github.JabRef:afterburner.fx:testmoduleinfo-SNAPSHOT' implementation 'org.kordamp.ikonli:ikonli-javafx:12.3.1' implementation 'org.kordamp.ikonli:ikonli-materialdesign2-pack:12.3.1' implementation 'com.github.sialcasa.mvvmFX:mvvmfx-validation:f195849ca9' //jitpack @@ -170,14 +172,13 @@ dependencies { implementation 'com.tobiasdiez:easybind:2.2.1-SNAPSHOT' implementation 'org.fxmisc.flowless:flowless:0.6.10' implementation 'org.fxmisc.richtext:richtextfx:0.10.9' - 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.1.1' implementation 'org.jsoup:jsoup:1.15.3' implementation 'com.konghq:unirest-java:3.13.11' - implementation 'org.slf4j:slf4j-api:2.0.0' + implementation 'org.slf4j:slf4j-api:2.0.3' implementation "org.tinylog:tinylog-api:2.5.0" implementation "org.tinylog:slf4j-tinylog:2.5.0" implementation "org.tinylog:tinylog-impl:2.5.0" @@ -204,8 +205,8 @@ dependencies { implementation group: 'net.harawata', name: 'appdirs', version: '1.2.1' testImplementation 'io.github.classgraph:classgraph:4.8.149' - testImplementation 'org.junit.jupiter:junit-jupiter:5.9.0' - testImplementation 'org.junit.platform:junit-platform-launcher:1.9.0' + testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1' + testImplementation 'org.junit.platform:junit-platform-launcher:1.9.1' testImplementation 'org.mockito:mockito-core:4.8.0' testImplementation 'org.xmlunit:xmlunit-core:2.9.0' @@ -216,7 +217,7 @@ dependencies { testImplementation "org.testfx:testfx-junit5:4.0.16-alpha" testImplementation "org.hamcrest:hamcrest-library:2.2" - checkstyle 'com.puppycrawl.tools:checkstyle:10.3.3' + checkstyle 'com.puppycrawl.tools:checkstyle:10.3.4' // xjc needs the runtime as well for the ant task, otherwise it fails xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '3.0.2' xjc group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '3.0.2' @@ -560,7 +561,6 @@ jlink { requires 'java.transaction.xa' requires 'java.rmi' requires 'java.xml' - requires 'jdk.jfr' requires 'jdk.jsobject' requires 'jdk.unsupported' requires 'jdk.unsupported.desktop' @@ -569,8 +569,6 @@ jlink { requires 'com.google.gson' requires 'org.slf4j' requires 'jakarta.xml.bind' - uses 'com.airhacks.afterburner.views.ResourceLocator' - uses 'com.airhacks.afterburner.injection.PresenterFactory' uses 'org.mariadb.jdbc.credential.CredentialPlugin' uses 'org.mariadb.jdbc.authentication.AuthenticationPlugin' uses 'org.mariadb.jdbc.tls.TlsSocketPlugin' diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index a8c68783372..3e9f9aa812c 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -8,7 +8,7 @@ repositories { dependencies { implementation 'com.h2database:h2-mvstore:2.1.214' implementation 'org.apache.commons:commons-csv:1.9.0' - implementation 'org.slf4j:slf4j-api:2.0.0' + implementation 'org.slf4j:slf4j-api:2.0.3' } sourceSets{ diff --git a/buildres/csl/csl-locales/.github/workflows/label-gun.yml b/buildres/csl/csl-locales/.github/workflows/label-gun.yml index d4d022673f8..c87c1721b75 100644 --- a/buildres/csl/csl-locales/.github/workflows/label-gun.yml +++ b/buildres/csl/csl-locales/.github/workflows/label-gun.yml @@ -6,8 +6,13 @@ on: issue_comment: types: [created, edited, closed] +permissions: {} jobs: label: + permissions: + issues: write # to add label to an issues (retorquere/label-gun) + pull-requests: write # to add label, comment on pull request (retorquere/label-gun) + runs-on: ubuntu-latest steps: - uses: retorquere/label-gun@main diff --git a/buildres/csl/csl-locales/.github/workflows/merge.yaml b/buildres/csl/csl-locales/.github/workflows/merge.yaml index f52a6ba4110..c1efb7eab07 100644 --- a/buildres/csl/csl-locales/.github/workflows/merge.yaml +++ b/buildres/csl/csl-locales/.github/workflows/merge.yaml @@ -12,8 +12,13 @@ on: description: Commit message required: true +permissions: {} jobs: release: + permissions: + contents: write # to create a release + pull-requests: read # to read pull requests (dorny/paths-filter) + runs-on: ubuntu-latest env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/buildres/csl/csl-locales/.github/workflows/sheldon.yaml b/buildres/csl/csl-locales/.github/workflows/sheldon.yaml index 9bf525949f1..42962c95090 100644 --- a/buildres/csl/csl-locales/.github/workflows/sheldon.yaml +++ b/buildres/csl/csl-locales/.github/workflows/sheldon.yaml @@ -4,8 +4,13 @@ on: pull_request_target: types: [ opened, synchronize, workflow_dispatch] +permissions: {} jobs: test: + permissions: + contents: write # to push code in repo (stefanzweifel/git-auto-commit-action) + pull-requests: write # to comment on pull requests + runs-on: ubuntu-latest env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/buildres/csl/csl-locales/locales-it-IT.xml b/buildres/csl/csl-locales/locales-it-IT.xml index d01bf61c208..2822e365c30 100644 --- a/buildres/csl/csl-locales/locales-it-IT.xml +++ b/buildres/csl/csl-locales/locales-it-IT.xml @@ -2,13 +2,11 @@ - FI App Development - - - Monica Thuegaz + Filippo Vomiero + filippo.vomiero@unipd.it This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License - 2012-07-04T23:31:02+00:00 + 2022-07-07T17:56:02+01:00 @@ -24,31 +22,31 @@ advance online publication album - audio recording + registrazione audio film - henceforth + d'ora in poi loc. cit. - no place - n.p. - no publisher - n.p. - on + sine loco + s.l. + sine nomine + s.n. + su op. cit. - original work published + opera originale pubblicata comunicazione personale podcast - podcast episode + episodio di podcast preprint - radio broadcast - radio series - radio series episode - special issue - special section - television broadcast - television series - television series episode + trasmissione radiofonica + serie radiofonica + episodio di serie radiofonica + edizione speciale + sezione speciale + trasmissione televisiva + serie televisiva + episodio di serie televisiva video - working paper + documento di lavoro consultato e e altri @@ -77,17 +75,17 @@ internet intervista lettera - senza data + sine data s.d. online presentato al - reference - references + riferimento + riferimenti - ref. - refs. + rif. + rif. recuperato scala @@ -95,67 +93,67 @@ preprint - journal article - magazine article - newspaper article - bill - book + articolo di rivista + articolo di rivista generalista + articolo di giornale + proposta di legge + libro broadcast - book chapter - classic - collection + capitolo di libro + classico + collezione dataset - document - entry - dictionary entry - encyclopedia entry - event + documento + voce + voce di dizionario + voce di enciclopedia + evento - graphic - hearing - interview - legal case - legislation - manuscript - map - video recording - musical score - pamphlet - conference paper - patent - performance - periodical + opera d'arte + udienza + intervista + causa + legislazione + manoscritto + mappa + film + spartito musicale + opuscolo + atto di convegno + brevetto + esecuzione + periodico comunicazione personale - post - blog post - regulation + messaggio + messaggio di blog + decreto report review - book review + recensione di libro software - audio recording - presentation - standard - thesis - treaty - webpage + registrazione audio + presentazione + norma + tesi + trattato + pagina web - journal art. - mag. art. - newspaper art. - bk. - bk. chap. + art. di riv. + art. di riv + art. di g. + l. + c. di l. doc. - graph. + op. d'arte interv. - MS - video rec. + ms. + film rep. rev. - bk. rev. - audio rec. + rec. di l. + reg. audio d.C. @@ -212,48 +210,48 @@ - act - acts + atto + atto - appendix - appendices + appendice + appendici - article - articles + articolo + articoli - canon - canons + canone + canoni - location - locations + indirizzo + indirizzi - equation - equations + equazione + equazioni - rule - rules + regola + regole - scene - scenes + scena + scene - table - tables + tavola + tavole - title - titles + titolo + titoli libro @@ -276,8 +274,8 @@ fogli - numero - numeri + fascicolo + fascicoli riga @@ -300,16 +298,16 @@ pagine - capoverso - capoversi + paragrafo + paragrafi parte parti - paragrafo - paragrafi + sezione + sezioni sub verbo @@ -327,11 +325,11 @@ app. - apps. + app. art. - arts. + art. loc. @@ -339,19 +337,19 @@ eq. - eqs. + eq. r. - rr. + r. sc. - scs. + sc. - tbl. - tbls. + tab. + tab. @@ -369,21 +367,21 @@ col. fig. fgl. - n. - l. + fasc. + r. n. op. - pag. - pagg. + p. + pp. - pag. - pagg. + p. + pp. - cpv. + par. pt. - par. + sez. s.v. s.vv. @@ -409,68 +407,68 @@ - chair - chairs + presidente + presidenti - compiler - compilers + compilatore + compilatori - contributor - contributors + collaboratore + collaboratori - curator - curators + curatore + curatori - executive producer - executive producers + produttore esecutivo + produttori esecutivi - guest - guests + ospite + ospiti - host - hosts + conduttore + conduttori - narrator - narrators + narratore + narratori - organizer - organizers + organizzatore + organizzatori - performer - performers + esecutore + esecutori - producer - producers + produttore + produttori - writer - writers + sceneggiatore + sceneggiatori - series creator - series creators + autore della serie + autori della serie - director - directors + regista + registi curatore curatori - editor - editors + direttore editoriale + direttori editoriali illustratore @@ -488,55 +486,55 @@ comp. - comps. + comp. - contrib. - contribs. + collab. + collab. cur. - curs. + cur. - exec. prod. - exec. prods. + prod.es. + prod. es. narr. - narrs. + narr. org. - orgs. + org. - perf. - perfs. + esec. + esec. prod. - prods. + prod. - writ. - writs. + scen. + scen. - cre. - cres. + aut. d. serie + aut. d. serie - dir. - dir. + reg. + reg. a c. di a c. di - ed. - ed. + dir. ed. + dir. ed. ill. @@ -547,28 +545,28 @@ trad. - a c. di e trad. da - a c. di e trad. da + cur. e trad. + cur. e trad. - chaired by - compiled by - with - curated by - executive produced by - with guest - hosted by - narrated by - organized by - performed by - produced by - written by - created by + presieduto da + compilato da + con un contributo di + a cura di + produzione esecutiva di + con ospite + condotto da + narrato da + organizzato da + esecuzione di + prodotto da + scritto da + creato da di diretto da a cura di - edited by + direzione editoriale di illustrato da intervista di a @@ -577,21 +575,21 @@ a cura di e tradotto da - comp. by - w. - cur. by - exec. prod. by - w. guest - hosted by - narr. by - org. by - perf. by - prod. by - writ. by - cre. by + comp. da + con un contrib. di + a c. di + prod. esec. di + con osp. + cond. da + narr. da + org. da + esec. di + prod. da + scr. da + cre. da dir. da a c. di - ed. + dir. ed. di ill. da trad. da a c. di e trad. da diff --git a/buildres/csl/csl-locales/locales-nb-NO.xml b/buildres/csl/csl-locales/locales-nb-NO.xml index 19cb91d410a..f83cfb581e0 100644 --- a/buildres/csl/csl-locales/locales-nb-NO.xml +++ b/buildres/csl/csl-locales/locales-nb-NO.xml @@ -152,10 +152,10 @@ audio rec. - fvt. - evt. - BCE - CE + e.Kr. + f.Kr. + fvt. + evt. « diff --git a/buildres/csl/csl-locales/locales-nn-NO.xml b/buildres/csl/csl-locales/locales-nn-NO.xml index f48e7b07d76..a91cb07825e 100644 --- a/buildres/csl/csl-locales/locales-nn-NO.xml +++ b/buildres/csl/csl-locales/locales-nn-NO.xml @@ -152,10 +152,10 @@ audio rec. - fvt. - evt. - BCE - CE + e.Kr. + f.Kr. + fvt. + evt. « diff --git a/buildres/csl/csl-locales/locales-pt-PT.xml b/buildres/csl/csl-locales/locales-pt-PT.xml index 48fbb4ee04c..929bd481b7b 100644 --- a/buildres/csl/csl-locales/locales-pt-PT.xml +++ b/buildres/csl/csl-locales/locales-pt-PT.xml @@ -21,30 +21,30 @@ advance online publication album - audio recording - film + gravação áudio + filme henceforth loc. cit. - no place - n.p. - no publisher - n.p. - on + sem local + s.l. + sem editor + s.e. + em op. cit. - original work published + trabalho original publicado comunicação pessoal podcast - podcast episode - preprint - radio broadcast - radio series + episódio podcast + pré-impressão + transmissão de rádio + série de rádio radio series episode special issue special section - television broadcast + transmissão televisiva television series television series episode - video + vídeo working paper acedido e @@ -84,54 +84,54 @@ refs. obtido - scale + escala versão - preprint - journal article - magazine article - newspaper article + pré-impressão + article journal + artigo de revista + artigo de jornal bill - book - broadcast - book chapter - classic - collection + livro + transmissão + capítulo de livro + clássico + coleção dataset - document + documento entry - dictionary entry - encyclopedia entry - event + entrada de dicionário + entrada de enciclopédia + evento - graphic - hearing - interview + gráfico + audiência + entrevista legal case - legislation - manuscript - map - video recording + legislação + manuscrito + mapa + gravação de vídeo musical score - pamphlet + panfleto conference paper - patent + patente performance - periodical + periódico comunicação pessoal post blog post - regulation - report + regulamento + relatório review book review software - audio recording - presentation - standard - thesis - treaty + gravação áudio + discurso + padrão + tése + tratado webpage @@ -142,20 +142,20 @@ bk. chap. doc. - graph. - interv. + gráf. + entrev. MS - video rec. - rep. + transm. vídeo + rel. rev. bk. rev. - audio rec. + grav. áudio AD - BC - BCE - CE + AC + AEC + EC « @@ -195,48 +195,48 @@ - act - acts + ata + atas - appendix - appendices + apêndice + apêndices - article - articles + artigo + artigos canon canons - location - locations + localização + localizações - equation - equations + equação + equações - rule - rules + regra + regras - scene - scenes + cena + cenas - table - tables + tabela + tabelas - title - titles + título + títulos livro @@ -341,15 +341,15 @@ - tit. - tits. + tít. + títs. liv. cap. col. fig. f. - n. + n.º l. n. op. @@ -389,68 +389,68 @@ - chair - chairs + cadeira + cadeiras - compiler - compilers + compilador + compiladores - contributor - contributors + contribuinte + contribuintes - curator - curators + curador + curadores - executive producer - executive producers + produtor executivo + produtores executivos - guest - guests + convidado + convidados - host - hosts + anfitrião + anfitriões - narrator - narrators + narrador + narradores - organizer - organizers + organizador + organizadores - performer - performers + ator + atores - producer - producers + produtor + produtores - writer - writers + escritor + escritores - series creator - series creators + criador de séries + criadores de séries - director - directores + diretor + diretores editor editores - editor - editores + diretor editorial + diretores editoriais ilustrador @@ -461,8 +461,8 @@ tradutores - editor & tradutor - editores & tradutores + editor e tradutor + editores e tradutores @@ -479,8 +479,8 @@ curs. - exec. prod. - exec. prods. + prod. exec. + prods. exec. narr. @@ -532,19 +532,19 @@ - chaired by - compiled by - with - curated by + presidido por + compilado por + com + curado por executive produced by - with guest + com convidado hosted by - narrated by - organized by - performed by - produced by - written by - created by + narrado por + organizado por + atuado por + produzido por + escrito por + criado por por dirigido por editado por @@ -554,7 +554,7 @@ para revisto por traduzido por - editado & traduzido por + editado e traduzido por comp. by diff --git a/buildres/csl/csl-styles/.github/workflows/label-gun.yml b/buildres/csl/csl-styles/.github/workflows/label-gun.yml index d4d022673f8..c87c1721b75 100644 --- a/buildres/csl/csl-styles/.github/workflows/label-gun.yml +++ b/buildres/csl/csl-styles/.github/workflows/label-gun.yml @@ -6,8 +6,13 @@ on: issue_comment: types: [created, edited, closed] +permissions: {} jobs: label: + permissions: + issues: write # to add label to an issues (retorquere/label-gun) + pull-requests: write # to add label, comment on pull request (retorquere/label-gun) + runs-on: ubuntu-latest steps: - uses: retorquere/label-gun@main diff --git a/buildres/csl/csl-styles/.github/workflows/merge.yaml b/buildres/csl/csl-styles/.github/workflows/merge.yaml index f52a6ba4110..c1efb7eab07 100644 --- a/buildres/csl/csl-styles/.github/workflows/merge.yaml +++ b/buildres/csl/csl-styles/.github/workflows/merge.yaml @@ -12,8 +12,13 @@ on: description: Commit message required: true +permissions: {} jobs: release: + permissions: + contents: write # to create a release + pull-requests: read # to read pull requests (dorny/paths-filter) + runs-on: ubuntu-latest env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/buildres/csl/csl-styles/.github/workflows/sheldon.yaml b/buildres/csl/csl-styles/.github/workflows/sheldon.yaml index 9bf525949f1..42962c95090 100644 --- a/buildres/csl/csl-styles/.github/workflows/sheldon.yaml +++ b/buildres/csl/csl-styles/.github/workflows/sheldon.yaml @@ -4,8 +4,13 @@ on: pull_request_target: types: [ opened, synchronize, workflow_dispatch] +permissions: {} jobs: test: + permissions: + contents: write # to push code in repo (stefanzweifel/git-auto-commit-action) + pull-requests: write # to comment on pull requests + runs-on: ubuntu-latest env: GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" diff --git a/buildres/csl/csl-styles/american-chemical-society.csl b/buildres/csl/csl-styles/american-chemical-society.csl index 09c0e9cf088..b7d421858bd 100644 --- a/buildres/csl/csl-styles/american-chemical-society.csl +++ b/buildres/csl/csl-styles/american-chemical-society.csl @@ -148,7 +148,7 @@ - + diff --git a/buildres/csl/csl-styles/american-medical-association.csl b/buildres/csl/csl-styles/american-medical-association.csl index b36bbb5488e..e8772592b34 100644 --- a/buildres/csl/csl-styles/american-medical-association.csl +++ b/buildres/csl/csl-styles/american-medical-association.csl @@ -124,7 +124,7 @@ - + diff --git a/buildres/csl/csl-styles/angiology.csl b/buildres/csl/csl-styles/angiology.csl new file mode 100644 index 00000000000..8cd8da147b8 --- /dev/null +++ b/buildres/csl/csl-styles/angiology.csl @@ -0,0 +1,200 @@ + + diff --git a/buildres/csl/csl-styles/biologiceskie-membrany.csl b/buildres/csl/csl-styles/biologiceskie-membrany.csl new file mode 100644 index 00000000000..2d5c19fbe06 --- /dev/null +++ b/buildres/csl/csl-styles/biologiceskie-membrany.csl @@ -0,0 +1,145 @@ + + diff --git a/buildres/csl/csl-styles/cell-numeric-superscript.csl b/buildres/csl/csl-styles/cell-numeric-superscript.csl deleted file mode 100644 index c928f064c24..00000000000 --- a/buildres/csl/csl-styles/cell-numeric-superscript.csl +++ /dev/null @@ -1,123 +0,0 @@ - - diff --git a/buildres/csl/csl-styles/cell.csl b/buildres/csl/csl-styles/cell.csl index 4c29acbd6bf..80635fd5fd8 100644 --- a/buildres/csl/csl-styles/cell.csl +++ b/buildres/csl/csl-styles/cell.csl @@ -4,7 +4,7 @@ Cell http://www.zotero.org/styles/cell - + Adam Mark a.mark@uoguelph.ca @@ -17,113 +17,114 @@ Aurimas Vinckevicius aurimas.dev@gmail.com - + 0092-8674 1097-4172 - The Cell journal style. Original by Julian Onions. - 2013-01-26T22:06:38+00:00 + The Cell journal style, switched to numeric superscript as per the Cell editorial office in Sept. 2022 + 2022-09-23T22:06:38+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License - - - - - - - - + + + + - + + - - - - + + + + + + + + + - - - - - + + - - - - + + - + - - + + + + + - - - + + + - + - - - - - + - - - - - + + - + - - - - + - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + diff --git a/buildres/csl/csl-styles/dependent/cancer-cell.csl b/buildres/csl/csl-styles/dependent/cancer-cell.csl index 0b835e10ef2..cd5b5bd118b 100644 --- a/buildres/csl/csl-styles/dependent/cancer-cell.csl +++ b/buildres/csl/csl-styles/dependent/cancer-cell.csl @@ -7,12 +7,12 @@ - + 1535-6108 1878-3686 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/cell-chemical-biology.csl b/buildres/csl/csl-styles/dependent/cell-chemical-biology.csl index 297bd541f27..d1bb1ad25b7 100644 --- a/buildres/csl/csl-styles/dependent/cell-chemical-biology.csl +++ b/buildres/csl/csl-styles/dependent/cell-chemical-biology.csl @@ -7,11 +7,11 @@ - + 2451-9456 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/cell-genomics.csl b/buildres/csl/csl-styles/dependent/cell-genomics.csl new file mode 100644 index 00000000000..4ea7fee1309 --- /dev/null +++ b/buildres/csl/csl-styles/dependent/cell-genomics.csl @@ -0,0 +1,16 @@ + + diff --git a/buildres/csl/csl-styles/dependent/cell-host-and-microbe.csl b/buildres/csl/csl-styles/dependent/cell-host-and-microbe.csl index b360f70ef8c..bea71d5db54 100644 --- a/buildres/csl/csl-styles/dependent/cell-host-and-microbe.csl +++ b/buildres/csl/csl-styles/dependent/cell-host-and-microbe.csl @@ -7,12 +7,12 @@ - + 1931-3128 1934-6069 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/cell-metabolism.csl b/buildres/csl/csl-styles/dependent/cell-metabolism.csl index 2a671ef3b7a..24f8dc2c5da 100644 --- a/buildres/csl/csl-styles/dependent/cell-metabolism.csl +++ b/buildres/csl/csl-styles/dependent/cell-metabolism.csl @@ -7,12 +7,12 @@ - + 1550-4131 1932-7420 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/cell-reports-medicine.csl b/buildres/csl/csl-styles/dependent/cell-reports-medicine.csl new file mode 100644 index 00000000000..ce4e7b0d289 --- /dev/null +++ b/buildres/csl/csl-styles/dependent/cell-reports-medicine.csl @@ -0,0 +1,17 @@ + + diff --git a/buildres/csl/csl-styles/dependent/stem-cell-reports.csl b/buildres/csl/csl-styles/dependent/cell-reports-methods.csl similarity index 60% rename from buildres/csl/csl-styles/dependent/stem-cell-reports.csl rename to buildres/csl/csl-styles/dependent/cell-reports-methods.csl index 0d3d60a98fa..1ddaf2a5536 100644 --- a/buildres/csl/csl-styles/dependent/stem-cell-reports.csl +++ b/buildres/csl/csl-styles/dependent/cell-reports-methods.csl @@ -2,16 +2,16 @@ diff --git a/buildres/csl/csl-styles/dependent/cell-reports-physcial-science.csl b/buildres/csl/csl-styles/dependent/cell-reports-physcial-science.csl new file mode 100644 index 00000000000..3d8ec283509 --- /dev/null +++ b/buildres/csl/csl-styles/dependent/cell-reports-physcial-science.csl @@ -0,0 +1,17 @@ + + diff --git a/buildres/csl/csl-styles/dependent/cell-reports.csl b/buildres/csl/csl-styles/dependent/cell-reports.csl index cf5ddbb3723..83a5c1a58a6 100644 --- a/buildres/csl/csl-styles/dependent/cell-reports.csl +++ b/buildres/csl/csl-styles/dependent/cell-reports.csl @@ -7,11 +7,11 @@ - + 2211-1247 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/cell-stem-cell.csl b/buildres/csl/csl-styles/dependent/cell-stem-cell.csl index e34749d7560..74797176799 100644 --- a/buildres/csl/csl-styles/dependent/cell-stem-cell.csl +++ b/buildres/csl/csl-styles/dependent/cell-stem-cell.csl @@ -7,12 +7,12 @@ - + 1934-5909 1875-9777 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/cell-systems.csl b/buildres/csl/csl-styles/dependent/cell-systems.csl index e98444a82d4..c1bdd10d53d 100644 --- a/buildres/csl/csl-styles/dependent/cell-systems.csl +++ b/buildres/csl/csl-styles/dependent/cell-systems.csl @@ -7,7 +7,7 @@ - + 2405-4712 diff --git a/buildres/csl/csl-styles/dependent/chem-catalysis.csl b/buildres/csl/csl-styles/dependent/chem-catalysis.csl index a9f989fb74a..919f71891f0 100644 --- a/buildres/csl/csl-styles/dependent/chem-catalysis.csl +++ b/buildres/csl/csl-styles/dependent/chem-catalysis.csl @@ -5,12 +5,12 @@ Chem Catalysis http://www.zotero.org/styles/chem-catalysis - + 2667-1093 - 2020-10-20T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/chem.csl b/buildres/csl/csl-styles/dependent/chem.csl index 0ef7aed6845..7d19a14ebee 100644 --- a/buildres/csl/csl-styles/dependent/chem.csl +++ b/buildres/csl/csl-styles/dependent/chem.csl @@ -5,13 +5,12 @@ Chem http://www.zotero.org/styles/chem - + - 2451-9294 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/current-biology.csl b/buildres/csl/csl-styles/dependent/current-biology.csl index 224648bdd5e..6329890f928 100644 --- a/buildres/csl/csl-styles/dependent/current-biology.csl +++ b/buildres/csl/csl-styles/dependent/current-biology.csl @@ -5,7 +5,7 @@ Current Biology http://www.zotero.org/styles/current-biology - + diff --git a/buildres/csl/csl-styles/dependent/developmental-cell.csl b/buildres/csl/csl-styles/dependent/developmental-cell.csl index ecd9ee313c8..259227edda7 100644 --- a/buildres/csl/csl-styles/dependent/developmental-cell.csl +++ b/buildres/csl/csl-styles/dependent/developmental-cell.csl @@ -7,12 +7,12 @@ - + 1534-5807 1878-1551 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/hgg-advances.csl b/buildres/csl/csl-styles/dependent/hgg-advances.csl new file mode 100644 index 00000000000..1200eee76d7 --- /dev/null +++ b/buildres/csl/csl-styles/dependent/hgg-advances.csl @@ -0,0 +1,16 @@ + + diff --git a/buildres/csl/csl-styles/dependent/immunity.csl b/buildres/csl/csl-styles/dependent/immunity.csl index fa6ed30361b..a681ae8afaa 100644 --- a/buildres/csl/csl-styles/dependent/immunity.csl +++ b/buildres/csl/csl-styles/dependent/immunity.csl @@ -7,12 +7,12 @@ - + 1074-7613 1097-4180 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/iscience.csl b/buildres/csl/csl-styles/dependent/iscience.csl index bae308d4ee7..2e16d6655b5 100644 --- a/buildres/csl/csl-styles/dependent/iscience.csl +++ b/buildres/csl/csl-styles/dependent/iscience.csl @@ -1,14 +1,16 @@ diff --git a/buildres/csl/csl-styles/dependent/joule.csl b/buildres/csl/csl-styles/dependent/joule.csl index f7552902c73..b6fff2f3bc2 100644 --- a/buildres/csl/csl-styles/dependent/joule.csl +++ b/buildres/csl/csl-styles/dependent/joule.csl @@ -5,7 +5,7 @@ Joule http://www.zotero.org/styles/joule - + diff --git a/buildres/csl/csl-styles/dependent/journal-of-the-american-society-for-mass-spectrometry.csl b/buildres/csl/csl-styles/dependent/journal-of-the-american-society-for-mass-spectrometry.csl index 2c8b0e267ba..2a7d71218f4 100644 --- a/buildres/csl/csl-styles/dependent/journal-of-the-american-society-for-mass-spectrometry.csl +++ b/buildres/csl/csl-styles/dependent/journal-of-the-american-society-for-mass-spectrometry.csl @@ -1,17 +1,17 @@ diff --git a/buildres/csl/csl-styles/dependent/matter.csl b/buildres/csl/csl-styles/dependent/matter.csl new file mode 100644 index 00000000000..d141af2d9b1 --- /dev/null +++ b/buildres/csl/csl-styles/dependent/matter.csl @@ -0,0 +1,16 @@ + + diff --git a/buildres/csl/csl-styles/dependent/med.csl b/buildres/csl/csl-styles/dependent/med.csl new file mode 100644 index 00000000000..376b85fec6a --- /dev/null +++ b/buildres/csl/csl-styles/dependent/med.csl @@ -0,0 +1,16 @@ + + diff --git a/buildres/csl/csl-styles/dependent/molecular-cell.csl b/buildres/csl/csl-styles/dependent/molecular-cell.csl index 4a91ebadaf2..9bb53473150 100644 --- a/buildres/csl/csl-styles/dependent/molecular-cell.csl +++ b/buildres/csl/csl-styles/dependent/molecular-cell.csl @@ -7,12 +7,12 @@ - + 1097-2765 1097-4164 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/molecular-therapy-methods-and-clinical-development.csl b/buildres/csl/csl-styles/dependent/molecular-therapy-methods-and-clinical-development.csl index 41348ff90ee..ed592926ac8 100644 --- a/buildres/csl/csl-styles/dependent/molecular-therapy-methods-and-clinical-development.csl +++ b/buildres/csl/csl-styles/dependent/molecular-therapy-methods-and-clinical-development.csl @@ -1,14 +1,17 @@ diff --git a/buildres/csl/csl-styles/dependent/molecular-therapy-nucleic-acids.csl b/buildres/csl/csl-styles/dependent/molecular-therapy-nucleic-acids.csl index f4dbbb2dc0f..2f13af4d37b 100644 --- a/buildres/csl/csl-styles/dependent/molecular-therapy-nucleic-acids.csl +++ b/buildres/csl/csl-styles/dependent/molecular-therapy-nucleic-acids.csl @@ -1,14 +1,17 @@ diff --git a/buildres/csl/csl-styles/dependent/molecular-therapy-oncolytics.csl b/buildres/csl/csl-styles/dependent/molecular-therapy-oncolytics.csl index 0d305e55f50..de56f89beab 100644 --- a/buildres/csl/csl-styles/dependent/molecular-therapy-oncolytics.csl +++ b/buildres/csl/csl-styles/dependent/molecular-therapy-oncolytics.csl @@ -1,14 +1,17 @@ diff --git a/buildres/csl/csl-styles/dependent/molecular-therapy.csl b/buildres/csl/csl-styles/dependent/molecular-therapy.csl index c8776b07346..ed4b1020f3f 100644 --- a/buildres/csl/csl-styles/dependent/molecular-therapy.csl +++ b/buildres/csl/csl-styles/dependent/molecular-therapy.csl @@ -1,17 +1,18 @@ diff --git a/buildres/csl/csl-styles/dependent/negative-results.csl b/buildres/csl/csl-styles/dependent/negative-results.csl index ff91c5f8236..5a47f970f73 100644 --- a/buildres/csl/csl-styles/dependent/negative-results.csl +++ b/buildres/csl/csl-styles/dependent/negative-results.csl @@ -5,7 +5,7 @@ Neg Res http://www.zotero.org/styles/negative-results - + diff --git a/buildres/csl/csl-styles/dependent/neuron.csl b/buildres/csl/csl-styles/dependent/neuron.csl index 399d16bfece..d88a2b55a27 100644 --- a/buildres/csl/csl-styles/dependent/neuron.csl +++ b/buildres/csl/csl-styles/dependent/neuron.csl @@ -7,12 +7,12 @@ - + 0896-6273 1097-4199 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/one-earth.csl b/buildres/csl/csl-styles/dependent/one-earth.csl index a2720485a3d..3e6dd4c8b6b 100644 --- a/buildres/csl/csl-styles/dependent/one-earth.csl +++ b/buildres/csl/csl-styles/dependent/one-earth.csl @@ -5,11 +5,11 @@ One Earth http://www.zotero.org/styles/one-earth - + - 2590-3322 + 2590-3322 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/patterns.csl b/buildres/csl/csl-styles/dependent/patterns.csl new file mode 100644 index 00000000000..2945c17a4b6 --- /dev/null +++ b/buildres/csl/csl-styles/dependent/patterns.csl @@ -0,0 +1,16 @@ + + diff --git a/buildres/csl/csl-styles/dependent/star-protocols.csl b/buildres/csl/csl-styles/dependent/star-protocols.csl new file mode 100644 index 00000000000..fd41c7cd118 --- /dev/null +++ b/buildres/csl/csl-styles/dependent/star-protocols.csl @@ -0,0 +1,16 @@ + + diff --git a/buildres/csl/csl-styles/dependent/structure.csl b/buildres/csl/csl-styles/dependent/structure.csl index 3b68e50023f..44f70c7970f 100644 --- a/buildres/csl/csl-styles/dependent/structure.csl +++ b/buildres/csl/csl-styles/dependent/structure.csl @@ -7,12 +7,12 @@ - + 0969-2126 1878-4186 - 2016-12-13T12:00:00+00:00 + 2017-10-20T12:00:00+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License diff --git a/buildres/csl/csl-styles/dependent/the-american-journal-of-human-genetics.csl b/buildres/csl/csl-styles/dependent/the-american-journal-of-human-genetics.csl new file mode 100644 index 00000000000..f0570c90b1c --- /dev/null +++ b/buildres/csl/csl-styles/dependent/the-american-journal-of-human-genetics.csl @@ -0,0 +1,17 @@ + + diff --git a/buildres/csl/csl-styles/geographical-analysis.csl b/buildres/csl/csl-styles/geographical-analysis.csl new file mode 100644 index 00000000000..7c8e38b8c13 --- /dev/null +++ b/buildres/csl/csl-styles/geographical-analysis.csl @@ -0,0 +1,180 @@ + + diff --git a/buildres/csl/csl-styles/isara-iso-690.csl b/buildres/csl/csl-styles/isara-iso-690.csl new file mode 100644 index 00000000000..115558fcbad --- /dev/null +++ b/buildres/csl/csl-styles/isara-iso-690.csl @@ -0,0 +1,570 @@ + + diff --git a/buildres/csl/csl-styles/law-citation-manual.csl b/buildres/csl/csl-styles/law-citation-manual.csl index b8512c5c40f..0fcc613cfc7 100644 --- a/buildres/csl/csl-styles/law-citation-manual.csl +++ b/buildres/csl/csl-styles/law-citation-manual.csl @@ -1,250 +1,494 @@ - diff --git a/buildres/csl/csl-styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster.csl b/buildres/csl/csl-styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster.csl index 335fa944a16..1a9517a9f90 100644 --- a/buildres/csl/csl-styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster.csl +++ b/buildres/csl/csl-styles/norsk-henvisningsstandard-for-rettsvitenskapelige-tekster.csl @@ -95,7 +95,7 @@ - + diff --git a/buildres/csl/csl-styles/proceedings-of-the-estonian-academy-of-sciences-author-date.csl b/buildres/csl/csl-styles/proceedings-of-the-estonian-academy-of-sciences-author-date.csl new file mode 100644 index 00000000000..2610b385cae --- /dev/null +++ b/buildres/csl/csl-styles/proceedings-of-the-estonian-academy-of-sciences-author-date.csl @@ -0,0 +1,222 @@ + + diff --git a/buildres/csl/csl-styles/proceedings-of-the-estonian-academy-of-sciences-numeric.csl b/buildres/csl/csl-styles/proceedings-of-the-estonian-academy-of-sciences-numeric.csl new file mode 100644 index 00000000000..6ffc0cdcc70 --- /dev/null +++ b/buildres/csl/csl-styles/proceedings-of-the-estonian-academy-of-sciences-numeric.csl @@ -0,0 +1,278 @@ + + diff --git a/buildres/csl/csl-styles/renamed-styles.json b/buildres/csl/csl-styles/renamed-styles.json index 562bf51a94f..c191da03ae2 100644 --- a/buildres/csl/csl-styles/renamed-styles.json +++ b/buildres/csl/csl-styles/renamed-styles.json @@ -535,5 +535,6 @@ "harvard-cardiff-university-old":"cardiff-university-harvard", "harvard-oxford-brookes-university-faculty-of-health-and-life-sciences": "harvard-cite-them-right", "bluebook2": "bluebook-law-review", - "moore-theological-college": "society-of-biblical-literature-fullnote-bibliography" + "moore-theological-college": "society-of-biblical-literature-fullnote-bibliography", + "cell-numeric-superscript": "cell" } diff --git a/buildres/csl/csl-styles/society-of-biblical-literature-fullnote-bibliography.csl b/buildres/csl/csl-styles/society-of-biblical-literature-fullnote-bibliography.csl index 5198c11eae8..2dd9a3b5d27 100644 --- a/buildres/csl/csl-styles/society-of-biblical-literature-fullnote-bibliography.csl +++ b/buildres/csl/csl-styles/society-of-biblical-literature-fullnote-bibliography.csl @@ -33,12 +33,21 @@ Society of Biblical Literature format with full notes and bibliography - 2022-06-29T13:58:51+00:00 + 2022-07-02T02:53:27+00:00 This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License + art. ed. + + p. + pp. + + + + ¶¶ + § §§ @@ -675,12 +684,13 @@ - + + @@ -689,9 +699,23 @@ - + + + + + + + + + + + + @@ -814,6 +838,10 @@ + + @@ -854,7 +882,22 @@ - + + + + + + + + + + + + + + @@ -876,7 +919,37 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -906,7 +979,26 @@ - + + + + + + + + + + + + + + + + + + diff --git a/buildres/csl/csl-styles/spec/filters.yaml b/buildres/csl/csl-styles/spec/filters.yaml index 1c4ddb7bab4..48cb27087d4 100644 --- a/buildres/csl/csl-styles/spec/filters.yaml +++ b/buildres/csl/csl-styles/spec/filters.yaml @@ -39,6 +39,8 @@ ISSN: - 1520-8524 - 1161-9473 - 2496-7114 +- 1736-6046 +- 1736-7530 # These titles are ignored when checking for duplicate titles TITLES: [] diff --git a/buildres/csl/csl-styles/the-american-journal-of-human-genetics.csl b/buildres/csl/csl-styles/stem-cell-reports.csl similarity index 53% rename from buildres/csl/csl-styles/the-american-journal-of-human-genetics.csl rename to buildres/csl/csl-styles/stem-cell-reports.csl index fbfef29d148..60c605a3e3e 100644 --- a/buildres/csl/csl-styles/the-american-journal-of-human-genetics.csl +++ b/buildres/csl/csl-styles/stem-cell-reports.csl @@ -1,23 +1,28 @@ - diff --git a/buildres/csl/csl-styles/taylor-and-francis-chicago-b-author-date.csl b/buildres/csl/csl-styles/taylor-and-francis-chicago-b-author-date.csl new file mode 100644 index 00000000000..68a1acf4cc3 --- /dev/null +++ b/buildres/csl/csl-styles/taylor-and-francis-chicago-b-author-date.csl @@ -0,0 +1,526 @@ + + diff --git a/buildres/csl/csl-styles/vancouver.csl b/buildres/csl/csl-styles/vancouver.csl index 71c92032289..e39efa8d842 100644 --- a/buildres/csl/csl-styles/vancouver.csl +++ b/buildres/csl/csl-styles/vancouver.csl @@ -323,7 +323,7 @@ - + diff --git a/lib/afterburner.fx.jar b/lib/afterburner.fx.jar deleted file mode 100644 index 816b3e27f5d..00000000000 Binary files a/lib/afterburner.fx.jar and /dev/null differ diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index c05e10bda2b..3b49cad2af9 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -54,7 +54,7 @@ requires jdk.xml.dom; // Annotations (@PostConstruct) - requires java.annotation; + requires jakarta.annotation; // Microsoft application insights requires applicationinsights.core; diff --git a/src/main/java/org/jabref/gui/EntryTypeView.java b/src/main/java/org/jabref/gui/EntryTypeView.java index 7db73467529..c126019e22e 100644 --- a/src/main/java/org/jabref/gui/EntryTypeView.java +++ b/src/main/java/org/jabref/gui/EntryTypeView.java @@ -5,8 +5,6 @@ import java.util.Optional; import java.util.stream.Collectors; -import javax.inject.Inject; - import javafx.application.Platform; import javafx.event.Event; import javafx.fxml.FXML; @@ -42,6 +40,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; +import jakarta.inject.Inject; /** * Dialog that prompts the user to choose a type for an entry. diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 9a5aeac2d9a..9da1e8fd77f 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -192,7 +192,7 @@ public JabRefFrame(Stage mainStage) { this.undoManager = Globals.undoManager; this.globalSearchBar = new GlobalSearchBar(this, stateManager, prefs, undoManager, dialogService); this.pushToApplicationCommand = new PushToApplicationCommand(stateManager, dialogService, prefs); - this.fileHistory = new FileHistoryMenu(prefs, dialogService, getOpenDatabaseAction()); + this.fileHistory = new FileHistoryMenu(prefs.getGuiPreferences().getFileHistory(), dialogService, getOpenDatabaseAction()); this.taskExecutor = Globals.TASK_EXECUTOR; this.importFormatReader = Globals.IMPORT_FORMAT_READER; this.setOnKeyTyped(key -> { @@ -402,7 +402,7 @@ private void tearDownJabRef(List filenames) { // Here we store the names of all current files. If there is no current file, we remove any // previously stored filename. if (filenames.isEmpty()) { - prefs.clearEditedFiles(); + prefs.getGuiPreferences().getLastFilesOpened().clear(); } else { Path focusedDatabase = getCurrentLibraryTab().getBibDatabaseContext() .getDatabasePath() diff --git a/src/main/java/org/jabref/gui/JabRefGUI.java b/src/main/java/org/jabref/gui/JabRefGUI.java index 2acb97939c1..29883a51ebb 100644 --- a/src/main/java/org/jabref/gui/JabRefGUI.java +++ b/src/main/java/org/jabref/gui/JabRefGUI.java @@ -135,7 +135,7 @@ private void openDatabases() { // Remove invalid databases List invalidDatabases = bibDatabases.stream() .filter(ParserResult::isInvalid) - .collect(Collectors.toList()); + .toList(); failed.addAll(invalidDatabases); bibDatabases.removeAll(invalidDatabases); diff --git a/src/main/java/org/jabref/gui/LibraryTab.java b/src/main/java/org/jabref/gui/LibraryTab.java index da1c3179e64..607bcb474f7 100644 --- a/src/main/java/org/jabref/gui/LibraryTab.java +++ b/src/main/java/org/jabref/gui/LibraryTab.java @@ -888,16 +888,6 @@ public void listen(EntriesRemovedEvent removedEntriesEvent) { private class IndexUpdateListener { - public IndexUpdateListener() { - if (preferencesService.getFilePreferences().shouldFulltextIndexLinkedFiles()) { - try { - indexingTaskManager.updateIndex(PdfIndexer.of(bibDatabaseContext, preferencesService.getFilePreferences()), bibDatabaseContext); - } catch (IOException e) { - LOGGER.error("Cannot access lucene index", e); - } - } - } - @Subscribe public void listen(EntriesAddedEvent addedEntryEvent) { if (preferencesService.getFilePreferences().shouldFulltextIndexLinkedFiles()) { diff --git a/src/main/java/org/jabref/gui/auximport/FromAuxDialog.java b/src/main/java/org/jabref/gui/auximport/FromAuxDialog.java index bb5dd512a2d..399a2d1f053 100644 --- a/src/main/java/org/jabref/gui/auximport/FromAuxDialog.java +++ b/src/main/java/org/jabref/gui/auximport/FromAuxDialog.java @@ -2,8 +2,6 @@ import java.nio.file.Path; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; @@ -27,6 +25,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; /** * A wizard dialog for generating a new sub database from existing TeX AUX file diff --git a/src/main/java/org/jabref/gui/bibtexextractor/ExtractBibtexDialog.java b/src/main/java/org/jabref/gui/bibtexextractor/ExtractBibtexDialog.java index 3a5d0ec7a3f..95d6ba5a692 100644 --- a/src/main/java/org/jabref/gui/bibtexextractor/ExtractBibtexDialog.java +++ b/src/main/java/org/jabref/gui/bibtexextractor/ExtractBibtexDialog.java @@ -1,6 +1,5 @@ package org.jabref.gui.bibtexextractor; -import javax.inject.Inject; import javax.swing.undo.UndoManager; import javafx.fxml.FXML; @@ -20,6 +19,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; /** * GUI Dialog for the feature "Extract BibTeX from plain text". diff --git a/src/main/java/org/jabref/gui/collab/ExternalChangesResolverDialog.java b/src/main/java/org/jabref/gui/collab/ExternalChangesResolverDialog.java index 744bf914f1f..f99dfab3c70 100644 --- a/src/main/java/org/jabref/gui/collab/ExternalChangesResolverDialog.java +++ b/src/main/java/org/jabref/gui/collab/ExternalChangesResolverDialog.java @@ -4,7 +4,6 @@ import java.util.List; import java.util.Map; -import javax.inject.Inject; import javax.swing.undo.UndoManager; import javafx.application.Platform; @@ -26,6 +25,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java b/src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java index 43023cab438..078ef89fabd 100644 --- a/src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java +++ b/src/main/java/org/jabref/gui/collab/metedatachange/MetadataChangeDetailsView.java @@ -4,6 +4,7 @@ import javafx.scene.layout.VBox; import org.jabref.gui.collab.ExternalChangeDetailsView; +import org.jabref.logic.bibtex.comparator.MetaDataDiff; import org.jabref.logic.l10n.Localization; import org.jabref.preferences.PreferencesService; @@ -16,8 +17,8 @@ public MetadataChangeDetailsView(MetadataChange metadataChange, PreferencesServi header.getStyleClass().add("sectionHeader"); container.getChildren().add(header); - for (String change : metadataChange.getMetaDataDiff().getDifferences(preferencesService)) { - container.getChildren().add(new Label(change)); + for (MetaDataDiff.Difference change : metadataChange.getMetaDataDiff().getDifferences(preferencesService)) { + container.getChildren().add(new Label(getDifferenceString(change))); } setLeftAnchor(container, 8d); @@ -27,4 +28,33 @@ public MetadataChangeDetailsView(MetadataChange metadataChange, PreferencesServi getChildren().setAll(container); } + + private String getDifferenceString(MetaDataDiff.Difference change) { + return switch (change) { + case PROTECTED -> + Localization.lang("Library protection"); + case GROUPS_ALTERED -> + Localization.lang("Modified groups tree"); + case ENCODING -> + Localization.lang("Library encoding"); + case SAVE_SORT_ORDER -> + Localization.lang("Save sort order"); + case KEY_PATTERNS -> + Localization.lang("Key patterns"); + case USER_FILE_DIRECTORY -> + Localization.lang("User-specific file directory"); + case LATEX_FILE_DIRECTORY -> + Localization.lang("LaTeX file directory"); + case DEFAULT_KEY_PATTERN -> + Localization.lang("Default pattern"); + case SAVE_ACTIONS -> + Localization.lang("Save actions"); + case MODE -> + Localization.lang("Library mode"); + case GENERAL_FILE_DIRECTORY -> + Localization.lang("General file directory"); + case CONTENT_SELECTOR -> + Localization.lang("Content selectors"); + }; + } } diff --git a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.java b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.java index 4d004e980c3..22384672656 100644 --- a/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.java +++ b/src/main/java/org/jabref/gui/commonfxcontrols/CitationKeyPatternPanel.java @@ -2,8 +2,6 @@ import java.util.Collection; -import javax.inject.Inject; - import javafx.beans.property.ListProperty; import javafx.beans.property.ObjectProperty; import javafx.fxml.FXML; @@ -22,6 +20,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class CitationKeyPatternPanel extends TableView { diff --git a/src/main/java/org/jabref/gui/contentselector/ContentSelectorDialogView.java b/src/main/java/org/jabref/gui/contentselector/ContentSelectorDialogView.java index cd3d773f6cf..403393cacc8 100644 --- a/src/main/java/org/jabref/gui/contentselector/ContentSelectorDialogView.java +++ b/src/main/java/org/jabref/gui/contentselector/ContentSelectorDialogView.java @@ -3,8 +3,6 @@ import java.util.Optional; import java.util.function.Supplier; -import javax.inject.Inject; - import javafx.beans.property.ListProperty; import javafx.fxml.FXML; import javafx.scene.control.Button; @@ -23,6 +21,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; public class ContentSelectorDialogView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java b/src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java index c82a3084094..449bdb7602a 100644 --- a/src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java +++ b/src/main/java/org/jabref/gui/customentrytypes/CustomizeEntryTypeDialogView.java @@ -2,8 +2,6 @@ import java.util.EnumSet; -import javax.inject.Inject; - import javafx.application.Platform; import javafx.beans.property.ReadOnlyStringWrapper; import javafx.fxml.FXML; @@ -43,6 +41,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; +import jakarta.inject.Inject; public class CustomizeEntryTypeDialogView extends BaseDialog { @@ -73,6 +72,7 @@ public class CustomizeEntryTypeDialogView extends BaseDialog { private CustomLocalDragboard localDragboard; public CustomizeEntryTypeDialogView(BibDatabaseContext bibDatabaseContext, BibEntryTypesManager entryTypesManager) { + this.setTitle(Localization.lang("Customize entry types")); this.mode = bibDatabaseContext.getMode(); this.entryTypesManager = entryTypesManager; diff --git a/src/main/java/org/jabref/gui/documentviewer/DocumentViewerView.java b/src/main/java/org/jabref/gui/documentviewer/DocumentViewerView.java index 377f158abd6..e75b607e505 100644 --- a/src/main/java/org/jabref/gui/documentviewer/DocumentViewerView.java +++ b/src/main/java/org/jabref/gui/documentviewer/DocumentViewerView.java @@ -1,7 +1,5 @@ package org.jabref.gui.documentviewer; -import javax.inject.Inject; - import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.ButtonBar; @@ -24,6 +22,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class DocumentViewerView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/edit/ManageKeywordsDialog.java b/src/main/java/org/jabref/gui/edit/ManageKeywordsDialog.java index fe8112a6829..26fad7eb613 100644 --- a/src/main/java/org/jabref/gui/edit/ManageKeywordsDialog.java +++ b/src/main/java/org/jabref/gui/edit/ManageKeywordsDialog.java @@ -2,8 +2,6 @@ import java.util.List; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.ButtonType; import javafx.scene.control.TableColumn; @@ -21,6 +19,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; public class ManageKeywordsDialog extends BaseDialog { private final List entries; diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java index 6e3d662bd6e..b0c8111f570 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java @@ -12,8 +12,6 @@ import java.util.SortedSet; import java.util.stream.Collectors; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.geometry.Side; import javafx.scene.control.Button; @@ -60,6 +58,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; import com.tobiasdiez.easybind.Subscription; +import jakarta.inject.Inject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java b/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java index c5384437c51..54f21252406 100644 --- a/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/RelatedArticlesTab.java @@ -65,7 +65,7 @@ private StackPane getRelatedArticlesPane(BibEntry entry) { ProgressIndicator progress = new ProgressIndicator(); progress.setMaxSize(100, 100); - MrDLibFetcher fetcher = new MrDLibFetcher(preferencesService.getLanguage().name(), + MrDLibFetcher fetcher = new MrDLibFetcher(preferencesService.getGeneralPreferences().getLanguage().name(), Globals.BUILD_INFO.version, preferencesService.getMrDlibPreferences()); BackgroundTask .wrap(() -> fetcher.performSearch(entry)) diff --git a/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTabView.java b/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTabView.java index 849a6d1b0ee..24c75fe9aa0 100644 --- a/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTabView.java +++ b/src/main/java/org/jabref/gui/entryeditor/fileannotationtab/FileAnnotationTabView.java @@ -2,8 +2,6 @@ import java.nio.file.Path; -import javax.inject.Inject; - import javafx.beans.binding.Bindings; import javafx.collections.ListChangeListener; import javafx.fxml.FXML; @@ -28,6 +26,7 @@ import org.jabref.model.util.FileUpdateMonitor; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; public class FileAnnotationTabView { diff --git a/src/main/java/org/jabref/gui/errorconsole/ErrorConsoleView.java b/src/main/java/org/jabref/gui/errorconsole/ErrorConsoleView.java index fa58509d6d2..e29940c7717 100644 --- a/src/main/java/org/jabref/gui/errorconsole/ErrorConsoleView.java +++ b/src/main/java/org/jabref/gui/errorconsole/ErrorConsoleView.java @@ -1,7 +1,5 @@ package org.jabref.gui.errorconsole; -import javax.inject.Inject; - import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; import javafx.fxml.FXML; @@ -30,6 +28,7 @@ import org.jabref.logic.util.BuildInfo; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class ErrorConsoleView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogView.java b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogView.java index a0b81e63505..d1370c42575 100644 --- a/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogView.java +++ b/src/main/java/org/jabref/gui/exporter/CreateModifyExporterDialogView.java @@ -1,7 +1,5 @@ package org.jabref.gui.exporter; -import javax.inject.Inject; - import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.ButtonType; @@ -14,6 +12,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class CreateModifyExporterDialogView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogView.java b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogView.java index 9ccdfa8ec82..7202751ef5e 100644 --- a/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogView.java +++ b/src/main/java/org/jabref/gui/externalfiles/UnlinkedFilesDialogView.java @@ -1,6 +1,5 @@ package org.jabref.gui.externalfiles; -import javax.inject.Inject; import javax.swing.undo.UndoManager; import javafx.application.Platform; @@ -49,6 +48,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; +import jakarta.inject.Inject; import org.controlsfx.control.CheckTreeView; public class UnlinkedFilesDialogView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/help/AboutDialogView.java b/src/main/java/org/jabref/gui/help/AboutDialogView.java index 2eef63577b9..de23785d378 100644 --- a/src/main/java/org/jabref/gui/help/AboutDialogView.java +++ b/src/main/java/org/jabref/gui/help/AboutDialogView.java @@ -1,7 +1,5 @@ package org.jabref.gui.help; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.ButtonType; import javafx.scene.control.TextArea; @@ -14,6 +12,7 @@ import org.jabref.logic.util.BuildInfo; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class AboutDialogView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.java b/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.java index e88d9878820..a99f090628f 100644 --- a/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.java +++ b/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.java @@ -2,8 +2,6 @@ import java.util.List; -import javax.inject.Inject; - import javafx.beans.binding.Bindings; import javafx.fxml.FXML; import javafx.scene.control.ButtonType; @@ -17,6 +15,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import org.controlsfx.control.CheckListView; public class ImportCustomEntryTypesDialog extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.java b/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.java index 770d0792659..14406dd642f 100644 --- a/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.java +++ b/src/main/java/org/jabref/gui/importer/ImportEntriesDialog.java @@ -2,7 +2,6 @@ import java.util.EnumSet; -import javax.inject.Inject; import javax.swing.undo.UndoManager; import javafx.beans.binding.Bindings; @@ -44,6 +43,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; import org.controlsfx.control.CheckListView; public class ImportEntriesDialog extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialog.java b/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialog.java index 384d49e8887..b6fb218d2f6 100644 --- a/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialog.java +++ b/src/main/java/org/jabref/gui/integrity/IntegrityCheckDialog.java @@ -2,8 +2,6 @@ import java.util.List; -import javax.inject.Inject; - import javafx.beans.property.ReadOnlyStringWrapper; import javafx.collections.ListChangeListener; import javafx.fxml.FXML; @@ -21,6 +19,7 @@ import org.jabref.logic.l10n.Localization; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import org.controlsfx.control.table.TableFilter; public class IntegrityCheckDialog extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/libraryproperties/AbstractPropertiesTabView.java b/src/main/java/org/jabref/gui/libraryproperties/AbstractPropertiesTabView.java index b69dd997a4b..f967733b32c 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/AbstractPropertiesTabView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/AbstractPropertiesTabView.java @@ -1,13 +1,13 @@ package org.jabref.gui.libraryproperties; -import javax.inject.Inject; - import javafx.scene.Node; import javafx.scene.layout.VBox; import org.jabref.gui.DialogService; import org.jabref.model.database.BibDatabaseContext; +import jakarta.inject.Inject; + public abstract class AbstractPropertiesTabView extends VBox implements PropertiesTab { @Inject protected DialogService dialogService; diff --git a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesView.java b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesView.java index 78b3b3d2a0a..5286d4fbfbf 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/LibraryPropertiesView.java @@ -1,7 +1,5 @@ package org.jabref.gui.libraryproperties; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.ButtonType; import javafx.scene.control.ScrollPane; @@ -15,6 +13,7 @@ import org.jabref.model.database.BibDatabaseContext; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class LibraryPropertiesView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesView.java b/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesView.java index 0e83f999963..a6fec6aa7ab 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/constants/ConstantsPropertiesView.java @@ -2,8 +2,6 @@ import java.util.Optional; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; @@ -23,6 +21,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class ConstantsPropertiesView extends AbstractPropertiesTabView implements PropertiesTab { diff --git a/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java b/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java index 382ca0adf83..6eab2dbee1a 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/general/GeneralPropertiesView.java @@ -2,7 +2,6 @@ import java.nio.charset.Charset; -import javax.inject.Inject; import javax.swing.undo.UndoManager; import javafx.fxml.FXML; @@ -19,6 +18,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class GeneralPropertiesView extends AbstractPropertiesTabView implements PropertiesTab { @FXML private ComboBox encoding; diff --git a/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesView.java b/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesView.java index 74035d4cd03..4d915d5099c 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/keypattern/KeyPatternPropertiesView.java @@ -1,7 +1,5 @@ package org.jabref.gui.libraryproperties.keypattern; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.Button; @@ -19,6 +17,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class KeyPatternPropertiesView extends AbstractPropertiesTabView implements PropertiesTab { diff --git a/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesView.java b/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesView.java index b479ee23cf6..524a051e20b 100644 --- a/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesView.java +++ b/src/main/java/org/jabref/gui/libraryproperties/saving/SavingPropertiesView.java @@ -1,7 +1,5 @@ package org.jabref.gui.libraryproperties.saving; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.CheckBox; @@ -14,6 +12,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class SavingPropertiesView extends AbstractPropertiesTabView implements PropertiesTab { diff --git a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogView.java b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogView.java index 3d6149a203b..7a9c333d0a2 100644 --- a/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogView.java +++ b/src/main/java/org/jabref/gui/linkedfile/LinkedFileEditDialogView.java @@ -1,7 +1,5 @@ package org.jabref.gui.linkedfile; -import javax.inject.Inject; - import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.ButtonType; @@ -18,6 +16,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class LinkedFileEditDialogView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java index 43a80641bf1..23554b66fc6 100644 --- a/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java +++ b/src/main/java/org/jabref/gui/menus/FileHistoryMenu.java @@ -11,22 +11,19 @@ import org.jabref.gui.importer.actions.OpenDatabaseAction; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.io.FileHistory; -import org.jabref.preferences.PreferencesService; public class FileHistoryMenu extends Menu { private final FileHistory history; - private final PreferencesService preferences; private final DialogService dialogService; private final OpenDatabaseAction openDatabaseAction; - public FileHistoryMenu(PreferencesService preferences, DialogService dialogService, OpenDatabaseAction openDatabaseAction) { + public FileHistoryMenu(FileHistory fileHistory, DialogService dialogService, OpenDatabaseAction openDatabaseAction) { setText(Localization.lang("Recent libraries")); - this.preferences = preferences; + this.history = fileHistory; this.dialogService = dialogService; this.openDatabaseAction = openDatabaseAction; - history = preferences.getGuiPreferences().getFileHistory(); if (history.isEmpty()) { setDisable(true); } else { @@ -46,10 +43,10 @@ public boolean openFileByKey(KeyEvent keyEvent) { } char key = keyEvent.getCharacter().charAt(0); int num = Character.getNumericValue(key); - if (num <= 0 || num > history.getHistory().size()) { + if (num <= 0 || num > history.size()) { return false; } - this.openFile(history.getFileAt(Integer.parseInt(keyEvent.getCharacter()) - 1)); + this.openFile(history.get(Integer.parseInt(keyEvent.getCharacter()) - 1)); return true; } @@ -66,7 +63,7 @@ public void newFile(Path file) { private void setItems() { getItems().clear(); for (int index = 0; index < history.size(); index++) { - addItem(history.getFileAt(index), index + 1); + addItem(history.get(index), index + 1); } } diff --git a/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialogView.java b/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialogView.java index f0453231015..15bc0def40a 100644 --- a/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialogView.java +++ b/src/main/java/org/jabref/gui/openoffice/ManageCitationsDialogView.java @@ -1,7 +1,5 @@ package org.jabref.gui.openoffice; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.Node; import javafx.scene.control.ButtonType; @@ -19,6 +17,7 @@ import org.jabref.model.strings.StringUtil; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class ManageCitationsDialogView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java index 2b66e0f6013..77870845ba8 100644 --- a/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java +++ b/src/main/java/org/jabref/gui/openoffice/StyleSelectDialogView.java @@ -1,7 +1,5 @@ package org.jabref.gui.openoffice; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; @@ -30,6 +28,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; public class StyleSelectDialogView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java b/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java index 354d6a5457a..61ea82243fa 100644 --- a/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java +++ b/src/main/java/org/jabref/gui/preferences/AbstractPreferenceTabView.java @@ -2,8 +2,6 @@ import java.util.List; -import javax.inject.Inject; - import javafx.scene.Node; import javafx.scene.layout.VBox; @@ -11,6 +9,8 @@ import org.jabref.gui.util.TaskExecutor; import org.jabref.preferences.PreferencesService; +import jakarta.inject.Inject; + public abstract class AbstractPreferenceTabView extends VBox implements PreferencesTab { @Inject protected TaskExecutor taskExecutor; diff --git a/src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java b/src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java index 4615300d502..a4bb0baab0c 100644 --- a/src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java +++ b/src/main/java/org/jabref/gui/preferences/PreferencesDialogView.java @@ -2,8 +2,6 @@ import java.util.Locale; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.ButtonType; import javafx.scene.control.ListView; @@ -21,6 +19,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; import org.controlsfx.control.textfield.CustomTextField; /** diff --git a/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.java b/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.java index 6021a2c5a51..7d5f40b6e49 100644 --- a/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.java +++ b/src/main/java/org/jabref/gui/preferences/customexporter/CustomExporterTab.java @@ -1,7 +1,5 @@ package org.jabref.gui.preferences.customexporter; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.SelectionMode; import javafx.scene.control.TableColumn; @@ -15,6 +13,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; public class CustomExporterTab extends AbstractPreferenceTabView implements PreferencesTab { diff --git a/src/main/java/org/jabref/gui/preferences/externalfiletypes/EditExternalFileTypeEntryDialog.java b/src/main/java/org/jabref/gui/preferences/externalfiletypes/EditExternalFileTypeEntryDialog.java index 377291e96e4..e18ed5a4e83 100644 --- a/src/main/java/org/jabref/gui/preferences/externalfiletypes/EditExternalFileTypeEntryDialog.java +++ b/src/main/java/org/jabref/gui/preferences/externalfiletypes/EditExternalFileTypeEntryDialog.java @@ -1,7 +1,5 @@ package org.jabref.gui.preferences.externalfiletypes; -import javax.inject.Inject; - import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.Button; @@ -18,6 +16,7 @@ import org.jabref.gui.util.FileDialogConfiguration; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; public class EditExternalFileTypeEntryDialog extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/preferences/general/GeneralTabViewModel.java b/src/main/java/org/jabref/gui/preferences/general/GeneralTabViewModel.java index 68ea3b24c7a..6e2143f31c4 100644 --- a/src/main/java/org/jabref/gui/preferences/general/GeneralTabViewModel.java +++ b/src/main/java/org/jabref/gui/preferences/general/GeneralTabViewModel.java @@ -68,7 +68,7 @@ public GeneralTabViewModel(DialogService dialogService, PreferencesService prefe public void setValues() { languagesListProperty.setValue(new SortedList<>(FXCollections.observableArrayList(Language.values()), Comparator.comparing(Language::getDisplayName))); - selectedLanguageProperty.setValue(preferencesService.getLanguage()); + selectedLanguageProperty.setValue(preferencesService.getGeneralPreferences().getLanguage()); encodingsListProperty.setValue(FXCollections.observableArrayList(Encodings.getCharsets())); @@ -91,8 +91,8 @@ public void setValues() { public void storeSettings() { Language newLanguage = selectedLanguageProperty.getValue(); - if (newLanguage != preferencesService.getLanguage()) { - preferencesService.setLanguage(newLanguage); + if (newLanguage != preferencesService.getGeneralPreferences().getLanguage()) { + preferencesService.getGeneralPreferences().setLanguage(newLanguage); Localization.setLanguage(newLanguage); restartWarning.add(Localization.lang("Changed language") + ": " + newLanguage.getDisplayName()); } diff --git a/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTab.java b/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTab.java index 32733480c77..37bda9ad270 100644 --- a/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTab.java +++ b/src/main/java/org/jabref/gui/preferences/journals/JournalAbbreviationsTab.java @@ -1,7 +1,5 @@ package org.jabref.gui.preferences.journals; -import javax.inject.Inject; - import javafx.animation.Interpolator; import javafx.animation.KeyFrame; import javafx.animation.KeyValue; @@ -34,6 +32,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; import org.controlsfx.control.textfield.CustomTextField; /** diff --git a/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTab.java b/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTab.java index eaa7f68ac5e..c4c04fe86c8 100644 --- a/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTab.java +++ b/src/main/java/org/jabref/gui/preferences/keybindings/KeyBindingsTab.java @@ -1,7 +1,5 @@ package org.jabref.gui.preferences.keybindings; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.MenuButton; import javafx.scene.control.MenuItem; @@ -22,6 +20,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; public class KeyBindingsTab extends AbstractPreferenceTabView implements PreferencesTab { diff --git a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java index cb9c897455c..fa7d3995d0e 100644 --- a/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java +++ b/src/main/java/org/jabref/gui/preferences/preview/PreviewTab.java @@ -3,8 +3,6 @@ import java.util.ArrayList; import java.util.List; -import javax.inject.Inject; - import javafx.application.Platform; import javafx.beans.property.ListProperty; import javafx.fxml.FXML; @@ -42,6 +40,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; +import jakarta.inject.Inject; import org.controlsfx.control.textfield.CustomTextField; import org.fxmisc.richtext.CodeArea; import org.fxmisc.richtext.LineNumberFactory; diff --git a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.java b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.java index b5285f5e07c..c5d1aa5b2c5 100644 --- a/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.java +++ b/src/main/java/org/jabref/gui/preferences/protectedterms/ProtectedTermsTab.java @@ -1,7 +1,5 @@ package org.jabref.gui.preferences.protectedterms; -import javax.inject.Inject; - import javafx.beans.property.ReadOnlyBooleanWrapper; import javafx.fxml.FXML; import javafx.scene.control.ContextMenu; @@ -24,6 +22,7 @@ import org.jabref.logic.protectedterms.ProtectedTermsLoader; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; /** * Dialog for managing term list files. diff --git a/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java b/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java index b23dc8ab2df..1b330015949 100644 --- a/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java +++ b/src/main/java/org/jabref/gui/search/GlobalSearchResultDialog.java @@ -1,6 +1,5 @@ package org.jabref.gui.search; -import javax.inject.Inject; import javax.swing.undo.UndoManager; import javafx.fxml.FXML; @@ -21,6 +20,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; public class GlobalSearchResultDialog extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java index 52e9280f2e7..992ed0482b0 100644 --- a/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java +++ b/src/main/java/org/jabref/gui/shared/SharedDatabaseLoginDialogView.java @@ -1,7 +1,5 @@ package org.jabref.gui.shared; -import javax.inject.Inject; - import javafx.application.Platform; import javafx.event.ActionEvent; import javafx.fxml.FXML; @@ -24,6 +22,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; +import jakarta.inject.Inject; public class SharedDatabaseLoginDialogView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java b/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java index 5040015fa3d..db9e074a596 100644 --- a/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java +++ b/src/main/java/org/jabref/gui/slr/ManageStudyDefinitionView.java @@ -5,8 +5,6 @@ import java.util.StringJoiner; import java.util.function.Consumer; -import javax.inject.Inject; - import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleStringProperty; import javafx.fxml.FXML; @@ -35,6 +33,7 @@ import org.jabref.preferences.PreferencesService; import com.airhacks.afterburner.views.ViewLoader; +import jakarta.inject.Inject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; diff --git a/src/main/java/org/jabref/gui/texparser/ParseLatexDialogView.java b/src/main/java/org/jabref/gui/texparser/ParseLatexDialogView.java index ce8dfd215f1..6f95e828754 100644 --- a/src/main/java/org/jabref/gui/texparser/ParseLatexDialogView.java +++ b/src/main/java/org/jabref/gui/texparser/ParseLatexDialogView.java @@ -1,7 +1,5 @@ package org.jabref.gui.texparser; -import javax.inject.Inject; - import javafx.beans.binding.Bindings; import javafx.fxml.FXML; import javafx.scene.control.Button; @@ -28,6 +26,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; import de.saxsys.mvvmfx.utils.validation.visualization.ControlsFxVisualizer; +import jakarta.inject.Inject; import org.controlsfx.control.CheckTreeView; public class ParseLatexDialogView extends BaseDialog { diff --git a/src/main/java/org/jabref/gui/texparser/ParseLatexResultView.java b/src/main/java/org/jabref/gui/texparser/ParseLatexResultView.java index 6a56fbcfe47..7fc00e8b7eb 100644 --- a/src/main/java/org/jabref/gui/texparser/ParseLatexResultView.java +++ b/src/main/java/org/jabref/gui/texparser/ParseLatexResultView.java @@ -2,8 +2,6 @@ import java.nio.file.Path; -import javax.inject.Inject; - import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.ButtonType; @@ -20,6 +18,7 @@ import com.airhacks.afterburner.views.ViewLoader; import com.tobiasdiez.easybind.EasyBind; +import jakarta.inject.Inject; public class ParseLatexResultView extends BaseDialog { diff --git a/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java b/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java index 7a3c5db3ba0..09c639e6e64 100644 --- a/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java +++ b/src/main/java/org/jabref/logic/bibtex/comparator/MetaDataDiff.java @@ -1,15 +1,27 @@ package org.jabref.logic.bibtex.comparator; -import java.util.ArrayList; -import java.util.List; +import java.util.EnumSet; import java.util.Objects; import java.util.Optional; -import org.jabref.logic.l10n.Localization; import org.jabref.model.metadata.MetaData; import org.jabref.preferences.PreferencesService; public class MetaDataDiff { + public enum Difference { + PROTECTED, + GROUPS_ALTERED, + ENCODING, + SAVE_SORT_ORDER, + KEY_PATTERNS, + USER_FILE_DIRECTORY, + LATEX_FILE_DIRECTORY, + DEFAULT_KEY_PATTERN, + SAVE_ACTIONS, + MODE, + GENERAL_FILE_DIRECTORY, + CONTENT_SELECTOR + } private final Optional groupDiff; private final MetaData originalMetaData; @@ -32,44 +44,44 @@ public static Optional compare(MetaData originalMetaData, MetaData /** * @implNote Should be kept in sync with {@link MetaData#equals(Object)} */ - public List getDifferences(PreferencesService preferences) { - List changes = new ArrayList<>(); + public EnumSet getDifferences(PreferencesService preferences) { + EnumSet changes = EnumSet.noneOf(Difference.class); if (originalMetaData.isProtected() != newMetaData.isProtected()) { - changes.add(Localization.lang("Library protection")); + changes.add(Difference.PROTECTED); } if (!Objects.equals(originalMetaData.getGroups(), newMetaData.getGroups())) { - changes.add(Localization.lang("Modified groups tree")); + changes.add(Difference.GROUPS_ALTERED); } if (!Objects.equals(originalMetaData.getEncoding(), newMetaData.getEncoding())) { - changes.add(Localization.lang("Library encoding")); + changes.add(Difference.ENCODING); } if (!Objects.equals(originalMetaData.getSaveOrderConfig(), newMetaData.getSaveOrderConfig())) { - changes.add(Localization.lang("Save sort order")); + changes.add(Difference.SAVE_SORT_ORDER); } if (!Objects.equals(originalMetaData.getCiteKeyPattern(preferences.getGlobalCitationKeyPattern()), newMetaData.getCiteKeyPattern(preferences.getGlobalCitationKeyPattern()))) { - changes.add(Localization.lang("Key patterns")); + changes.add(Difference.KEY_PATTERNS); } if (!Objects.equals(originalMetaData.getUserFileDirectories(), newMetaData.getUserFileDirectories())) { - changes.add(Localization.lang("User-specific file directory")); + changes.add(Difference.USER_FILE_DIRECTORY); } if (!Objects.equals(originalMetaData.getLatexFileDirectories(), newMetaData.getLatexFileDirectories())) { - changes.add(Localization.lang("LaTeX file directory")); + changes.add(Difference.LATEX_FILE_DIRECTORY); } if (!Objects.equals(originalMetaData.getDefaultCiteKeyPattern(), newMetaData.getDefaultCiteKeyPattern())) { - changes.add(Localization.lang("Default pattern")); + changes.add(Difference.DEFAULT_KEY_PATTERN); } if (!Objects.equals(originalMetaData.getSaveActions(), newMetaData.getSaveActions())) { - changes.add(Localization.lang("Save actions")); + changes.add(Difference.SAVE_ACTIONS); } - if (originalMetaData.getMode() != newMetaData.getMode()) { - changes.add(Localization.lang("Library mode")); + if (!originalMetaData.getMode().equals(newMetaData.getMode())) { + changes.add(Difference.MODE); } if (!Objects.equals(originalMetaData.getDefaultFileDirectory(), newMetaData.getDefaultFileDirectory())) { - changes.add(Localization.lang("General file directory")); + changes.add(Difference.GENERAL_FILE_DIRECTORY); } if (!Objects.equals(originalMetaData.getContentSelectors(), newMetaData.getContentSelectors())) { - changes.add(Localization.lang("Content selectors")); + changes.add(Difference.CONTENT_SELECTOR); } return changes; } diff --git a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java index 0d1cf5c5ad6..3696ac294ae 100644 --- a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java +++ b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanup.java @@ -57,7 +57,7 @@ private List cleanupSingleField(Field fieldKey, BibEntry entry) { // Run formatter String newValue = formatter.format(oldValue); - if (oldValue.equals(newValue)) { + if (newValue.equals(oldValue)) { return Collections.emptyList(); } else { if (newValue.isEmpty()) { @@ -86,7 +86,7 @@ private List cleanupAllFields(BibEntry entry) { private List cleanupAllTextFields(BibEntry entry) { List fieldChanges = new ArrayList<>(); Set fields = new HashSet<>(entry.getFields()); - fields.removeAll(FieldFactory.getNotTextFieldNames()); + FieldFactory.getNotTextFieldNames().forEach(fields::remove); for (Field fieldKey : fields) { if (!fieldKey.equals(InternalField.KEY_FIELD)) { fieldChanges.addAll(cleanupSingleField(fieldKey, entry)); @@ -105,12 +105,11 @@ public Formatter getFormatter() { } @Override - public boolean equals(Object o) { - if (this == o) { + public boolean equals(Object obj) { + if (this == obj) { return true; } - if (o instanceof FieldFormatterCleanup) { - FieldFormatterCleanup that = (FieldFormatterCleanup) o; + if (obj instanceof FieldFormatterCleanup that) { return Objects.equals(field, that.field) && Objects.equals(formatter, that.formatter); } return false; diff --git a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java index ce53b68d144..17e88ab6955 100644 --- a/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java +++ b/src/main/java/org/jabref/logic/cleanup/FieldFormatterCleanups.java @@ -206,4 +206,28 @@ private static Formatter getFormatterFromString(String formatterName) { } return new IdentityFormatter(); } + + @Override + public int hashCode() { + return Objects.hash(actions, enabled); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj instanceof FieldFormatterCleanups other) { + return Objects.equals(actions, other.actions) && (enabled == other.enabled); + } + return false; + } + + @Override + public String toString() { + return "FieldFormatterCleanups{" + + "enabled=" + enabled + "," + + "actions=" + actions + + "}"; + } } diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatter.java b/src/main/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatter.java index 01a7a6d5fc2..86b6861ae4e 100644 --- a/src/main/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatter.java +++ b/src/main/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatter.java @@ -22,7 +22,7 @@ public String getKey() { public String format(String input) { Title title = new Title(input); - title.getWords().stream().forEach(Word::toUpperFirst); + title.getWords().stream().forEach(Word::toUpperFirstIgnoreHyphen); return title.toString(); } diff --git a/src/main/java/org/jabref/logic/formatter/casechanger/Word.java b/src/main/java/org/jabref/logic/formatter/casechanger/Word.java index 9cf9dd77ea9..5c777df9a00 100644 --- a/src/main/java/org/jabref/logic/formatter/casechanger/Word.java +++ b/src/main/java/org/jabref/logic/formatter/casechanger/Word.java @@ -102,6 +102,16 @@ public void toUpperFirst() { } } + public void toUpperFirstIgnoreHyphen() { + for (int i = 0; i < chars.length; i++) { + if (!protectedChars[i]) { + chars[i] = (i == 0 || (DASHES.contains(chars[i - 1]))) ? + Character.toUpperCase(chars[i]) : + Character.toLowerCase(chars[i]); + } + } + } + public void toUpperFirstTitle() { for (int i = 0; i < chars.length; i++) { if (!protectedChars[i]) { diff --git a/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java b/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java index 69ebd404f14..052578f7657 100644 --- a/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java +++ b/src/main/java/org/jabref/logic/importer/fileformat/ModsImporter.java @@ -9,6 +9,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Objects; import java.util.Optional; @@ -167,7 +168,7 @@ private void parseModsGroup(Map fields, List modsGroup, B abstractDefinition .ifPresent(abstractDef -> putIfValueNotNull(fields, StandardField.ABSTRACT, abstractDef.getValue())); - genreDefinition.ifPresent(genre -> entry.setType(EntryTypeFactory.parse(genre.getValue()))); + genreDefinition.ifPresent(genre -> entry.setType(EntryTypeFactory.parse(mapGenre(genre.getValue())))); languageDefinition.ifPresent( languageDef -> languageDef.getLanguageTerm().stream().map(LanguageTermDefinition::getValue) @@ -203,6 +204,16 @@ private void parseModsGroup(Map fields, List modsGroup, B putIfListIsNotEmpty(fields, notes, StandardField.NOTE, ", "); } + private String mapGenre(String genre) { + return switch (genre.toLowerCase(Locale.ROOT)) { + case "conference publication" -> "proceedings"; + case "database" -> "dataset"; + case "yearbook", "handbook" -> "book"; + case "law report or digest", "technical report", "reporting" -> "report"; + default -> genre; + }; + } + private void parseTitle(Map fields, List titleOrSubTitleOrPartNumber) { for (Object object : titleOrSubTitleOrPartNumber) { if (object instanceof JAXBElement) { diff --git a/src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java b/src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java index 89db6837ce9..831ca747cb1 100644 --- a/src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java +++ b/src/main/java/org/jabref/logic/pdf/search/indexing/DocumentReader.java @@ -71,11 +71,7 @@ public DocumentReader(BibEntry bibEntry, FilePreferences filePreferences) { public Optional> readLinkedPdf(BibDatabaseContext databaseContext, LinkedFile pdf) { Optional pdfPath = pdf.findIn(databaseContext, filePreferences); if (pdfPath.isPresent()) { - try { - return Optional.of(readPdfContents(pdf, pdfPath.get())); - } catch (IOException e) { - LOGGER.error("Could not read pdf file {}!", pdf.getLink(), e); - } + return Optional.of(readPdfContents(pdf, pdfPath.get())); } return Optional.empty(); } @@ -94,19 +90,30 @@ public List readLinkedPdfs(BibDatabaseContext databaseContext) { .collect(Collectors.toList()); } - private List readPdfContents(LinkedFile pdf, Path resolvedPdfPath) throws IOException { + private List readPdfContents(LinkedFile pdf, Path resolvedPdfPath) { + List pages = new ArrayList<>(); try (PDDocument pdfDocument = Loader.loadPDF(resolvedPdfPath.toFile())) { - List pages = new ArrayList<>(); - - for (int pageNumber = 0; pageNumber < pdfDocument.getNumberOfPages(); pageNumber++) { - Document newDocument = new Document(); - addIdentifiers(newDocument, pdf.getLink()); - addMetaData(newDocument, resolvedPdfPath, pageNumber); - addContentIfNotEmpty(pdfDocument, newDocument, pageNumber); - pages.add(newDocument); - } - return pages; + for (int pageNumber = 0; pageNumber < pdfDocument.getNumberOfPages(); pageNumber++) { + Document newDocument = new Document(); + addIdentifiers(newDocument, pdf.getLink()); + addMetaData(newDocument, resolvedPdfPath, pageNumber); + try { + addContentIfNotEmpty(pdfDocument, newDocument, pageNumber); + } catch (IOException e) { + LOGGER.warn("Could not read page {} of {}", pageNumber, resolvedPdfPath.toAbsolutePath(), e); + } + pages.add(newDocument); + } + } catch (IOException e) { + LOGGER.warn("Could not read {}", resolvedPdfPath.toAbsolutePath(), e); + } + if (pages.isEmpty()) { + Document newDocument = new Document(); + addIdentifiers(newDocument, pdf.getLink()); + addMetaData(newDocument, resolvedPdfPath, 0); + pages.add(newDocument); } + return pages; } private void addMetaData(Document newDocument, Path resolvedPdfPath, int pageNumber) { @@ -135,24 +142,20 @@ public static String mergeLines(String text) { return LINEBREAK_WITHOUT_PERIOD_PATTERN.matcher(mergedHyphenNewlines).replaceAll("$1 "); } - private void addContentIfNotEmpty(PDDocument pdfDocument, Document newDocument, int pageNumber) { - try { - PDFTextStripper pdfTextStripper = new PDFTextStripper(); - pdfTextStripper.setLineSeparator("\n"); - pdfTextStripper.setStartPage(pageNumber); - pdfTextStripper.setEndPage(pageNumber); - - String pdfContent = pdfTextStripper.getText(pdfDocument); - if (StringUtil.isNotBlank(pdfContent)) { - newDocument.add(new TextField(CONTENT, mergeLines(pdfContent), Field.Store.YES)); - } - PDPage page = pdfDocument.getPage(pageNumber); - List annotations = page.getAnnotations().stream().filter((annotation) -> annotation.getContents() != null).map(PDAnnotation::getContents).collect(Collectors.toList()); - if (annotations.size() > 0) { - newDocument.add(new TextField(ANNOTATIONS, annotations.stream().collect(Collectors.joining("\n")), Field.Store.YES)); - } - } catch (IOException e) { - LOGGER.info("Could not read contents of PDF document \"{}\"", pdfDocument.toString(), e); + private void addContentIfNotEmpty(PDDocument pdfDocument, Document newDocument, int pageNumber) throws IOException { + PDFTextStripper pdfTextStripper = new PDFTextStripper(); + pdfTextStripper.setLineSeparator("\n"); + pdfTextStripper.setStartPage(pageNumber); + pdfTextStripper.setEndPage(pageNumber); + + String pdfContent = pdfTextStripper.getText(pdfDocument); + if (StringUtil.isNotBlank(pdfContent)) { + newDocument.add(new TextField(CONTENT, mergeLines(pdfContent), Field.Store.YES)); + } + PDPage page = pdfDocument.getPage(pageNumber); + List annotations = page.getAnnotations().stream().filter((annotation) -> annotation.getContents() != null).map(PDAnnotation::getContents).collect(Collectors.toList()); + if (annotations.size() > 0) { + newDocument.add(new TextField(ANNOTATIONS, annotations.stream().collect(Collectors.joining("\n")), Field.Store.YES)); } } diff --git a/src/main/java/org/jabref/logic/util/io/FileHistory.java b/src/main/java/org/jabref/logic/util/io/FileHistory.java index 04af2003c92..4281c36306e 100644 --- a/src/main/java/org/jabref/logic/util/io/FileHistory.java +++ b/src/main/java/org/jabref/logic/util/io/FileHistory.java @@ -1,28 +1,43 @@ package org.jabref.logic.util.io; import java.nio.file.Path; +import java.util.ArrayList; import java.util.List; -import java.util.Objects; -import javafx.collections.FXCollections; -import javafx.collections.ObservableList; +import javafx.collections.ModifiableObservableListBase; -public class FileHistory { +public class FileHistory extends ModifiableObservableListBase { private static final int HISTORY_SIZE = 8; - private final ObservableList history; + private final List history; - public FileHistory(List files) { - history = FXCollections.observableList(Objects.requireNonNull(files)); + private FileHistory(List list) { + history = new ArrayList<>(list); + } + + @Override + public Path get(int index) { + return history.get(index); } public int size() { return history.size(); } - public boolean isEmpty() { - return history.isEmpty(); + @Override + protected void doAdd(int index, Path element) { + history.add(index, element); + } + + @Override + protected Path doSet(int index, Path element) { + return history.set(index, element); + } + + @Override + protected Path doRemove(int index) { + return history.remove(index); } /** @@ -30,21 +45,17 @@ public boolean isEmpty() { */ public void newFile(Path file) { removeItem(file); - history.add(0, file); + this.add(0, file); while (size() > HISTORY_SIZE) { history.remove(HISTORY_SIZE); } } - public Path getFileAt(int index) { - return history.get(index); - } - public void removeItem(Path file) { - history.remove(file); + this.remove(file); } - public ObservableList getHistory() { - return history; + public static FileHistory of(List list) { + return new FileHistory(new ArrayList<>(list)); } } diff --git a/src/main/java/org/jabref/model/metadata/ContentSelector.java b/src/main/java/org/jabref/model/metadata/ContentSelector.java index 1d51a893aa9..d2c633f6396 100644 --- a/src/main/java/org/jabref/model/metadata/ContentSelector.java +++ b/src/main/java/org/jabref/model/metadata/ContentSelector.java @@ -26,7 +26,7 @@ public boolean equals(Object o) { if (this == o) { return true; } - if (o == null || getClass() != o.getClass()) { + if ((o == null) || (getClass() != o.getClass())) { return false; } @@ -35,6 +35,11 @@ public boolean equals(Object o) { Objects.equals(values, that.values); } + @Override + public String toString() { + return "ContentSelector [field=" + field + ", values=" + values + "]"; + } + @Override public int hashCode() { return Objects.hash(field, values); diff --git a/src/main/java/org/jabref/model/metadata/MetaData.java b/src/main/java/org/jabref/model/metadata/MetaData.java index 9b0ed2ae856..531ac1985be 100644 --- a/src/main/java/org/jabref/model/metadata/MetaData.java +++ b/src/main/java/org/jabref/model/metadata/MetaData.java @@ -375,7 +375,12 @@ public boolean equals(Object o) { @Override public int hashCode() { - return Objects.hash(groupsRoot.getValue(), encoding, encodingExplicitlySupplied, saveOrderConfig, citeKeyPatterns, userFileDirectory, - defaultCiteKeyPattern, saveActions, mode, isProtected, defaultFileDirectory); + return Objects.hash(isProtected, groupsRoot.getValue(), encoding, encodingExplicitlySupplied, saveOrderConfig, citeKeyPatterns, userFileDirectory, + laTexFileDirectory, defaultCiteKeyPattern, saveActions, mode, defaultFileDirectory, contentSelectors); + } + + @Override + public String toString() { + return "MetaData [citeKeyPatterns=" + citeKeyPatterns + ", userFileDirectory=" + userFileDirectory + ", laTexFileDirectory=" + laTexFileDirectory + ", groupsRoot=" + groupsRoot + ", encoding=" + encoding + ", saveOrderConfig=" + saveOrderConfig + ", defaultCiteKeyPattern=" + defaultCiteKeyPattern + ", saveActions=" + saveActions + ", mode=" + mode + ", isProtected=" + isProtected + ", defaultFileDirectory=" + defaultFileDirectory + ", contentSelectors=" + contentSelectors + ", encodingExplicitlySupplied=" + encodingExplicitlySupplied + "]"; } } diff --git a/src/main/java/org/jabref/preferences/GeneralPreferences.java b/src/main/java/org/jabref/preferences/GeneralPreferences.java index 1383e6c11b4..62d4971a6d6 100644 --- a/src/main/java/org/jabref/preferences/GeneralPreferences.java +++ b/src/main/java/org/jabref/preferences/GeneralPreferences.java @@ -5,9 +5,11 @@ import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleObjectProperty; +import org.jabref.logic.l10n.Language; import org.jabref.model.database.BibDatabaseMode; public class GeneralPreferences { + private final ObjectProperty language; private final ObjectProperty defaultBibDatabaseMode; private final BooleanProperty warnAboutDuplicatesInInspection; private final BooleanProperty confirmDelete; @@ -15,11 +17,13 @@ public class GeneralPreferences { private final BooleanProperty memoryStickMode; private final BooleanProperty showAdvancedHints; - public GeneralPreferences(BibDatabaseMode defaultBibDatabaseMode, + public GeneralPreferences(Language language, + BibDatabaseMode defaultBibDatabaseMode, boolean warnAboutDuplicatesInInspection, boolean confirmDelete, boolean memoryStickMode, boolean showAdvancedHints) { + this.language = new SimpleObjectProperty<>(language); this.defaultBibDatabaseMode = new SimpleObjectProperty<>(defaultBibDatabaseMode); this.warnAboutDuplicatesInInspection = new SimpleBooleanProperty(warnAboutDuplicatesInInspection); this.confirmDelete = new SimpleBooleanProperty(confirmDelete); @@ -28,6 +32,18 @@ public GeneralPreferences(BibDatabaseMode defaultBibDatabaseMode, this.showAdvancedHints = new SimpleBooleanProperty(showAdvancedHints); } + public Language getLanguage() { + return language.get(); + } + + public ObjectProperty languageProperty() { + return language; + } + + public void setLanguage(Language language) { + this.language.set(language); + } + public BibDatabaseMode getDefaultBibDatabaseMode() { return defaultBibDatabaseMode.get(); } diff --git a/src/main/java/org/jabref/preferences/GuiPreferences.java b/src/main/java/org/jabref/preferences/GuiPreferences.java index 08f9e199c84..b8ca00d69d0 100644 --- a/src/main/java/org/jabref/preferences/GuiPreferences.java +++ b/src/main/java/org/jabref/preferences/GuiPreferences.java @@ -25,14 +25,14 @@ public class GuiPreferences { private final BooleanProperty windowMaximised; + // the last libraries that were open when jabref closes and should be reopened on startup private final ObservableList lastFilesOpened; private final ObjectProperty lastFocusedFile; + // observable list last files opened in the file menu private final FileHistory fileHistory; private final StringProperty lastSelectedIdBasedFetcher; - private final ObjectProperty mergeDiffMode; - private final DoubleProperty sidePaneWidth; public GuiPreferences(double positionX, diff --git a/src/main/java/org/jabref/preferences/JabRefPreferences.java b/src/main/java/org/jabref/preferences/JabRefPreferences.java index 4f50fe85351..166e5d9f187 100644 --- a/src/main/java/org/jabref/preferences/JabRefPreferences.java +++ b/src/main/java/org/jabref/preferences/JabRefPreferences.java @@ -34,6 +34,7 @@ import java.util.stream.Stream; import javafx.beans.InvalidationListener; +import javafx.collections.ListChangeListener; import javafx.collections.SetChangeListener; import javafx.scene.control.TableColumn.SortType; @@ -414,7 +415,6 @@ public class JabRefPreferences implements PreferencesService { /** * Cache variables */ - private Language language; private GeneralPreferences generalPreferences; private TelemetryPreferences telemetryPreferences; private DOIPreferences doiPreferences; @@ -1254,33 +1254,6 @@ private void storeBibEntryTypes(Collection bibEntryTypes, BibDatab // GeneralPreferences //************************************************************************************************************* - @Override - public Language getLanguage() { - if (language == null) { - updateLanguage(); - } - return language; - } - - private void updateLanguage() { - String languageId = get(LANGUAGE); - language = Stream.of(Language.values()) - .filter(language -> language.getId().equalsIgnoreCase(languageId)) - .findFirst() - .orElse(Language.ENGLISH); - } - - @Override - public void setLanguage(Language language) { - Language oldLanguage = getLanguage(); - put(LANGUAGE, language.getId()); - if (language != oldLanguage) { - // Update any defaults that might be language dependent: - setLanguageDependentDefaultValues(); - } - updateLanguage(); - } - @Override public GeneralPreferences getGeneralPreferences() { if (Objects.nonNull(generalPreferences)) { @@ -1288,12 +1261,20 @@ public GeneralPreferences getGeneralPreferences() { } generalPreferences = new GeneralPreferences( + getLanguage(), getBoolean(BIBLATEX_DEFAULT_MODE) ? BibDatabaseMode.BIBLATEX : BibDatabaseMode.BIBTEX, getBoolean(WARN_ABOUT_DUPLICATES_IN_INSPECTION), getBoolean(CONFIRM_DELETE), getBoolean(MEMORY_STICK_MODE), getBoolean(SHOW_ADVANCED_HINTS)); + EasyBind.listen(generalPreferences.languageProperty(), (obs, oldValue, newValue) -> { + put(LANGUAGE, newValue.getId()); + if (oldValue != newValue) { + setLanguageDependentDefaultValues(); + Localization.setLanguage(newValue); + } + }); EasyBind.listen(generalPreferences.defaultBibDatabaseModeProperty(), (obs, oldValue, newValue) -> putBoolean(BIBLATEX_DEFAULT_MODE, (newValue == BibDatabaseMode.BIBLATEX))); EasyBind.listen(generalPreferences.isWarnAboutDuplicatesInInspectionProperty(), (obs, oldValue, newValue) -> putBoolean(WARN_ABOUT_DUPLICATES_IN_INSPECTION, newValue)); EasyBind.listen(generalPreferences.confirmDeleteProperty(), (obs, oldValue, newValue) -> putBoolean(CONFIRM_DELETE, newValue)); @@ -1303,6 +1284,13 @@ public GeneralPreferences getGeneralPreferences() { return generalPreferences; } + private Language getLanguage() { + return Stream.of(Language.values()) + .filter(language -> language.getId().equalsIgnoreCase(get(LANGUAGE))) + .findFirst() + .orElse(Language.ENGLISH); + } + @Override public TelemetryPreferences getTelemetryPreferences() { if (Objects.nonNull(telemetryPreferences)) { @@ -1312,7 +1300,7 @@ public TelemetryPreferences getTelemetryPreferences() { telemetryPreferences = new TelemetryPreferences( getBoolean(COLLECT_TELEMETRY), !getBoolean(ALREADY_ASKED_TO_COLLECT_TELEMETRY), // mind the ! - getOrCreateUserId() + getTelemetryUserId() ); EasyBind.listen(telemetryPreferences.collectTelemetryProperty(), (obs, oldValue, newValue) -> putBoolean(COLLECT_TELEMETRY, newValue)); @@ -1321,7 +1309,7 @@ public TelemetryPreferences getTelemetryPreferences() { return telemetryPreferences; } - private String getOrCreateUserId() { + private String getTelemetryUserId() { Optional userId = getAsOptional(USER_ID); if (userId.isPresent()) { return userId.get(); @@ -2202,7 +2190,7 @@ private String determineMainFileDirectory(String originalDirectory) { // A non-empty directory is kept return originalDirectory; } - return JabRefDesktop.getDefaultFileChooserDirectory().toString(); + return JabRefDesktop.getDefaultFileChooserDirectory(); } @Override @@ -2574,8 +2562,13 @@ public GuiPreferences getGuiPreferences() { EasyBind.listen(guiPreferences.sizeXProperty(), (obs, oldValue, newValue) -> putDouble(SIZE_X, newValue.doubleValue())); EasyBind.listen(guiPreferences.sizeYProperty(), (obs, oldValue, newValue) -> putDouble(SIZE_Y, newValue.doubleValue())); EasyBind.listen(guiPreferences.windowMaximisedProperty(), (obs, oldValue, newValue) -> putBoolean(WINDOW_MAXIMISED, newValue)); - guiPreferences.getLastFilesOpened().addListener((InvalidationListener) change -> - putStringList(LAST_EDITED, guiPreferences.getLastFilesOpened())); + guiPreferences.getLastFilesOpened().addListener((ListChangeListener) change -> { + if (change.getList().isEmpty()) { + prefs.remove(LAST_EDITED); + } else { + putStringList(LAST_EDITED, guiPreferences.getLastFilesOpened()); + } + }); EasyBind.listen(guiPreferences.lastFocusedFileProperty(), (obs, oldValue, newValue) -> { if (newValue != null) { put(LAST_FOCUSED, newValue.toAbsolutePath().toString()); @@ -2583,7 +2576,7 @@ public GuiPreferences getGuiPreferences() { remove(LAST_EDITED); } }); - guiPreferences.getFileHistory().getHistory().addListener((InvalidationListener) change -> storeFileHistory(guiPreferences.getFileHistory())); + guiPreferences.getFileHistory().addListener((InvalidationListener) change -> storeFileHistory(guiPreferences.getFileHistory())); EasyBind.listen(guiPreferences.lastSelectedIdBasedFetcherProperty(), (obs, oldValue, newValue) -> put(ID_ENTRY_GENERATOR, newValue)); EasyBind.listen(guiPreferences.mergeDiffModeProperty(), (obs, oldValue, newValue) -> put(MERGE_ENTRIES_DIFF_MODE, newValue.name())); EasyBind.listen(guiPreferences.sidePaneWidthProperty(), (obs, oldValue, newValue) -> putDouble(SIDE_PANE_WIDTH, newValue.doubleValue())); @@ -2592,24 +2585,16 @@ public GuiPreferences getGuiPreferences() { } private FileHistory getFileHistory() { - return new FileHistory(getStringList(RECENT_DATABASES).stream() - .map(Path::of) - .collect(Collectors.toList())); + return FileHistory.of(getStringList(RECENT_DATABASES).stream() + .map(Path::of) + .toList()); } private void storeFileHistory(FileHistory history) { - if (!history.isEmpty()) { - putStringList(RECENT_DATABASES, history.getHistory() - .stream() - .map(Path::toAbsolutePath) - .map(Path::toString) - .collect(Collectors.toList())); - } - } - - @Override - public void clearEditedFiles() { - prefs.remove(LAST_EDITED); + putStringList(RECENT_DATABASES, history.stream() + .map(Path::toAbsolutePath) + .map(Path::toString) + .toList()); } //************************************************************************************************************* diff --git a/src/main/java/org/jabref/preferences/PreferencesService.java b/src/main/java/org/jabref/preferences/PreferencesService.java index 7da5fdda1a9..678ecfe37a3 100644 --- a/src/main/java/org/jabref/preferences/PreferencesService.java +++ b/src/main/java/org/jabref/preferences/PreferencesService.java @@ -26,7 +26,6 @@ import org.jabref.logic.importer.fetcher.GrobidPreferences; import org.jabref.logic.journals.JournalAbbreviationPreferences; import org.jabref.logic.journals.JournalAbbreviationRepository; -import org.jabref.logic.l10n.Language; import org.jabref.logic.layout.LayoutFormatterPreferences; import org.jabref.logic.layout.format.FileLinkPreferences; import org.jabref.logic.layout.format.NameFormatterPreferences; @@ -111,10 +110,6 @@ public interface PreferencesService { // GeneralPreferences //************************************************************************************************************* - Language getLanguage(); - - void setLanguage(Language language); - GeneralPreferences getGeneralPreferences(); TelemetryPreferences getTelemetryPreferences(); @@ -247,8 +242,6 @@ public interface PreferencesService { GuiPreferences getGuiPreferences(); - void clearEditedFiles(); - //************************************************************************************************************* // Misc preferences //************************************************************************************************************* diff --git a/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java b/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java index 6210e48b96b..d662162c520 100644 --- a/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java +++ b/src/test/java/org/jabref/logic/formatter/casechanger/CapitalizeFormatterTest.java @@ -43,6 +43,13 @@ public void formatExample() { "UPPER {E}ACH {NOT} FIRST, Upper {E}ach {NOT} First", // multiple words upper case with {} "upper each first {NOT} {this}, Upper Each First {NOT} {this}", // multiple words in lower and upper case with {} "upper each first {N}OT {t}his, Upper Each First {N}ot {t}his", // multiple words in lower and upper case with {} part 2 + "upper-each-first, Upper-Each-First", // multiple words lower case with - + "Upper-Each-First, Upper-Each-First", // multiple words correct with - + "Upper-each-First, Upper-Each-First", // multiple words in lower and upper case with - + "UPPER-EACH-FIRST, Upper-Each-First", // multiple words upper case with - + "{u}pper-each-{f}irst, {u}pper-Each-{f}irst", // multiple words lower case with {} and - + "-upper, -Upper", // single word with - + "-{u}pper, -{u}pper", // single word with {} and - }) public void testInputs(String input, String expectedResult) { String formattedStr = formatter.format(input); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java index 884b048d416..7eac2f723a0 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/AstrophysicsDataSystemTest.java @@ -44,102 +44,96 @@ public void setUp() throws Exception { mock(FieldContentFormatterPreferences.class)); fetcher = new AstrophysicsDataSystem(importFormatPreferences, importerPreferences); - diezSliceTheoremEntry = new BibEntry(); - diezSliceTheoremEntry.setType(StandardEntryType.Article); - diezSliceTheoremEntry.setCitationKey("2018arXiv181204698D"); - diezSliceTheoremEntry.setField(StandardField.AUTHOR, "Diez, Tobias and Rudolph, Gerd"); - diezSliceTheoremEntry.setField(StandardField.TITLE, "Slice theorem and orbit type stratification in infinite dimensions"); - diezSliceTheoremEntry.setField(StandardField.YEAR, "2018"); - diezSliceTheoremEntry.setField(StandardField.ARCHIVEPREFIX, "arXiv"); - diezSliceTheoremEntry.setField(StandardField.EPRINT, "1812.04698"); - diezSliceTheoremEntry.setField(StandardField.JOURNAL, "arXiv e-prints"); - diezSliceTheoremEntry.setField(StandardField.KEYWORDS, "Mathematics - Differential Geometry, Mathematical Physics, 58B25, (58D19, 58B20, 22E99, 58A35)"); - diezSliceTheoremEntry.setField(StandardField.MONTH, "#dec#"); - diezSliceTheoremEntry.setField(StandardField.PAGES, "arXiv:1812.04698"); - diezSliceTheoremEntry.setField(StandardField.EID, "arXiv:1812.04698"); - diezSliceTheoremEntry.setField(StandardField.PRIMARYCLASS, "math.DG"); - diezSliceTheoremEntry.setField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2018arXiv181204698D"); - diezSliceTheoremEntry.setField(StandardField.ABSTRACT, - "We establish a general slice theorem for the action of a locally convex Lie group on a locally convex manifold, which generalizes the classical slice theorem of Palais to infinite dimensions. We discuss two important settings under which the assumptions of this theorem are fulfilled. First, using Gl{\\\"o}ckner's inverse function theorem, we show that the linear action of a compact Lie group on a Fr{\\'e}chet space admits a slice. Second, using the Nash--Moser theorem, we establish a slice theorem for the tame action of a tame Fr{\\'e}chet Lie group on a tame Fr{\\'e}chet manifold. For this purpose, we develop the concept of a graded Riemannian metric, which allows the construction of a path-length metric compatible with the manifold topology and of a local addition. Finally, generalizing a classical result in finite dimensions, we prove that the existence of a slice implies that the decomposition of the manifold into orbit types of the group action is a stratification."); - - famaeyMcGaughEntry = new BibEntry(); - famaeyMcGaughEntry.setType(StandardEntryType.Article); - famaeyMcGaughEntry.setCitationKey("2012LRR....15...10F"); - famaeyMcGaughEntry.setField(StandardField.AUTHOR, "Famaey, Beno{\\^\\i}t and McGaugh, Stacy S."); - famaeyMcGaughEntry.setField(StandardField.TITLE, "Modified Newtonian Dynamics (MOND): Observational Phenomenology and Relativistic Extensions"); - famaeyMcGaughEntry.setField(StandardField.JOURNAL, "Living Reviews in Relativity"); - famaeyMcGaughEntry.setField(StandardField.YEAR, "2012"); - famaeyMcGaughEntry.setField(StandardField.VOLUME, "15"); - famaeyMcGaughEntry.setField(StandardField.MONTH, "#sep#"); - famaeyMcGaughEntry.setField(StandardField.NUMBER, "1"); - famaeyMcGaughEntry.setField(StandardField.ARCHIVEPREFIX, "arXiv"); - famaeyMcGaughEntry.setField(StandardField.DOI, "10.12942/lrr-2012-10"); - famaeyMcGaughEntry.setField(StandardField.PRIMARYCLASS, "astro-ph.CO"); - famaeyMcGaughEntry.setField(StandardField.EID, "10"); - famaeyMcGaughEntry.setField(StandardField.EPRINT, "1112.3960"); - famaeyMcGaughEntry.setField(StandardField.PAGES, "10"); - famaeyMcGaughEntry.setField(StandardField.KEYWORDS, "astronomical observations, Newtonian limit, equations of motion, extragalactic astronomy, cosmology, theories of gravity, fundamental physics, astrophysics, Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Astrophysics of Galaxies, General Relativity and Quantum Cosmology, High Energy Physics - Phenomenology, High Energy Physics - Theory"); - famaeyMcGaughEntry.setField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2012LRR....15...10F"); - - sunWelchEntry = new BibEntry(); - sunWelchEntry.setType(StandardEntryType.Article); - sunWelchEntry.setCitationKey("2012NatMa..11...44S"); - sunWelchEntry.setField(StandardField.AUTHOR, "Sun, Yanming and Welch, Gregory C. and Leong, Wei Lin and Takacs, Christopher J. and Bazan, Guillermo C. and Heeger, Alan J."); - sunWelchEntry.setField(StandardField.DOI, "10.1038/nmat3160"); - sunWelchEntry.setField(StandardField.JOURNAL, "Nature Materials"); - sunWelchEntry.setField(StandardField.MONTH, "#jan#"); - sunWelchEntry.setField(StandardField.NUMBER, "1"); - sunWelchEntry.setField(StandardField.PAGES, "44-48"); - sunWelchEntry.setField(StandardField.TITLE, "Solution-processed small-molecule solar cells with 6.7\\% efficiency"); - sunWelchEntry.setField(StandardField.VOLUME, "11"); - sunWelchEntry.setField(StandardField.YEAR, "2012"); - sunWelchEntry.setField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2012NatMa..11...44S"); - - xiongSunEntry = new BibEntry(); - xiongSunEntry.setType(StandardEntryType.Article); - xiongSunEntry.setCitationKey("2007ITGRS..45..879X"); - xiongSunEntry.setField(StandardField.AUTHOR, "Xiong, Xiaoxiong and Sun, Junqiang and Barnes, William and Salomonson, Vincent and Esposito, Joseph and Erives, Hector and Guenther, Bruce"); - xiongSunEntry.setField(StandardField.DOI, "10.1109/TGRS.2006.890567"); - xiongSunEntry.setField(StandardField.JOURNAL, "IEEE Transactions on Geoscience and Remote Sensing"); - xiongSunEntry.setField(StandardField.MONTH, "#apr#"); - xiongSunEntry.setField(StandardField.NUMBER, "4"); - xiongSunEntry.setField(StandardField.PAGES, "879-889"); - xiongSunEntry.setField(StandardField.TITLE, "Multiyear On-Orbit Calibration and Performance of Terra MODIS Reflective Solar Bands"); - xiongSunEntry.setField(StandardField.VOLUME, "45"); - xiongSunEntry.setField(StandardField.YEAR, "2007"); - xiongSunEntry.setField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2007ITGRS..45..879X"); - - ingersollPollardEntry = new BibEntry(); - ingersollPollardEntry.setType(StandardEntryType.Article); - ingersollPollardEntry.setCitationKey("1982Icar...52...62I"); - ingersollPollardEntry.setField(StandardField.ABSTRACT, "If Jupiter's and Saturn's fluid interiors were inviscid and adiabatic, any steady zonal motion would take the form of differentially rotating cylinders concentric about the planetary axis of rotation. B. A. Smith et al. [ Science215, 504-537 (1982)] showed that Saturn's observed zonal wind profile extends a significant distance below cloud base. Further extension into the interior occurs if the values of the eddy viscosity and superadiabaticity are small. We estimate these values using a scaling analysis of deep convection in the presence of differential rotation. The differential rotation inhibits the convection and reduces the effective eddy viscosity. Viscous dissipation of zonal mean kinetic energy is then within the bounds set by the internal heat source. The differential rotation increases the superadiabaticity, but not so much as to eliminate the cylindrical structure of the flow. Very large departures from adiabaticity, necessary for decoupling the atmosphere and interior, do not occur. Using our scaling analysis we develop the anelastic equations that describe motions in Jupiter's and Saturn's interiors. A simple problem is solved, that of an adiabatic fluid with a steady zonal wind varying as a function of cylindrical radius. Low zonal wavenumber perturbations are two dimensional (independent of the axial coordinate) and obey a modified barotropic stability equation. The parameter analogous to {\\ensuremath{\\beta}} is negative and is three to four times larger than the {\\ensuremath{\\beta}} for thin atmospheres. Jupiter's and Saturn's observed zonal wind profiles are close to marginal stability according to this deep sphere criterion, but are several times supercritical according to the thin atmosphere criterion."); - ingersollPollardEntry.setField(StandardField.AUTHOR, "Ingersoll, A. P. and Pollard, D."); - ingersollPollardEntry.setField(StandardField.DOI, "10.1016/0019-1035(82)90169-5"); - ingersollPollardEntry.setField(StandardField.JOURNAL, "\\icarus"); - ingersollPollardEntry.setField(StandardField.KEYWORDS, "Atmospheric Circulation, Barotropic Flow, Convective Flow, Flow Stability, Jupiter Atmosphere, Rotating Fluids, Saturn Atmosphere, Adiabatic Flow, Anelasticity, Compressible Fluids, Planetary Rotation, Rotating Cylinders, Scaling Laws, Wind Profiles, PLANETS, JUPITER, SATURN, MOTION, INTERIORS, ATMOSPHERE, ANALYSIS, SCALE, BAROTROPY, CHARACTERISTICS, STRUCTURE, WINDS, VISCOSITY, DATA, CONVECTION, ROTATION, EDDY EFFECTS, ENERGY, ADIABATICITY, DIAGRAMS, REVIEW, LATITUDE, ZONES, VELOCITY, MATHEMATICAL MODELS, HEAT FLOW, EQUATIONS OF MOTION, FLUIDS, DYNAMICS, TEMPERATURE, GRADIENTS, Lunar and Planetary Exploration; Planets"); - ingersollPollardEntry.setField(StandardField.MONTH, "#oct#"); - ingersollPollardEntry.setField(StandardField.NUMBER, "1"); - ingersollPollardEntry.setField(StandardField.PAGES, "62-80"); - ingersollPollardEntry.setField(StandardField.TITLE, "Motion in the interiors and atmospheres of Jupiter and Saturn: scale analysis, anelastic equations, barotropic stability criterion"); - ingersollPollardEntry.setField(StandardField.VOLUME, "52"); - ingersollPollardEntry.setField(StandardField.YEAR, "1982"); - ingersollPollardEntry.setField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/1982Icar...52...62I"); - - luceyPaulEntry = new BibEntry(); - luceyPaulEntry.setType(StandardEntryType.Article); - luceyPaulEntry.setCitationKey("2000JGR...10520297L"); - luceyPaulEntry.setField(StandardField.AUTHOR, "Lucey, Paul G. and Blewett, David T. and Jolliff, Bradley L."); - luceyPaulEntry.setField(StandardField.DOI, "10.1029/1999JE001117"); - luceyPaulEntry.setField(StandardField.JOURNAL, "\\jgr"); - luceyPaulEntry.setField(StandardField.KEYWORDS, "Planetology: Solid Surface Planets: Composition, Planetology: Solid Surface Planets: Remote sensing, Planetology: Solid Surface Planets: Surface materials and properties, Planetology: Solar System Objects: Moon (1221)"); - luceyPaulEntry.setField(StandardField.PAGES, "20297-20306"); - luceyPaulEntry.setField(StandardField.TITLE, "Lunar iron and titanium abundance algorithms based on final processing of Clementine ultraviolet-visible images"); - luceyPaulEntry.setField(StandardField.VOLUME, "105"); - luceyPaulEntry.setField(StandardField.YEAR, "2000"); - luceyPaulEntry.setField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2000JGR...10520297L"); - luceyPaulEntry.setField(StandardField.MONTH, "#jan#"); - luceyPaulEntry.setField(StandardField.NUMBER, "E8"); - luceyPaulEntry.setField(StandardField.ABSTRACT, "The Clementine mission to the Moon returned global imaging data collected by the ultraviolet visible (UVVIS) camera. This data set is now in a final state of calibration, and a five-band multispectral digital image model (DIM) of the lunar surface will soon be available to the science community. We have used observations of the lunar sample-return sites and stations extracted from the final DIM in conjunction with compositional information for returned lunar soils to revise our previously published algorithms for the spectral determination of the FeO and TiO$_{2}$ content of the lunar surface. The algorithms successfully normalize the effects of space weathering so that composition may be determined without regard to a surface's state of maturity. These algorithms permit anyone with access to the standard archived DIM to construct high spatial resolution maps of FeO and TiO$_{2}$ abundance. Such maps will be of great utility in a variety of lunar geologic studies."); + diezSliceTheoremEntry = new BibEntry(StandardEntryType.Article) + .withCitationKey("2018arXiv181204698D") + .withField(StandardField.AUTHOR, "Diez, Tobias and Rudolph, Gerd") + .withField(StandardField.TITLE, "Slice theorem and orbit type stratification in infinite dimensions") + .withField(StandardField.YEAR, "2018") + .withField(StandardField.ARCHIVEPREFIX, "arXiv") + .withField(StandardField.EPRINT, "1812.04698") + .withField(StandardField.JOURNAL, "arXiv e-prints") + .withField(StandardField.KEYWORDS, "Mathematics - Differential Geometry, Mathematical Physics, 58B25, (58D19, 58B20, 22E99, 58A35)") + .withField(StandardField.MONTH, "#dec#") + .withField(StandardField.PAGES, "arXiv:1812.04698") + .withField(StandardField.EID, "arXiv:1812.04698") + .withField(StandardField.PRIMARYCLASS, "math.DG") + .withField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2018arXiv181204698D") + .withField(StandardField.ABSTRACT, + "We establish a general slice theorem for the action of a locally convex Lie group on a locally convex manifold, which generalizes the classical slice theorem of Palais to infinite dimensions. We discuss two important settings under which the assumptions of this theorem are fulfilled. First, using Gl{\\\"o}ckner's inverse function theorem, we show that the linear action of a compact Lie group on a Fr{\\'e}chet space admits a slice. Second, using the Nash--Moser theorem, we establish a slice theorem for the tame action of a tame Fr{\\'e}chet Lie group on a tame Fr{\\'e}chet manifold. For this purpose, we develop the concept of a graded Riemannian metric, which allows the construction of a path-length metric compatible with the manifold topology and of a local addition. Finally, generalizing a classical result in finite dimensions, we prove that the existence of a slice implies that the decomposition of the manifold into orbit types of the group action is a stratification."); + + famaeyMcGaughEntry = new BibEntry(StandardEntryType.Article) + .withCitationKey("2012LRR....15...10F") + .withField(StandardField.AUTHOR, "Famaey, Beno{\\^\\i}t and McGaugh, Stacy S.") + .withField(StandardField.TITLE, "Modified Newtonian Dynamics (MOND): Observational Phenomenology and Relativistic Extensions") + .withField(StandardField.JOURNAL, "Living Reviews in Relativity") + .withField(StandardField.YEAR, "2012") + .withField(StandardField.VOLUME, "15") + .withField(StandardField.MONTH, "#sep#") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.ARCHIVEPREFIX, "arXiv") + .withField(StandardField.DOI, "10.12942/lrr-2012-10") + .withField(StandardField.PRIMARYCLASS, "astro-ph.CO") + .withField(StandardField.EID, "10") + .withField(StandardField.EPRINT, "1112.3960") + .withField(StandardField.PAGES, "10") + .withField(StandardField.KEYWORDS, "astronomical observations, Newtonian limit, equations of motion, extragalactic astronomy, cosmology, theories of gravity, fundamental physics, astrophysics, Astrophysics - Cosmology and Nongalactic Astrophysics, Astrophysics - Astrophysics of Galaxies, General Relativity and Quantum Cosmology, High Energy Physics - Phenomenology, High Energy Physics - Theory") + .withField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2012LRR....15...10F"); + + sunWelchEntry = new BibEntry(StandardEntryType.Article) + .withCitationKey("2012NatMa..11...44S") + .withField(StandardField.AUTHOR, "Sun, Yanming and Welch, Gregory C. and Leong, Wei Lin and Takacs, Christopher J. and Bazan, Guillermo C. and Heeger, Alan J.") + .withField(StandardField.DOI, "10.1038/nmat3160") + .withField(StandardField.JOURNAL, "Nature Materials") + .withField(StandardField.MONTH, "#jan#") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "44-48") + .withField(StandardField.TITLE, "Solution-processed small-molecule solar cells with 6.7\\% efficiency") + .withField(StandardField.VOLUME, "11") + .withField(StandardField.YEAR, "2012") + .withField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2012NatMa..11...44S"); + + xiongSunEntry = new BibEntry(StandardEntryType.Article) + .withCitationKey("2007ITGRS..45..879X") + .withField(StandardField.AUTHOR, "Xiong, Xiaoxiong and Sun, Junqiang and Barnes, William and Salomonson, Vincent and Esposito, Joseph and Erives, Hector and Guenther, Bruce") + .withField(StandardField.DOI, "10.1109/TGRS.2006.890567") + .withField(StandardField.JOURNAL, "IEEE Transactions on Geoscience and Remote Sensing") + .withField(StandardField.MONTH, "#apr#") + .withField(StandardField.NUMBER, "4") + .withField(StandardField.PAGES, "879-889") + .withField(StandardField.TITLE, "Multiyear On-Orbit Calibration and Performance of Terra MODIS Reflective Solar Bands") + .withField(StandardField.VOLUME, "45") + .withField(StandardField.YEAR, "2007") + .withField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2007ITGRS..45..879X"); + + ingersollPollardEntry = new BibEntry(StandardEntryType.Article) + .withCitationKey("1982Icar...52...62I") + .withField(StandardField.ABSTRACT, "If Jupiter's and Saturn's fluid interiors were inviscid and adiabatic, any steady zonal motion would take the form of differentially rotating cylinders concentric about the planetary axis of rotation. B. A. Smith et al. [ Science215, 504-537 (1982)] showed that Saturn's observed zonal wind profile extends a significant distance below cloud base. Further extension into the interior occurs if the values of the eddy viscosity and superadiabaticity are small. We estimate these values using a scaling analysis of deep convection in the presence of differential rotation. The differential rotation inhibits the convection and reduces the effective eddy viscosity. Viscous dissipation of zonal mean kinetic energy is then within the bounds set by the internal heat source. The differential rotation increases the superadiabaticity, but not so much as to eliminate the cylindrical structure of the flow. Very large departures from adiabaticity, necessary for decoupling the atmosphere and interior, do not occur. Using our scaling analysis we develop the anelastic equations that describe motions in Jupiter's and Saturn's interiors. A simple problem is solved, that of an adiabatic fluid with a steady zonal wind varying as a function of cylindrical radius. Low zonal wavenumber perturbations are two dimensional (independent of the axial coordinate) and obey a modified barotropic stability equation. The parameter analogous to {\\ensuremath{\\beta}} is negative and is three to four times larger than the {\\ensuremath{\\beta}} for thin atmospheres. Jupiter's and Saturn's observed zonal wind profiles are close to marginal stability according to this deep sphere criterion, but are several times supercritical according to the thin atmosphere criterion.") + .withField(StandardField.AUTHOR, "Ingersoll, A.~P. and Pollard, D.") + .withField(StandardField.DOI, "10.1016/0019-1035(82)90169-5") + .withField(StandardField.JOURNAL, "\\icarus") + .withField(StandardField.KEYWORDS, "Atmospheric Circulation, Barotropic Flow, Convective Flow, Flow Stability, Jupiter Atmosphere, Rotating Fluids, Saturn Atmosphere, Adiabatic Flow, Anelasticity, Compressible Fluids, Planetary Rotation, Rotating Cylinders, Scaling Laws, Wind Profiles, PLANETS, JUPITER, SATURN, MOTION, INTERIORS, ATMOSPHERE, ANALYSIS, SCALE, BAROTROPY, CHARACTERISTICS, STRUCTURE, WINDS, VISCOSITY, DATA, CONVECTION, ROTATION, EDDY EFFECTS, ENERGY, ADIABATICITY, DIAGRAMS, REVIEW, LATITUDE, ZONES, VELOCITY, MATHEMATICAL MODELS, HEAT FLOW, EQUATIONS OF MOTION, FLUIDS, DYNAMICS, TEMPERATURE, GRADIENTS, Lunar and Planetary Exploration; Planets") + .withField(StandardField.MONTH, "#oct#") + .withField(StandardField.NUMBER, "1") + .withField(StandardField.PAGES, "62-80") + .withField(StandardField.TITLE, "Motion in the interiors and atmospheres of Jupiter and Saturn: scale analysis, anelastic equations, barotropic stability criterion") + .withField(StandardField.VOLUME, "52") + .withField(StandardField.YEAR, "1982") + .withField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/1982Icar...52...62I"); + + luceyPaulEntry = new BibEntry(StandardEntryType.Article) + .withCitationKey("2000JGR...10520297L") + .withField(StandardField.AUTHOR, "Lucey, Paul G. and Blewett, David T. and Jolliff, Bradley L.") + .withField(StandardField.DOI, "10.1029/1999JE001117") + .withField(StandardField.JOURNAL, "\\jgr") + .withField(StandardField.KEYWORDS, "Planetology: Solid Surface Planets: Composition, Planetology: Solid Surface Planets: Remote sensing, Planetology: Solid Surface Planets: Surface materials and properties, Planetology: Solar System Objects: Moon (1221)") + .withField(StandardField.PAGES, "20297-20306") + .withField(StandardField.TITLE, "Lunar iron and titanium abundance algorithms based on final processing of Clementine ultraviolet-visible images") + .withField(StandardField.VOLUME, "105") + .withField(StandardField.YEAR, "2000") + .withField(StandardField.URL, "https://ui.adsabs.harvard.edu/abs/2000JGR...10520297L") + .withField(StandardField.MONTH, "#jan#") + .withField(StandardField.NUMBER, "E8") + .withField(StandardField.ABSTRACT, "The Clementine mission to the Moon returned global imaging data collected by the ultraviolet visible (UVVIS) camera. This data set is now in a final state of calibration, and a five-band multispectral digital image model (DIM) of the lunar surface will soon be available to the science community. We have used observations of the lunar sample-return sites and stations extracted from the final DIM in conjunction with compositional information for returned lunar soils to revise our previously published algorithms for the spectral determination of the FeO and TiO$_{2}$ content of the lunar surface. The algorithms successfully normalize the effects of space weathering so that composition may be determined without regard to a surface's state of maturity. These algorithms permit anyone with access to the standard archived DIM to construct high spatial resolution maps of FeO and TiO$_{2}$ abundance. Such maps will be of great utility in a variety of lunar geologic studies."); } @Test @@ -156,9 +150,9 @@ public void searchByQueryFindsEntry() throws Exception { @Test public void searchByEntryFindsEntry() throws Exception { - BibEntry searchEntry = new BibEntry(); - searchEntry.setField(StandardField.TITLE, "slice theorem"); - searchEntry.setField(StandardField.AUTHOR, "Diez"); + BibEntry searchEntry = new BibEntry() + .withField(StandardField.TITLE, "slice theorem") + .withField(StandardField.AUTHOR, "Diez"); List fetchedEntries = fetcher.performSearch(searchEntry); diff --git a/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java b/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java index 367e2f6be9a..1883b908fa8 100644 --- a/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java +++ b/src/test/java/org/jabref/logic/importer/fetcher/CompositeIdFetcherTest.java @@ -41,6 +41,7 @@ public static Stream performSearchByIdReturnsCorrectEntryForIdentifie .withField(StandardField.DATE, "2021-10-06") .withField(StandardField.ABSTRACT, "In the era of large-scale spectroscopic surveys in the Local Group (LG), we can explore using chemical abundances of halo stars to study the star formation and chemical enrichment histories of the dwarf galaxy progenitors of the Milky Way (MW) and M31 stellar halos. In this paper, we investigate using the Chemical Abundance Ratio Distributions (CARDs) of seven stellar halos from the Latte suite of FIRE-2 simulations. We attempt to infer galaxies' assembly histories by modelling the CARDs of the stellar halos of the Latte galaxies as a linear combination of template CARDs from disrupted dwarfs, with different stellar masses $M_{\\star}$ and quenching times $t_{100}$. We present a method for constructing these templates using present-day dwarf galaxies. For four of the seven Latte halos studied in this work, we recover the mass spectrum of accreted dwarfs to a precision of $<10\\%$. For the fraction of mass accreted as a function of $t_{100}$, we find residuals of $20-30\\%$ for five of the seven simulations. We discuss the failure modes of this method, which arise from the diversity of star formation and chemical enrichment histories dwarf galaxies can take. These failure cases can be robustly identified by the high model residuals. Though the CARDs modeling method does not successfully infer the assembly histories in these cases, the CARDs of these disrupted dwarfs contain signatures of their unusual formation histories. Our results are promising for using CARDs to learn more about the histories of the progenitors of the MW and M31 stellar halos.") .withField(StandardField.EPRINT, "2110.02957") + .withField(StandardField.DOI, "10.3847/1538-4357/ac78ea") .withField(StandardField.FILE, ":http\\://arxiv.org/pdf/2110.02957v1:PDF") .withField(StandardField.EPRINTTYPE, "arXiv") .withField(StandardField.EPRINTCLASS, "astro-ph.GA") diff --git a/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java b/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java index 38f63a6c87d..6d37300cfa3 100644 --- a/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java +++ b/src/test/java/org/jabref/logic/util/io/FileHistoryTest.java @@ -1,8 +1,8 @@ package org.jabref.logic.util.io; import java.nio.file.Path; -import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -16,14 +16,14 @@ class FileHistoryTest { @BeforeEach void setUp() { - history = new FileHistory(new ArrayList<>()); + history = FileHistory.of(Collections.emptyList()); } @Test void newItemsAreAddedInRightOrder() { history.newFile(Path.of("aa")); history.newFile(Path.of("bb")); - assertEquals(Arrays.asList(Path.of("bb"), Path.of("aa")), history.getHistory()); + assertEquals(Arrays.asList(Path.of("bb"), Path.of("aa")), history); } @Test @@ -31,7 +31,7 @@ void itemsAlreadyInListIsMovedToTop() { history.newFile(Path.of("aa")); history.newFile(Path.of("bb")); history.newFile(Path.of("aa")); - assertEquals(Arrays.asList(Path.of("aa"), Path.of("bb")), history.getHistory()); + assertEquals(Arrays.asList(Path.of("aa"), Path.of("bb")), history); } @Test @@ -42,7 +42,7 @@ void removeItemsLeavesOtherItemsInRightOrder() { history.removeItem(Path.of("bb")); - assertEquals(Arrays.asList(Path.of("cc"), Path.of("aa")), history.getHistory()); + assertEquals(Arrays.asList(Path.of("cc"), Path.of("aa")), history); } @Test @@ -66,7 +66,7 @@ void getFileAtTest() { history.newFile(Path.of("aa")); history.newFile(Path.of("bb")); history.newFile(Path.of("cc")); - assertEquals(Path.of("bb"), history.getFileAt(1)); + assertEquals(Path.of("bb"), history.get(1)); } } diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MODSImporterTestGenreMapping.bib b/src/test/resources/org/jabref/logic/importer/fileformat/MODSImporterTestGenreMapping.bib new file mode 100644 index 00000000000..907ce08b8da --- /dev/null +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MODSImporterTestGenreMapping.bib @@ -0,0 +1,2 @@ +@proceedings{TestPublication, +} diff --git a/src/test/resources/org/jabref/logic/importer/fileformat/MODSImporterTestGenreMapping.xml b/src/test/resources/org/jabref/logic/importer/fileformat/MODSImporterTestGenreMapping.xml new file mode 100644 index 00000000000..ef8ad54b2a2 --- /dev/null +++ b/src/test/resources/org/jabref/logic/importer/fileformat/MODSImporterTestGenreMapping.xml @@ -0,0 +1,8 @@ + + + +Conference Publication +TestPublication + +