diff --git a/.github/workflows/deployment.yml b/.github/workflows/deployment.yml index 5b7c968e62d..35a9cb6bd57 100644 --- a/.github/workflows/deployment.yml +++ b/.github/workflows/deployment.yml @@ -11,17 +11,17 @@ jobs: include: - os: ubuntu-latest displayName: linux - jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-49_linux-x64_bin.tar.gz + jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-64_linux-x64_bin.tar.gz jdk14Path: /jdk-14 archivePortable: tar -czf build/distribution/JabRef-portable_linux.tar.gz -C build/distribution JabRef && rm -R build/distribution/JabRef - os: windows-latest displayName: windows - jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-49_windows-x64_bin.zip + jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-64_windows-x64_bin.zip jdk14Path: /jdk-14 archivePortable: 7z a -r build/distribution/JabRef-portable_windows.zip ./build/distribution/JabRef && rm -R build/distribution/JabRef - os: macOS-latest displayName: macOS - jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-49_osx-x64_bin.tar.gz + jpackageDownload: https://download.java.net/java/early_access/jpackage/1/openjdk-14-jpackage+1-64_osx-x64_bin.tar.gz jdk14Path: /jdk-14.jdk/Contents/Home archivePortable: tar -czf build/distribution/JabRef-portable_macos.tar.gz -C build/distribution JabRef.app && rm -R build/distribution/JabRef.app diff --git a/.gitignore b/.gitignore index 62ceb1d36b6..f7b59d835e0 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,10 @@ prime/ jabref_source.tar.bz2 snap/.snapcraft/ +# flatpak +flatpak/.buildconfig +flatpak/JabRef-portable_linux.tar.gz + # Gradle # generated when `gradlew --gui` is called ui/ @@ -443,4 +447,4 @@ gradle-app.setting -!/buildSrc/src/main/groovy/org/jabref/build - -# do not ignore JabRef icons (they are ignored by the macos setting above) --!src/main/java/org/jabref/gui/icon \ No newline at end of file +-!src/main/java/org/jabref/gui/icon diff --git a/.mailmap b/.mailmap index 3af3033fd28..86204ffb676 100644 --- a/.mailmap +++ b/.mailmap @@ -91,8 +91,8 @@ Ulrik Stervbo Stefano Gariazzo Lee Patton Jörg Lenhard - - +Jörg Lenhard +Jörg Lenhard Jörg Lenhard Matthias Geiger Christoph Braun @@ -110,6 +110,8 @@ Jens Döcke Jürgen Lange Sascha Zeller Ali Ayan +Ali Zhagparov +Ali Zhagparov Arno Blouin Jeff Miller Alain Vaucher @@ -144,3 +146,42 @@ Cerrianne Santos Stefan Scheffel Stefan Gerzmann Deepak Kumar +Aman Jain +Ayachi Nene <1710082010@qq.com> +Jan Schäfer +Stefan Scheffel +Stefan Scheffel +Yash Kothari +Quentin Fritz <49909555+core-master@users.noreply.github.com> +Daniel Rodrigues +Malte Deiseroth +Malik Atalla <6626492+HerrAachen@users.noreply.github.com> +Kaique Komata +S. Krause +Leonhard Wolz +Manuel Wtfjoke +Valentin Pons +Arthur Fröhlich <37243770+znuznu@users.noreply.github.com> +Songyu Wang <36670132+Songyu-Wang@users.noreply.github.com> +Alex Tarrix +Samiya Caur +Stanley Foerster +Michael McCann +Robin Lichtenthaeler +Rodrigo Paula da Silva +Robert Jäschke +Nick S. Weatherley +Nivedha Sunderraj +Lavabit +Rachel Wu <46014322+rachelwu21@users.noreply.github.com> +Abraham Polk +dima +Fred Stevens +Rui Kang <1539678784@qq.com> +Yurick Honda +Yurick Honda <32721326+yurickyh@users.noreply.github.com> +Mihu <41503450+mmihuu@users.noreply.github.com> +Michael Schwarmi +Michal Rican +Param Mittal +Victor Michelan diff --git a/AUTHORS b/AUTHORS index 799b72a6fdc..e63350a6ba7 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,27 +1,41 @@ # This file lists all individuals having contributed content to the repository. # For how it is generated, see `scripts/generate-authors.sh`. +1160300608 +1160300614 Aaron Chen Abhishek Rai +Abraham Polk Adam Rehn Admir Obralija Adrian Daerr +Akash Deep Alain Vaucher +Aleksandrs Gusevs Alessio Pollero Alex Montgomery +Alex Tarrix Alexis Gallagher Alexsandro Lauber Ali Ayan +Ali Zhagparov Alick Zhao +Allison Sampaio +Aman Jain Ambrogio Oliva Amish Shah Andreas Amann Andreas Buhr Andreas Rudert +Andrew Collins Andrew Levit +Andrés Sánchez Anh Nghia Tran Anita Armbruster Antonio Ribeiro Arno Blouin +Arthur Fröhlich +Atul Kaushik +Ayachi Nene Bartosz J. Kaczkowski Bartłomiej Dach Behrouz Javanmardi @@ -29,10 +43,20 @@ Benjamin Köhler Berk Gureken Bernd Kalbfuss Bernhard Tempel +Bharat Raghunathan +Bhargava Varadharajan +Bherwani Ayush +Bitor Tonixa Biriato Balença Brian Quistorff Brian Van Essen +captain123 +Carl Christian Snethlage +Carlos Morales Carlos Silla Cerrianne Santos +Chamod Shehanka +Chelsey Ong +Chris Brown Christian Bartsch Christian Kopf Christoph Braun @@ -40,56 +64,82 @@ Christoph Hochreiner Christoph Schwentker Christopher Oezbek Christopher S. Lester +conorfos +cs464osu Cyrille d'Haese Dale Visser Daniel Bruehl Daniel Mair +Daniel Rodrigues Daniel Svärd David Gleich +David Méndez David Weitzman +Dawid Owoc +Deepak Kumar Dennis Tschechlov +DevSiroukane +Dilan Coss +dima Domenico Cufalo +Dominik Schrempf Dominik Traczyk Dominik Waßenhoven Douglas Nassif Roma Junior Eduard Braun Eduardo Greco Egon Willighagen +Eiswindyeti Ellen Reitmayr +Erdem Derebasoglu Erdem Derebaşoğlu Erik Putrycz Ervin Kolenovic +Escoul Ethan Harris Fabian Bauer Fabian Bieker Fabrice Dessaint +Fancy Zhang Fedor Bezrukov Felix Berger Felix Langner Felix Wilke Fernando Santagata +ffffatgoose Florian Beetz Florian Straßer Foivos Christoulakis Francois Charette Frank Steimle +frasca80 +Fred Stevens Frédéric Darboux +Galileo Sartor +Geoffrey Taerim Kim Gert Renckens Gregor Herrmann Guillaume Gardey Hakan Duran Hannes Restel +Harinda Samarasekara Igor Chernyavsky Igor Steinmacher +Illes Solt Ingvar Jackal +Jackson Ryan Jan Frederik Maas Jan Kubovy +Jan Schäfer Janosch Kutscherauer Jason Pickering +Javier Muñoz Ferrara Jeff Kerr Jeff Miller Jeffrey Kuhn +Jeffrey Sander Jens Döcke +Johannes Hupe Johannes Manner John David John Relph @@ -97,8 +147,10 @@ John Zedlewski Jonathan Powell Jong-Ho Shinn Jorge Tornero +josephshin93 Joshua Ramon Enslin Julian Pfeifer +Jure Slak József Pallagi Jörg Lenhard Jörg Wegner @@ -106,67 +158,112 @@ Jörg Zieren Jørgen Kvalsvik Jürgen Lange Kai Mindermann +Kaique Komata Karsten Hiekmann +Kelly Click Koji Yokota +KOLANICH Kolja Brix Krunoslav Zubrinic Krzysztof A. Kościuszkiewicz +Kyle Johnson Laura Hernández Gómez +Lavabit +Le-wi Lee Patton Leonardo Haddad +Leonhard Wolz +Li Yiming +Li Zhilin Ling Wang Linus Dietz Lorenzo Genta Luciana de Melo e Abud Mairieli Wessel +Malik Atalla +Malte Deiseroth Manuel Siebeneicher +Manuel Wtfjoke +Marco Konersmann Mariana Prudencio Marius Kleiner Mark Schenk Martin Kähmer Martin Stolle +Martina Catizone Mathias Walter Matthias Geiger Mattia Bunel Mattias Ulbrich +mcmoody Meltem Demirköprü Michael Beckmann Michael Falkenthal Michael Lass +Michael McCann +Michael Schwarmi Michael Spiegel Michael Wrighton +Michal Rican Michel Baylac +Mihu Mike Smoot +mohamean +Morgan Lovato Moritz Ringler Morten Alver +ms111ds Mélanie Tremblay Nadeem Mahmood Nathan Dunn Nathan Sheffield +Nick Mancuso +Nick S. Weatherley +Nico Schlömer Nicolas Pavillon +Nikita Borovikov +nikmilpv Niv Ierushalmi +Nivedha Sunderraj Nizar N. Batada +noravanq Olaf Lenz Oliver Beckmann Oliver Kopp +omer-rotem1 Oscar Gustafsson Owen Huang +Param Mittal +Patrick Lin Patrick Scheibe +Paul Krappatsch Paul Martin +pavlapp Peter Ansell Philip Johnson +Prasan Yapa Predrag Milanovic +Quentin Fritz +Rachel Wu Raik Nagel +razvan05 Renato Massao Richard Schneeman Robert Jäschke +Robin Lichtenthaeler +Rodrigo Paula da Silva Rolf Starre +Ronak Lakhotia +Roy Storey Rudolf Seemann +Rui Kang Ruy Minoru Ito Takata Ryo Igarashi S M Mahbub Murshed +S. Krause Saivert Samin Muhammad Ridwanul Karim +Samiya Caur Sascha Hunold Sascha Zeller Saulius Gražulis @@ -174,39 +271,61 @@ Saverio Mori Scott Pogatetz Scott Townsend Seb Wills +Serban Iordache Shitikanth +shubhamatlani Simon Harrer Simon Rutishauser +Songyu Wang +speed9 +Stanley Foerster Stefan Feyer Stefan Gerzmann Stefan Kolb Stefan Robert +Stefan Scheffel Stefano Gariazzo +Steffin Stanly Stephan Lau Stephan Rave +Stephen Beitzel Stéphane Curet +Super-Tang Sven Jäger Thiago Toledo Thomas Arildsen Thomas Ilsche Thorsten Dahlheimer +Tim Kilian Tim van Rossum Tim Würtele Tobias Boceck Tobias Bouschen Tobias Denkinger Tobias Diez +Tony K Toralf Senger +uid112001 Ulrich Stärk Ulrik Stervbo Uwe Kuehn +Valentin Pons +Victor Figueira +Victor Michelan Vincent W. Yang +Vlad Topala Waida Fan Waluyo Adi Siswanto Ward Poelmans Wenbo Yang +wuw Yang Zongze Yara Grassi Gouffon +Yash Kothari +Yichen Sun Yifan Peng +Yurick Honda +zacmks +Zeabin +Zgarbul Andrey Zhang Liang -Nikita Borovikov diff --git a/CHANGELOG.md b/CHANGELOG.md index ed9808660c1..4e097a40231 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We added an option to show the preview as an extra tab in the entry editor (instead of in a split view). [#5244](https://github.com/JabRef/jabref/issues/5244) - A custom Open/LibreOffice jstyle file now requires a layout line for the entry type `default` [#5452](https://github.com/JabRef/jabref/issues/5452) - The entry editor is now open by default when JabRef starts up. [#5460](https://github.com/JabRef/jabref/issues/5460) -- We add a new ADS fetcher to use the new ADS API [#4949](https://github.com/JabRef/jabref/issues/4949) +- We added a new ADS fetcher to use the new ADS API [#4949](https://github.com/JabRef/jabref/issues/4949) +- We added support of the [X11 primary selection](https://unix.stackexchange.com/a/139193/18033) [#2389](https://github.com/JabRef/jabref/issues/2389) ### Fixed @@ -26,12 +27,16 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where it was no longer possible to connect to LibreOffice. [#5261](https://github.com/JabRef/jabref/issues/5261) - The "All entries group" is no longer shown when no library is open. - We fixed an exception which occurred when closing JabRef. [#5348](https://github.com/JabRef/jabref/issues/5348) +- We fixed an issue where JabRef reports incorrectly about customized entry types. [#5332](https://github.com/JabRef/jabref/issues/5332) - We fixed a few problems that prevented JabFox to communicate with JabRef. [#4737](https://github.com/JabRef/jabref/issues/4737) [#4303](https://github.com/JabRef/jabref/issues/4303) - We fixed an error where the groups containing an entry loose their highlight color when scrolling. [#5022](https://github.com/JabRef/jabref/issues/5022) +- We fixed an error where scrollbars were not shown. [#5374](https://github.com/JabRef/jabref/issues/5374) - We fixed an error where an exception was thrown when merging entries. [#5169](https://github.com/JabRef/jabref/issues/5169) +- We fixed an error where certain metadata items were not serialized alphabetically. - After assigning an entry to a group, the item count is now properly colored to reflect the new membership of the entry. [#3112](https://github.com/JabRef/jabref/issues/3112) - The group panel is now properly updated when switching between libraries (or when closing/opening one). [#3142](https://github.com/JabRef/jabref/issues/3142) - We fixed an error where the number of matched entries shown in the group pane was not updated correctly. [#4441](https://github.com/JabRef/jabref/issues/4441) +- We fixed a "null" error when writing XMP metadata. [#5449](https://github.com/JabRef/jabref/issues/5449) - We fixed an issue where empty keywords lead to a strange display of automatic keyword groups. [#5333](https://github.com/JabRef/jabref/issues/5333) - We fixed an error where the default color of a new group was white instead of dark gray. [#4868](https://github.com/JabRef/jabref/issues/4868) - We fixed an issue where the first field in the entry editor got the focus while performing a different action (like searching). [#5084](https://github.com/JabRef/jabref/issues/5084) @@ -51,6 +56,8 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - After successful import of one or multiple bib entries the main table scrolls to the first imported entry [#5383](https://github.com/JabRef/jabref/issues/5383) - We fixed an exception which occurred when an invalid jstyle was loaded. [#5452](https://github.com/JabRef/jabref/issues/5452) - We fixed an error where the preview theme did not adapt to the "Dark" mode [#5463](https://github.com/JabRef/jabref/issues/5463) +- We fixed an issue where the merge dialog showed the wrong text colour in "Dark" mode [#5516](https://github.com/JabRef/jabref/issues/5516) +- We fixed an issue where the author field was not correctly parsed during bibtex key-generation. [#5551](https://github.com/JabRef/jabref/issues/5551) ### Removed diff --git a/build.gradle b/build.gradle index aea2fe14bd5..a05e0de53f6 100644 --- a/build.gradle +++ b/build.gradle @@ -17,7 +17,7 @@ buildscript { plugins { id 'application' - id 'com.gradle.build-scan' version '2.4.2' + id 'com.gradle.build-scan' version '3.0' id "com.simonharrer.modernizer" version '1.8.0-1' id 'me.champeau.gradle.jmh' version '0.4.8' //id 'net.ltgt.errorprone' version '0.8.1' @@ -30,6 +30,8 @@ plugins { // use the gradle build scan feature: https://scans.gradle.com/get-started buildScan { termsOfServiceUrl = 'https://gradle.com/terms-of-service'; termsOfServiceAgree = 'yes' } +gradle.startParameter.showStacktrace = org.gradle.api.logging.configuration.ShowStacktrace.ALWAYS + apply plugin: 'java' apply plugin: 'application' apply plugin: 'project-report' @@ -111,6 +113,8 @@ dependencies { compile 'org.apache.pdfbox:fontbox:2.0.17' compile 'org.apache.pdfbox:xmpbox:2.0.17' + compile group: 'org.apache.commons', name: 'commons-csv', version: '1.7' + compile group: 'org.apache.tika', name: 'tika-core', version: '1.22' // required for reading write-protected PDFs - see https://github.com/JabRef/jabref/pull/942#issuecomment-209252635 @@ -159,7 +163,7 @@ dependencies { compile 'org.controlsfx:controlsfx:11.0.0' compile 'org.jsoup:jsoup:1.12.1' - compile 'com.mashape.unirest:unirest-java:1.4.9' + compile 'com.konghq:unirest-java:3.1.03' compile 'org.slf4j:slf4j-api:2.0.0-alpha1' compile group: 'org.apache.logging.log4j', name: 'log4j-jcl', version: '3.0.0-SNAPSHOT' @@ -214,7 +218,7 @@ dependencies { testCompile "org.testfx:testfx-core:4.0.15-alpha" testCompile "org.testfx:testfx-junit5:4.0.15-alpha" - checkstyle 'com.puppycrawl.tools:checkstyle:8.25' + checkstyle 'com.puppycrawl.tools:checkstyle:8.26' xjc group: 'org.glassfish.jaxb', name: 'jaxb-xjc', version: '2.3.2' jython 'org.python:jython-standalone:2.7.1' } @@ -587,7 +591,8 @@ jlink { '--vendor', 'JabRef', '--app-version', "${project.version}", '--win-upgrade-uuid', 'd636b4ee-6f10-451e-bf57-c89656780e36', - '--win-dir-chooser', + // temporarily disabled due to conflict with Jpackage update + //'--win-dir-chooser', '--win-shortcut', '--temp', "$buildDir/installer", '--resource-dir', "${projectDir}/buildres/windows" diff --git a/buildres/linux/jabrefHost.py b/buildres/linux/jabrefHost.py old mode 100644 new mode 100755 diff --git a/buildres/linux/postinst b/buildres/linux/postinst index 40791c02384..ea5525ebd03 100644 --- a/buildres/linux/postinst +++ b/buildres/linux/postinst @@ -19,8 +19,8 @@ set -e case "$1" in configure) - INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts/" - install -D -m0755 /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH + INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts" + install -D -m0755 /opt/jabref/lib/org.jabref.jabref.json $INSTALL_PATH/org.jabref.jabref.json DESKTOP_COMMANDS_INSTALL ;; diff --git a/buildres/linux/postrm b/buildres/linux/postrm index 7cb08bc3746..2cd3bfb9079 100644 --- a/buildres/linux/postrm +++ b/buildres/linux/postrm @@ -18,9 +18,9 @@ set -e # the debian-policy package case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - INSTALL_PATH="/usr/lib/mozilla/native-messaging-hosts" - if grep --quiet '"path": "/opt' $INSTALL_PATH/org.jabref.jabref.json; then - rm $INSTALL_PATH/org.jabref.jabref.json + NATIVE_MESSAGING_JSON="/usr/lib/mozilla/native-messaging-hosts/org.jabref.jabref.json" + if [ -e $NATIVE_MESSAGING_JSON ] && grep --quiet '"path": "/opt' $NATIVE_MESSAGING_JSON; then + rm $NATIVE_MESSAGING_JSON fi ;; diff --git a/buildres/windows/JabRef-post-image.wsf b/buildres/windows/JabRef-post-image.wsf index aa1b3e90030..b7feaf3c66d 100644 --- a/buildres/windows/JabRef-post-image.wsf +++ b/buildres/windows/JabRef-post-image.wsf @@ -11,7 +11,7 @@ // Copy additional installer resources fileSystem.CopyFile(jabRefRoot + "/buildres/windows/JabRefTopBanner.bmp", installerConfig); - var wxsFilePath = installerConfig + "JabRef.wxs"; + var wxsFilePath = jabRefRoot + "/buildres/windows/JabRef.wxs"; wxsFile = fileSystem.OpenTextFile(wxsFilePath, 1); var contents = wxsFile.ReadAll(); wxsFile.Close(); diff --git a/buildres/windows/JabRef.wxs b/buildres/windows/JabRef.wxs new file mode 100644 index 00000000000..13bd4c38f6e --- /dev/null +++ b/buildres/windows/JabRef.wxs @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + 1 + + + !(loc.message.install.dir.exist) + + + + + + + + 1 + INSTALLDIR_VALID="0" + INSTALLDIR_VALID="1" + + + + 1 + 1 + + + + + + + + + + + + + + + + + diff --git a/docs/adr/0007-human-readable-changelog.md b/docs/adr/0007-human-readable-changelog.md new file mode 100644 index 00000000000..76c98fd8aa4 --- /dev/null +++ b/docs/adr/0007-human-readable-changelog.md @@ -0,0 +1,22 @@ +# Provide a human-readable changelog + +## Context and Problem Statement + +Changes of a release have to be communicated. +How and which stile to use? + +## Considered Options + +* Keep-a-changelog format with freedom in the bullet points +* Keep-a-changelog format and fixed terms + +## Decision Outcome + +Chosen option: "Keep-a-changelog format with freedom in the bullet points", because + +- [Keep-a-changelog](https://keepachangelog.com/) structures the changelog +- Each entry can be structured to be understandable +- Forcing to prefix each line with `We fixed`, `We changed`, ... seems to be read strange. + We nevertheless try to follow that style. + +Further discussion can be found at [#2277](https://github.com/JabRef/jabref/issues/2277). diff --git a/docs/adr/README.md b/docs/adr/README.md index 37fa76720a7..9fbff0a524c 100644 --- a/docs/adr/README.md +++ b/docs/adr/README.md @@ -12,6 +12,7 @@ This log lists the architectural decisions for JabRef. - [ADR-0004](0004-use-mariadb-connector.md) - Use MariaDB Connector - [ADR-0005](0005-fully-support-utf8-only-for-latex-files.md) - Fully Support UTF-8 Only For LaTeX Files - [ADR-0006](0006-only-translated-strings-in-language-file.md) - Only translated strings in language file +- [ADR-0007](0007-human-readable-changelog.md) - Provide a human-readable changelog diff --git a/external-libraries.txt b/external-libraries.txt index 107ae83f6e4..2c4de64231b 100644 --- a/external-libraries.txt +++ b/external-libraries.txt @@ -1,7 +1,7 @@ This document lists the fonts, icons, and libraries used by JabRef. This file is manually kept in sync with build.gradle and the binary jars contained in the lib/ directory. -One can list all depdencies by using Gradle task `depdencyReport`. +One can list all dependencies by using Gradle task `dependencyReport`. It generated the file [build/reports/project/dependencies.txt](build/reports/project/dependencies.txt). # Legend @@ -16,7 +16,7 @@ Note that the SPDX license identifiers are different from the ones used by debia # Fonts and Icons -The loading animation during loading of recommendations from Mr. DLib is created by and is free of use under licence CC0 1.0. +The loading animation during loading of recommendations from Mr. DLib is created by and is free of use under license CC0 1.0. Id: material-design-icons.font Project: Material Design Icons @@ -50,9 +50,9 @@ Project: pgjdbc-ng URL: http://impossibl.github.io/pgjdbc-ng License: BSD-3-Clause -Id: com.mashape.unirest +Id: com.konghq.unirest Project: Unirest for Java -URL: https://github.com/Mashape/unirest-java +URL: https://github.com/Kong/unirest-java License: MIT Id: com.microsoft.azure:applicationinsights-core @@ -125,6 +125,11 @@ Project: ANTLR 4 URL: http://www.antlr.org/ License: BSD-3-Clause +Id: org.apache.commons:commons-csv +Project: Apache Commons CSV +URL: https://commons.apache.org/proper/commons-csv/ +License: Apache-2.0 + Id: org.apache.commons:commons-lang3 Project: Apache Commons Lang URL: https://commons.apache.org/proper/commons-lang/ diff --git a/flatpak/jabref.desktop b/flatpak/jabref.desktop new file mode 100644 index 00000000000..cb4f0acdc58 --- /dev/null +++ b/flatpak/jabref.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Name=JabRef +GenericName=BibTeX Editor +Comment=JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. +Type=Application +Terminal=false +Icon=org.jabref.jabref +Exec=JabRef %U +Keywords=bibtex;biblatex;latex;bibliography +Categories=Office; +StartupWMClass=org-jabref-JabRefMain +MimeType=text/x-bibtex; diff --git a/flatpak/org.jabref.jabref.json b/flatpak/org.jabref.jabref.json new file mode 100644 index 00000000000..f9d7373f9d8 --- /dev/null +++ b/flatpak/org.jabref.jabref.json @@ -0,0 +1,35 @@ +{ + "app-id" : "org.jabref.jabref", + "runtime" : "org.freedesktop.Platform", + "runtime-version" : "18.08", + "sdk" : "org.freedesktop.Sdk", + "command" : "JabRef", + "modules" : [ + { + "name" : "JabRef", + "buildsystem" : "simple", + "build-commands" : [ + "tar -xzf JabRef-portable_linux.tar.gz --directory=/app/ --strip-components=1", + "install -D -m0644 /app/lib/JabRef.png /app/share/icons/hicolor/64x64/apps/org.jabref.jabref.png", + "install -D -m0644 org.jabref.jabref.desktop /app/share/applications/org.jabref.jabref.desktop" + ], + "sources" : [ + { + "type" : "file", + "url": "http://builds.jabref.org/master/JabRef-portable_linux.tar.gz", + "sha256": "be69feee0536fa8500dda867290dbeeeda6191c60e636a0b6e254fbaac02d471" + }, + { + "type": "file", + "path": "org.jabref.jabref.desktop" + } + ] + } + ], + "finish-args" : [ + "--socket=wayland", + "--socket=fallback-x11", + "--share=network", + "--filesystem=home" + ] +} diff --git a/scripts/generate-authors.sh b/scripts/generate-authors.sh index 37886f0f3b4..e79a6af3383 100755 --- a/scripts/generate-authors.sh +++ b/scripts/generate-authors.sh @@ -57,7 +57,7 @@ cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." # authors %aN = author name # co-authors - coauthors=$(git log --grep=Co-authored | grep "Co-au" | sed "s/.*Co-authored-by: \(.*\) <.*/\1/") - echo -e "$authors\n$(git log --format='%aN')\n$coauthors" | LC_ALL=C.UTF-8 sort --unique --ignore-case + coauthors=$(git log --grep=Co-authored | grep "Co-au" | grep "<" | sed "s/.*Co-authored-by: \(.*\) <.*/\1/") + echo -e "$authors\n$(git log --format='%aN')\n$coauthors" | grep -v "dependabot" | grep -v "halirutan" | grep -v "matthiasgeiger" | grep -v "Gitter Badger" | LC_ALL=C.UTF-8 sort --unique --ignore-case } > AUTHORS diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml index 7648d6f06b5..889418ed128 100644 --- a/snap/snapcraft.yaml +++ b/snap/snapcraft.yaml @@ -50,4 +50,3 @@ parts: snapcraftctl build snapcraftctl set-version "$(cat $SNAPCRAFT_PART_INSTALL/lib/app/JabRef.cfg | grep "app.version=" | cut -d'=' -f2)" sed -i 's|/opt/jabref/lib/jabrefHost.py|/snap/bin/jabref.browser-proxy|g' $SNAPCRAFT_PART_INSTALL/lib/org.jabref.jabref.json - chmod +x $SNAPCRAFT_PART_INSTALL/lib/jabrefHost.py diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 791e2e50698..d164f0bdbd0 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -55,7 +55,6 @@ requires org.apache.pdfbox; requires reactfx; requires commons.cli; - requires httpclient; requires com.github.tomtung.latex2unicode; requires jbibtex; requires citeproc.java; @@ -65,4 +64,7 @@ requires de.saxsys.mvvmfx.validation; requires richtextfx; requires unirest.java; + requires org.apache.httpcomponents.httpclient; + requires org.jsoup; + requires commons.csv; } diff --git a/src/main/java/org/jabref/Globals.java b/src/main/java/org/jabref/Globals.java index a4399b13207..bf5e00d33e7 100644 --- a/src/main/java/org/jabref/Globals.java +++ b/src/main/java/org/jabref/Globals.java @@ -1,7 +1,6 @@ package org.jabref; import java.awt.GraphicsEnvironment; -import java.io.IOException; import java.util.Optional; import java.util.UUID; @@ -26,11 +25,11 @@ import org.jabref.preferences.JabRefPreferences; import com.google.common.base.StandardSystemProperty; -import com.mashape.unirest.http.Unirest; import com.microsoft.applicationinsights.TelemetryClient; import com.microsoft.applicationinsights.TelemetryConfiguration; import com.microsoft.applicationinsights.internal.shutdown.SDKShutdownActivity; import com.microsoft.applicationinsights.telemetry.SessionState; +import kong.unirest.Unirest; public class Globals { @@ -56,13 +55,11 @@ public class Globals { /** * Manager for the state of the GUI. */ - - public static ClipBoardManager clipboardManager = new ClipBoardManager(); - public static StateManager stateManager = new StateManager(); public static ExporterFactory exportFactory; public static CountingUndoManager undoManager = new CountingUndoManager(); public static BibEntryTypesManager entryTypesManager = new BibEntryTypesManager(); + public static ClipBoardManager clipboardManager = new ClipBoardManager(); // Key binding preferences private static KeyBindingRepository keyBindingRepository; private static DefaultFileUpdateMonitor fileUpdateMonitor; @@ -129,9 +126,7 @@ public static void shutdownThreadPools() { public static void stopBackgroundTasks() { stopTelemetryClient(); - try { - Unirest.shutdown(); - } catch (IOException ignore) { } + Unirest.shutDown(); } public static Optional getTelemetryClient() { diff --git a/src/main/java/org/jabref/JabRefMain.java b/src/main/java/org/jabref/JabRefMain.java index 72051540247..7b4a6a15368 100644 --- a/src/main/java/org/jabref/JabRefMain.java +++ b/src/main/java/org/jabref/JabRefMain.java @@ -85,13 +85,13 @@ public void start(Stage mainStage) throws Exception { Platform.exit(); } } - + @Override public void stop() { Globals.stopBackgroundTasks(); Globals.shutdownThreadPools(); } - + /** * Tests if we are running an acceptable Java and terminates JabRef when we are sure the version is not supported. * This test uses the requirements for the Java version as specified in gradle.build. It is possible to @@ -166,7 +166,7 @@ private static void applyPreferences(JabRefPreferences preferences) { // Build list of Import and Export formats Globals.IMPORT_FORMAT_READER.resetImportFormats(Globals.prefs.getImportFormatPreferences(), Globals.prefs.getXMPPreferences(), Globals.getFileUpdateMonitor()); - Globals.entryTypesManager.addCustomizedEntryTypes(preferences.loadBibEntryTypes(BibDatabaseMode.BIBTEX), + Globals.entryTypesManager.addCustomOrModifiedTypes(preferences.loadBibEntryTypes(BibDatabaseMode.BIBTEX), preferences.loadBibEntryTypes(BibDatabaseMode.BIBLATEX)); Globals.exportFactory = Globals.prefs.getExporterFactory(Globals.journalAbbreviationLoader); diff --git a/src/main/java/org/jabref/cli/ArgumentProcessor.java b/src/main/java/org/jabref/cli/ArgumentProcessor.java index 252d8f8344e..bfe62a61579 100644 --- a/src/main/java/org/jabref/cli/ArgumentProcessor.java +++ b/src/main/java/org/jabref/cli/ArgumentProcessor.java @@ -458,7 +458,7 @@ private void exportFile(List loaded, String[] data) { private void importPreferences() { try { Globals.prefs.importPreferences(cli.getPreferencesImport()); - Globals.entryTypesManager.addCustomizedEntryTypes(Globals.prefs.loadBibEntryTypes(BibDatabaseMode.BIBTEX), + Globals.entryTypesManager.addCustomOrModifiedTypes(Globals.prefs.loadBibEntryTypes(BibDatabaseMode.BIBTEX), Globals.prefs.loadBibEntryTypes(BibDatabaseMode.BIBLATEX)); List customExporters = Globals.prefs.getCustomExportFormats(Globals.journalAbbreviationLoader); LayoutFormatterPreferences layoutPreferences = Globals.prefs diff --git a/src/main/java/org/jabref/gui/Base.css b/src/main/java/org/jabref/gui/Base.css index 42042f8d668..8460f03e0d5 100644 --- a/src/main/java/org/jabref/gui/Base.css +++ b/src/main/java/org/jabref/gui/Base.css @@ -87,8 +87,8 @@ -jr-sidepane-header-color: -jr-theme-text; /* Specs for the scrollbars */ - -jr-scrollbar-thumb: -fx-outer-border; - -jr-scrollbar-track: -fx-control-inner-background; + -jr-scrollbar-thumb: derive(-fx-outer-border, -30%); + -jr-scrollbar-track: derive(-fx-control-inner-background, -10%); -jr-separator: derive(-fx-color, -5%); @@ -698,13 +698,13 @@ .scroll-bar { -fx-background-color: transparent; - -fx-opacity: 0; + -fx-opacity: 0.3; } .scroll-bar:horizontal .track, .scroll-bar:vertical .track { -fx-background-color: -jr-scrollbar-track; - -fx-opacity: 0.2; + -fx-opacity: 0.6; -fx-background-radius: 0em; } @@ -718,7 +718,7 @@ .scroll-bar .thumb:hover, .scroll-bar .thumb:pressed { - -fx-background-color: derive(-jr-scrollbar-thumb, -20%); + -fx-background-color: derive(-jr-scrollbar-thumb, -30%); } /* Hide increment and decrement buttons */ @@ -751,7 +751,7 @@ -fx-padding: 0em 0.333em 0em 0.333em; /* 2 4 2 4 */ } -/* Only show scrollbars for hovered elements */ +/* Restore full visibility of scrollbars for active elements */ .list-view:hover .scroll-bar, .tree-view:hover .scroll-bar, .table-view:hover .scroll-bar, @@ -871,6 +871,10 @@ -fx-text-fill: -jr-search-text; } +.mainToolbar .search-field .label { + -fx-padding: 0em 1.8em 0em 0em; +} + /* The little arrow that shows up when not all tool-bar icons fit into the tool-bar. We want to have a look that matches our icons in the tool-bar */ .mainToolbar .tool-bar-overflow-button > .arrow { diff --git a/src/main/java/org/jabref/gui/BasePanel.java b/src/main/java/org/jabref/gui/BasePanel.java index ecc1673e29b..fdae86ec027 100644 --- a/src/main/java/org/jabref/gui/BasePanel.java +++ b/src/main/java/org/jabref/gui/BasePanel.java @@ -20,7 +20,6 @@ import javafx.beans.binding.Bindings; import javafx.geometry.Orientation; import javafx.scene.Node; -import javafx.scene.control.ScrollPane; import javafx.scene.control.SplitPane; import javafx.scene.layout.StackPane; @@ -47,6 +46,7 @@ import org.jabref.gui.externalfiletype.ExternalFileTypes; import org.jabref.gui.importer.actions.AppendDatabaseAction; import org.jabref.gui.journals.AbbreviateAction; +import org.jabref.gui.journals.AbbreviationType; import org.jabref.gui.journals.UnabbreviateAction; import org.jabref.gui.maintable.MainTable; import org.jabref.gui.maintable.MainTableDataModel; @@ -366,8 +366,9 @@ private void setupActions() { actions.put(Actions.WRITE_XMP, new WriteXMPAction(this)::execute); - actions.put(Actions.ABBREVIATE_ISO, new AbbreviateAction(this, true)); - actions.put(Actions.ABBREVIATE_MEDLINE, new AbbreviateAction(this, false)); + actions.put(Actions.ABBREVIATE_DEFAULT, new AbbreviateAction(this, AbbreviationType.DEFAULT)); + actions.put(Actions.ABBREVIATE_MEDLINE, new AbbreviateAction(this, AbbreviationType.MEDLINE)); + actions.put(Actions.ABBREVIATE_SHORTEST_UNIQUE, new AbbreviateAction(this, AbbreviationType.SHORTEST_UNIQUE)); actions.put(Actions.UNABBREVIATE, new UnabbreviateAction(this)); actions.put(Actions.DOWNLOAD_FULL_TEXT, new FindFullTextAction(this)::execute); @@ -745,10 +746,7 @@ public void setupMainPanel() { createMainTable(); - ScrollPane pane = mainTable.getPane(); - pane.setFitToHeight(true); - pane.setFitToWidth(true); - splitPane.getItems().add(pane); + splitPane.getItems().add(mainTable); // Set up name autocompleter for search: setupAutoCompletion(); @@ -912,10 +910,6 @@ public void updateEntryEditorIfShowing() { public void markBaseChanged() { baseChanged = true; - markBasedChangedInternal(); - } - - private void markBasedChangedInternal() { // Put an asterisk behind the filename to indicate the database has changed. frame.setWindowTitle(); DefaultTaskExecutor.runInJavaFXThread(frame::updateAllTabTitles); @@ -1089,11 +1083,6 @@ public void cut() { mainTable.cut(); } - @Subscribe - public void listen(EntryChangedEvent entryChangedEvent) { - this.markBaseChanged(); - } - private static class SearchAndOpenFile { private final BibEntry entry; diff --git a/src/main/java/org/jabref/gui/ClipBoardManager.java b/src/main/java/org/jabref/gui/ClipBoardManager.java index 0411f8afd4e..340fb61ea1a 100644 --- a/src/main/java/org/jabref/gui/ClipBoardManager.java +++ b/src/main/java/org/jabref/gui/ClipBoardManager.java @@ -1,5 +1,10 @@ package org.jabref.gui; +import java.awt.Toolkit; +import java.awt.datatransfer.DataFlavor; +import java.awt.datatransfer.StringSelection; +import java.awt.datatransfer.Transferable; +import java.awt.datatransfer.UnsupportedFlavorException; import java.io.ByteArrayInputStream; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -7,9 +12,11 @@ import java.util.List; import java.util.Optional; +import javafx.scene.control.TextInputControl; import javafx.scene.input.Clipboard; import javafx.scene.input.ClipboardContent; import javafx.scene.input.DataFormat; +import javafx.scene.input.MouseButton; import org.jabref.Globals; import org.jabref.logic.bibtex.BibEntryWriter; @@ -30,36 +37,53 @@ import org.slf4j.LoggerFactory; public class ClipBoardManager { + public static final DataFormat XML = new DataFormat("application/xml"); private static final Logger LOGGER = LoggerFactory.getLogger(ClipBoardManager.class); - private final Clipboard clipboard; - private final ImportFormatReader importFormatReader; + private static Clipboard clipboard; + private static java.awt.datatransfer.Clipboard primary; + private static ImportFormatReader importFormatReader; public ClipBoardManager() { - this(Clipboard.getSystemClipboard(), Globals.IMPORT_FORMAT_READER); + this(Clipboard.getSystemClipboard(), Toolkit.getDefaultToolkit().getSystemSelection(), Globals.IMPORT_FORMAT_READER); } - public ClipBoardManager(Clipboard clipboard, ImportFormatReader importFormatReader) { - this.clipboard = clipboard; - this.importFormatReader = importFormatReader; + public ClipBoardManager(Clipboard clipboard, java.awt.datatransfer.Clipboard primary, ImportFormatReader importFormatReader) { + ClipBoardManager.clipboard = clipboard; + ClipBoardManager.primary = primary; + ClipBoardManager.importFormatReader = importFormatReader; } /** - * Puts content onto the clipboard. + * Add X11 clipboard support to a text input control. + * It is necessary to call this method in every input where you want to use it: + * {@code ClipBoardManager.addX11Support(TextInputControl input);}. + * + * @param input the TextInputControl (e.g., TextField, TextArea, and children) where adding this functionality. + * @see Short summary for X11 clipboards + * @see Longer text over clipboards */ - public void setContent(ClipboardContent content) { - clipboard.setContent(content); + public static void addX11Support(TextInputControl input) { + input.selectedTextProperty().addListener((observable, oldValue, newValue) -> { + if (!newValue.isEmpty() && primary != null) { + primary.setContents(new StringSelection(newValue), null); + } + }); + input.setOnMouseClicked(event -> { + if (event.getButton() == MouseButton.MIDDLE) { + input.insertText(input.getCaretPosition(), getContentsPrimary()); + } + }); } /** - * Get the String residing on the clipboard. + * Get the String residing on the system clipboard. * - * @return any text found on the Clipboard; if none found, return an - * empty String. + * @return any text found on the Clipboard; if none found, return an empty String. */ - public String getContents() { + public static String getContents() { String result = clipboard.getString(); if (result == null) { return ""; @@ -67,16 +91,58 @@ public String getContents() { return result; } + /** + * Get the String residing on the primary clipboard (if it exists). + * + * @return any text found on the primary Clipboard; if none found, try with the system clipboard. + */ + public static String getContentsPrimary() { + if (primary != null) { + Transferable contents = primary.getContents(null); + if (contents != null && contents.isDataFlavorSupported(DataFlavor.stringFlavor)) { + try { + return (String) contents.getTransferData(DataFlavor.stringFlavor); + } catch (UnsupportedFlavorException | IOException e) { + LOGGER.warn(e.getMessage()); + } + } + } + return getContents(); + } + + /** + * Puts content onto the system clipboard. + * + * @param content the ClipboardContent to set as current value of the system clipboard. + */ + public void setContent(ClipboardContent content) { + clipboard.setContent(content); + setPrimaryClipboardContent(content); + } + + /** + * Puts content onto the primary clipboard (if it exists). + * + * @param content the ClipboardContent to set as current value of the primary clipboard. + */ + public void setPrimaryClipboardContent(ClipboardContent content) { + if (primary != null) { + primary.setContents(new StringSelection(content.getString()), null); + } + } + public void setHtmlContent(String html) { final ClipboardContent content = new ClipboardContent(); content.putHtml(html); clipboard.setContent(content); + setPrimaryClipboardContent(content); } public void setContent(String string) { final ClipboardContent content = new ClipboardContent(); content.putString(string); clipboard.setContent(content); + setPrimaryClipboardContent(content); } public void setContent(List entries) throws IOException { @@ -86,6 +152,7 @@ public void setContent(List entries) throws IOException { content.put(DragAndDropDataFormats.ENTRIES, serializedEntries); content.putString(serializedEntries); clipboard.setContent(content); + setPrimaryClipboardContent(content); } public List extractData() { diff --git a/src/main/java/org/jabref/gui/Dark.css b/src/main/java/org/jabref/gui/Dark.css index b9ec0058a23..cde1709d0ea 100644 --- a/src/main/java/org/jabref/gui/Dark.css +++ b/src/main/java/org/jabref/gui/Dark.css @@ -55,3 +55,12 @@ background-color: #272b38; /* -fx-control-inner-background*/ color : #7d8591; /* -fx-mid-text-color*/ } + +.text-unchanged { + -fx-fill: -fx-light-text-color; +} + +.radio-button > .radio { + -fx-background-color: -fx-light-text-color, -fx-control-inner-background; +} + diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 364a834056e..e5bb490340d 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -783,8 +783,9 @@ private MenuBar createMenu() { pushToApplicationMenuItem, factory.createSubMenu(StandardActions.ABBREVIATE, - factory.createMenuItem(StandardActions.ABBREVIATE_ISO, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_ISO, this, stateManager)), - factory.createMenuItem(StandardActions.ABBREVIATE_MEDLINE, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_MEDLINE, this, stateManager))), + factory.createMenuItem(StandardActions.ABBREVIATE_DEFAULT, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_DEFAULT, this, stateManager)), + factory.createMenuItem(StandardActions.ABBREVIATE_MEDLINE, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_MEDLINE, this, stateManager)), + factory.createMenuItem(StandardActions.ABBREVIATE_SHORTEST_UNIQUE, new OldDatabaseCommandWrapper(Actions.ABBREVIATE_SHORTEST_UNIQUE, this, stateManager))), factory.createMenuItem(StandardActions.UNABBREVIATE, new OldDatabaseCommandWrapper(Actions.UNABBREVIATE, this, stateManager)) ); diff --git a/src/main/java/org/jabref/gui/actions/Actions.java b/src/main/java/org/jabref/gui/actions/Actions.java index b113f289632..49040b8e00b 100644 --- a/src/main/java/org/jabref/gui/actions/Actions.java +++ b/src/main/java/org/jabref/gui/actions/Actions.java @@ -5,9 +5,9 @@ */ @Deprecated public enum Actions { - - ABBREVIATE_ISO, + ABBREVIATE_DEFAULT, ABBREVIATE_MEDLINE, + ABBREVIATE_SHORTEST_UNIQUE, ADD_FILE_LINK, CLEANUP, COPY, diff --git a/src/main/java/org/jabref/gui/actions/StandardActions.java b/src/main/java/org/jabref/gui/actions/StandardActions.java index 117b75ceffa..87f48f1b4a5 100644 --- a/src/main/java/org/jabref/gui/actions/StandardActions.java +++ b/src/main/java/org/jabref/gui/actions/StandardActions.java @@ -94,8 +94,9 @@ public enum StandardActions implements Action { COPY_LINKED_FILES(Localization.lang("Copy linked files to folder...")), COPY_DOI(Localization.lang("Copy DOI url")), ABBREVIATE(Localization.lang("Abbreviate journal names")), - ABBREVIATE_ISO("ISO", Localization.lang("Abbreviate journal names of the selected entries (ISO abbreviation)"), KeyBinding.ABBREVIATE), + ABBREVIATE_DEFAULT("DEFAULT", Localization.lang("Abbreviate journal names of the selected entries (DEFAULT abbreviation)"), KeyBinding.ABBREVIATE), ABBREVIATE_MEDLINE("MEDLINE", Localization.lang("Abbreviate journal names of the selected entries (MEDLINE abbreviation)")), + ABBREVIATE_SHORTEST_UNIQUE("SHORTEST UNIQUE", Localization.lang("Abbreviate journal names of the selected entries (SHORTEST UNIQUE abbreviation)")), UNABBREVIATE(Localization.lang("Unabbreviate journal names"), Localization.lang("Unabbreviate journal names of the selected entries"), KeyBinding.UNABBREVIATE), MANAGE_CUSTOM_EXPORTS(Localization.lang("Manage custom exports")), diff --git a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java index 02efa83d935..0016b222116 100644 --- a/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java +++ b/src/main/java/org/jabref/gui/entryeditor/EntryEditor.java @@ -137,53 +137,20 @@ public EntryEditor(BasePanel panel, ExternalFileTypes externalFileTypes) { FileDragDropPreferenceType dragDropPreferencesType = preferencesService.getEntryEditorFileLinkPreference(); if (dragDropPreferencesType == FileDragDropPreferenceType.MOVE) { - if (event.getTransferMode() == TransferMode.LINK) { - // Alt on Windows - LOGGER.debug("Mode LINK"); - fileLinker.addFilesToEntry(entry, files); - } else if (event.getTransferMode() == TransferMode.COPY) { - // Ctrl on Windows, no modifier on Xubuntu - LOGGER.debug("Mode COPY"); - fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); - } else { - // Shift on Windows or no modifier - LOGGER.debug("Mode MOVE"); - fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); - } + LOGGER.debug("Mode MOVE"); + fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); success = true; } if (dragDropPreferencesType == FileDragDropPreferenceType.COPY) { - if (event.getTransferMode() == TransferMode.COPY) { - // Ctrl on Windows, no modifier on Xubuntu - LOGGER.debug("Mode MOVE"); - fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); - } else if (event.getTransferMode() == TransferMode.LINK) { - // Alt on Windows - LOGGER.debug("Mode LINK"); - fileLinker.addFilesToEntry(entry, files); - } else { - // Shift on Windows or no modifier - LOGGER.debug("Mode COPY"); - fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); - } + LOGGER.debug("Mode COPY"); + fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); success = true; } if (dragDropPreferencesType == FileDragDropPreferenceType.LINK) { - if (event.getTransferMode() == TransferMode.COPY) { - // Ctrl on Windows, no modifier on Xubuntu - LOGGER.debug("Mode COPY"); - fileLinker.copyFilesToFileDirAndAddToEntry(entry, files); - } else if (event.getTransferMode() == TransferMode.LINK) { - // Alt on Windows - LOGGER.debug("Mode MOVE"); - fileLinker.moveFilesToFileDirAndAddToEntry(entry, files); - } else { - // Shift on Windows or no modifier - LOGGER.debug("Mode LINK"); - fileLinker.addFilesToEntry(entry, files); - } + LOGGER.debug("Mode LINK"); + fileLinker.addFilesToEntry(entry, files); success = true; } } diff --git a/src/main/java/org/jabref/gui/entryeditor/FileDragDropPreferenceType.java b/src/main/java/org/jabref/gui/entryeditor/FileDragDropPreferenceType.java index f8bea3ce606..c4593487e39 100644 --- a/src/main/java/org/jabref/gui/entryeditor/FileDragDropPreferenceType.java +++ b/src/main/java/org/jabref/gui/entryeditor/FileDragDropPreferenceType.java @@ -1,7 +1,16 @@ package org.jabref.gui.entryeditor; public enum FileDragDropPreferenceType { + /** + * Copy file to default file folder + */ COPY, + /** + * Link file (without copying) + */ LINK, + /** + * Copy, rename and link file + */ MOVE; } diff --git a/src/main/java/org/jabref/gui/fieldeditors/EditorTextArea.java b/src/main/java/org/jabref/gui/fieldeditors/EditorTextArea.java index 65a55854974..13a7f7f6ac3 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/EditorTextArea.java +++ b/src/main/java/org/jabref/gui/fieldeditors/EditorTextArea.java @@ -10,6 +10,8 @@ import javafx.scene.control.ContextMenu; import javafx.scene.control.MenuItem; +import org.jabref.gui.ClipBoardManager; + public class EditorTextArea extends javafx.scene.control.TextArea implements Initializable, ContextMenuAddable { private final ContextMenu contextMenu = new ContextMenu(); @@ -29,6 +31,8 @@ public EditorTextArea(final String text) { // Hide horizontal scrollbar and always wrap text setWrapText(true); + + ClipBoardManager.addX11Support(this); } @Override diff --git a/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java b/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java index a10583e2774..215083980a8 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java +++ b/src/main/java/org/jabref/gui/fieldeditors/EditorTextField.java @@ -11,6 +11,8 @@ import javafx.scene.layout.HBox; import javafx.scene.layout.Priority; +import org.jabref.gui.ClipBoardManager; + public class EditorTextField extends javafx.scene.control.TextField implements Initializable, ContextMenuAddable { private final ContextMenu contextMenu = new ContextMenu(); @@ -25,6 +27,8 @@ public EditorTextField(final String text) { // Always fill out all the available space setPrefHeight(Double.POSITIVE_INFINITY); HBox.setHgrow(this, Priority.ALWAYS); + + ClipBoardManager.addX11Support(this); } @Override diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index 3dec2613770..94e3ec56054 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -293,7 +293,12 @@ public enum JabRefIcons implements JabRefIcon { LATEX_FILE(MaterialDesignIcon.FILE_OUTLINE), LATEX_COMMENT(MaterialDesignIcon.COMMENT_TEXT_OUTLINE), LATEX_LINE(MaterialDesignIcon.FORMAT_LINE_SPACING), - PASSWORD_REVEALED(MaterialDesignIcon.EYE); + PASSWORD_REVEALED(MaterialDesignIcon.EYE), + ADD_ABBREVIATION_LIST(MaterialDesignIcon.FOLDER_PLUS), + OPEN_ABBREVIATION_LIST(MaterialDesignIcon.FOLDER_OUTLINE), + REMOVE_ABBREVIATION_LIST(MaterialDesignIcon.FOLDER_REMOVE), + ADD_ABBREVIATION(MaterialDesignIcon.PLAYLIST_PLUS), + REMOVE_ABBREVIATION(MaterialDesignIcon.PLAYLIST_MINUS); private final JabRefIcon icon; diff --git a/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.fxml b/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.fxml index ad1606546b8..791543daf23 100644 --- a/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.fxml +++ b/src/main/java/org/jabref/gui/importer/ImportCustomEntryTypesDialog.fxml @@ -9,7 +9,7 @@ xmlns="http://javafx.com/javafx/8.0.171" fx:controller="org.jabref.gui.importer.ImportCustomEntryTypesDialog"> - +