From d84bce709c487568082336a10d8a3791ae70d331 Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Fri, 21 Feb 2020 01:08:41 +0100 Subject: [PATCH 1/7] Move journal abbreviations to quality Idea: tools should be mostly external integrations in the future --- src/main/java/org/jabref/gui/JabRefFrame.java | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index c1c68a51590..c6f543284f6 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -409,7 +409,7 @@ private void initLayout() { setId("frame"); - VBox head = new VBox(createMenu(),createToolbar()); + VBox head = new VBox(createMenu(), createToolbar()); head.setSpacing(0d); setTop(head); @@ -756,7 +756,16 @@ private MenuBar createMenu() { new SeparatorMenuItem(), - factory.createMenuItem(StandardActions.SET_FILE_LINKS, new AutoLinkFilesAction(this, prefs, stateManager, undoManager, Globals.TASK_EXECUTOR)) + factory.createMenuItem(StandardActions.SET_FILE_LINKS, new AutoLinkFilesAction(this, prefs, stateManager, undoManager, Globals.TASK_EXECUTOR)), + + new SeparatorMenuItem(), + + factory.createSubMenu(StandardActions.ABBREVIATE, + 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)) ); // PushToApplication @@ -781,14 +790,7 @@ private MenuBar createMenu() { factory.createMenuItem(StandardActions.GENERATE_CITE_KEYS, new OldDatabaseCommandWrapper(Actions.MAKE_KEY, this, stateManager)), factory.createMenuItem(StandardActions.REPLACE_ALL, new OldDatabaseCommandWrapper(Actions.REPLACE_ALL, this, stateManager)), factory.createMenuItem(StandardActions.SEND_AS_EMAIL, new OldDatabaseCommandWrapper(Actions.SEND_AS_EMAIL, this, stateManager)), - pushToApplicationMenuItem, - - factory.createSubMenu(StandardActions.ABBREVIATE, - 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)) + pushToApplicationMenuItem ); SidePaneComponent webSearch = sidePaneManager.getComponent(SidePaneType.WEB_SEARCH); From 04be32cb82410df1c3db11898c3430d92027cf9a Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Fri, 21 Feb 2020 00:06:57 +0100 Subject: [PATCH 2/7] Group remote database actions in menu Closes https://github.com/koppor/jabref/issues/396 --- src/main/java/org/jabref/gui/JabRefFrame.java | 10 +++++++--- .../java/org/jabref/gui/actions/StandardActions.java | 1 + src/main/java/org/jabref/gui/icon/IconTheme.java | 3 ++- src/main/resources/l10n/JabRef_en.properties | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index c1c68a51590..0bd1cfb51e6 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -409,7 +409,7 @@ private void initLayout() { setId("frame"); - VBox head = new VBox(createMenu(),createToolbar()); + VBox head = new VBox(createMenu(), createToolbar()); head.setSpacing(0d); setTop(head); @@ -681,8 +681,12 @@ private MenuBar createMenu() { factory.createMenuItem(StandardActions.EXPORT_SELECTED, new ExportCommand(this, true, Globals.prefs)), factory.createMenuItem(StandardActions.SAVE_SELECTED_AS_PLAIN_BIBTEX, new OldDatabaseCommandWrapper(Actions.SAVE_SELECTED_AS_PLAIN, this, stateManager))), - factory.createMenuItem(StandardActions.CONNECT_TO_SHARED_DB, new ConnectToSharedDatabaseCommand(this)), - factory.createMenuItem(StandardActions.PULL_CHANGES_FROM_SHARED_DB, new OldDatabaseCommandWrapper(Actions.PULL_CHANGES_FROM_SHARED_DATABASE, this, stateManager)), + new SeparatorMenuItem(), + + factory.createSubMenu(StandardActions.REMOTE_DB, + factory.createMenuItem(StandardActions.CONNECT_TO_SHARED_DB, new ConnectToSharedDatabaseCommand(this)), + factory.createMenuItem(StandardActions.PULL_CHANGES_FROM_SHARED_DB, new OldDatabaseCommandWrapper(Actions.PULL_CHANGES_FROM_SHARED_DATABASE, this, stateManager)) + ), new SeparatorMenuItem(), diff --git a/src/main/java/org/jabref/gui/actions/StandardActions.java b/src/main/java/org/jabref/gui/actions/StandardActions.java index 245c20e30d5..8d63c2fc9ff 100644 --- a/src/main/java/org/jabref/gui/actions/StandardActions.java +++ b/src/main/java/org/jabref/gui/actions/StandardActions.java @@ -71,6 +71,7 @@ public enum StandardActions implements Action { IMPORT_INTO_NEW_LIBRARY(Localization.lang("Import into new library"), KeyBinding.IMPORT_INTO_NEW_DATABASE), IMPORT_INTO_CURRENT_LIBRARY(Localization.lang("Import into current library"), KeyBinding.IMPORT_INTO_CURRENT_DATABASE), EXPORT_ALL(Localization.lang("Export all entries")), + REMOTE_DB(Localization.lang("Shared database"), IconTheme.JabRefIcons.REMOTE_DATABASE), EXPORT_SELECTED(Localization.lang("Export selected entries"), KeyBinding.EXPORT_SELECTED), CONNECT_TO_SHARED_DB(Localization.lang("Connect to shared database"), IconTheme.JabRefIcons.CONNECT_DB), PULL_CHANGES_FROM_SHARED_DB(Localization.lang("Pull changes from shared database"), KeyBinding.PULL_CHANGES_FROM_SHARED_DATABASE), diff --git a/src/main/java/org/jabref/gui/icon/IconTheme.java b/src/main/java/org/jabref/gui/icon/IconTheme.java index 2df5017c21f..f41142d4fd8 100644 --- a/src/main/java/org/jabref/gui/icon/IconTheme.java +++ b/src/main/java/org/jabref/gui/icon/IconTheme.java @@ -299,7 +299,8 @@ public enum JabRefIcons implements JabRefIcon { REMOVE_ABBREVIATION_LIST(MaterialDesignIcon.FOLDER_REMOVE), ADD_ABBREVIATION(MaterialDesignIcon.PLAYLIST_PLUS), REMOVE_ABBREVIATION(MaterialDesignIcon.PLAYLIST_MINUS), - NEW_ENTRY_FROM_PLAIN_TEXT(MaterialDesignIcon.PLUS_BOX); + NEW_ENTRY_FROM_PLAIN_TEXT(MaterialDesignIcon.PLUS_BOX), + REMOTE_DATABASE(MaterialDesignIcon.DATABASE); private final JabRefIcon icon; diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 3951fbe6015..91fc78b2ae1 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -2116,3 +2116,4 @@ Optional=Optional Required=Required Entry\ type\ cannot\ be\ empty.\ Please\ enter\ a\ name.=Entry type cannot be empty. Please enter a name. Field\ cannot\ be\ empty.\ Please\ enter\ a\ name.=Field cannot be empty. Please enter a name. +Shared\ database=Shared database From 3e0284dd551cdd24c77cd420642adb8752e41750 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Thu, 27 Feb 2020 11:07:07 +0100 Subject: [PATCH 3/7] Add graal info to module file (#6010) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update citeproc-java to 2.1.0-SNAPSHOT and enable experimental pure-Java mode * Add graal info to module file * Update module-info.java * fix loading of CSL styles using correct path * use acm stlye as default * disbale debug mode * add changelog entry Co-authored-by: Michel Krämer Co-authored-by: Christoph --- CHANGELOG.md | 1 + build.gradle | 4 +-- src/main/java/module-info.java | 6 +++- .../logic/citationstyle/CSLAdapter.java | 4 ++- .../logic/citationstyle/CitationStyle.java | 30 ++++++------------- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1477782a160..49dc2aac9bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# - We fixed an issue where changing entry type doesn't always work when biblatex source is shown. [#5905](https://github.com/JabRef/jabref/issues/5905) - We fixed an issue where the group and the link column were not updated after changing the entry in the main table. [#5985](https://github.com/JabRef/jabref/issues/5985) - We fixed an issue where reordering the groups was not possible after inserting an article. [#6008](https://github.com/JabRef/jabref/issues/6008) +- We fixed an issue where citation styles except the default "Preview" could not be used. [#56220](https://github.com/JabRef/jabref/issues/5622) ### Removed diff --git a/build.gradle b/build.gradle index 3daa53628ce..1b69c25572e 100644 --- a/build.gradle +++ b/build.gradle @@ -181,7 +181,7 @@ dependencies { implementation group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' annotationProcessor group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' - implementation 'de.undercouch:citeproc-java:2.0.0' + implementation 'de.undercouch:citeproc-java:2.1.0-SNAPSHOT' implementation group: 'jakarta.activation', name: 'jakarta.activation-api', version: '1.2.1' implementation group: 'jakarta.xml.bind', name: 'jakarta.xml.bind-api', version: '2.3.2' @@ -546,7 +546,7 @@ task deleteInstallerTemp(type: Delete) { jpackage.dependsOn deleteInstallerTemp jlink { - options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] + options = ['--strip-debug','--compress', '2', '--no-header-files', '--no-man-pages'] launcher { name = 'JabRef' } diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index a90f0226983..6ef392d0005 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -61,7 +61,11 @@ requires jbibtex; requires citeproc.java; requires antlr.runtime; - requires org.graalvm.js; + requires org.graalvm.truffle; + requires org.graalvm.sdk; + requires transitive org.graalvm.js; + requires java.scripting; + requires jdk.internal.vm.compiler; requires org.apache.xmpbox; requires de.saxsys.mvvmfx.validation; requires com.google.gson; diff --git a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java index 5728839efe9..6d34c21c514 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java +++ b/src/main/java/org/jabref/logic/citationstyle/CSLAdapter.java @@ -14,6 +14,7 @@ import org.jabref.model.strings.LatexToUnicodeAdapter; import de.undercouch.citeproc.CSL; +import de.undercouch.citeproc.DefaultAbbreviationProvider; import de.undercouch.citeproc.ItemDataProvider; import de.undercouch.citeproc.bibtex.BibTeXConverter; import de.undercouch.citeproc.csl.CSLItemData; @@ -66,7 +67,8 @@ public synchronized List makeBibliography(List bibEntries, Str private void initialize(String newStyle, CitationStyleOutputFormat newFormat) throws IOException { if ((cslInstance == null) || !Objects.equals(newStyle, style)) { // lang and forceLang are set to the default values of other CSL constructors - cslInstance = new CSL(dataProvider, new JabRefLocaleProvider(), newStyle, "en-US", false); + cslInstance = new CSL(dataProvider, new JabRefLocaleProvider(), + new DefaultAbbreviationProvider(), null, newStyle, "en-US", false, true); style = newStyle; } diff --git a/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java b/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java index 05285948ccd..99ddd023239 100644 --- a/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java +++ b/src/main/java/org/jabref/logic/citationstyle/CitationStyle.java @@ -6,9 +6,6 @@ import java.net.URISyntaxException; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.nio.file.FileSystem; -import java.nio.file.FileSystemAlreadyExistsException; -import java.nio.file.FileSystems; import java.nio.file.Files; import java.nio.file.NoSuchFileException; import java.nio.file.Path; @@ -25,6 +22,7 @@ import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; +import org.jabref.JabRefMain; import org.jabref.logic.util.StandardFileType; import de.undercouch.citeproc.helper.CSLUtils; @@ -138,28 +136,18 @@ public static List discoverCitationStyles() { return STYLES; } - URL url = CitationStyle.class.getResource(STYLES_ROOT); - if (url == null) { - return Collections.emptyList(); - } + URL url = JabRefMain.class.getResource(STYLES_ROOT + "/acm-siggraph.csl"); + Objects.requireNonNull(url); + try { URI uri = url.toURI(); - if ("jar".equals(uri.getScheme())) { - try (FileSystem fs = FileSystems.newFileSystem(uri, Collections.emptyMap())) { - Path path = fs.getPath(STYLES_ROOT); - STYLES.addAll(discoverCitationStylesInPath(path)); - } catch (FileSystemAlreadyExistsException e) { - try (FileSystem fs = FileSystems.getFileSystem(uri)) { - Path path = fs.getPath(STYLES_ROOT); - STYLES.addAll(discoverCitationStylesInPath(path)); - } - } - } else { - STYLES.addAll(discoverCitationStylesInPath(Paths.get(uri))); - } + Path path = Path.of(uri).getParent(); + + STYLES.addAll(discoverCitationStylesInPath(path)); + return STYLES; } catch (URISyntaxException | IOException e) { - LOGGER.error("something went wrong while searching available CitationStyles. Are you running directly from source code?", e); + LOGGER.error("something went wrong while searching available CitationStyles", e); return Collections.emptyList(); } } From fbd52b881850f2f781247680af0878f0c23d7267 Mon Sep 17 00:00:00 2001 From: Linus Dietz Date: Thu, 27 Feb 2020 18:02:00 +0100 Subject: [PATCH 4/7] Fix dependency updates workflow (#6033) * Disallow jython beta versions * bump mockito to 3.3.1 * Add more general exception for fontawesome --- build.gradle | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/build.gradle b/build.gradle index 1b69c25572e..72d2f156e01 100644 --- a/build.gradle +++ b/build.gradle @@ -205,7 +205,7 @@ dependencies { testImplementation 'net.bytebuddy:byte-buddy-parent:1.10.8' testRuntime group: 'org.apache.logging.log4j', name: 'log4j-core', version: '3.0.0-SNAPSHOT' testRuntime group: 'org.apache.logging.log4j', name: 'log4j-jul', version: '3.0.0-SNAPSHOT' - testImplementation 'org.mockito:mockito-core:3.3.0' + testImplementation 'org.mockito:mockito-core:3.3.1' testImplementation 'org.xmlunit:xmlunit-core:2.6.3' testImplementation 'org.xmlunit:xmlunit-matchers:2.6.3' testImplementation 'com.tngtech.archunit:archunit-junit5-api:0.13.1' @@ -238,14 +238,12 @@ dependencyUpdates.resolutionStrategy = { } } rules.withModule("org.python:jython-standalone") { ComponentSelection selection -> - if (selection.candidate.version ==~ /2.7.2b2/) { + if (selection.candidate.version ==~ /2.7.2b\d/) { selection.reject('Release candidate') } } rules.withModule("de.jensd:fontawesomefx-materialdesignfont") { ComponentSelection selection -> - if (selection.candidate.version ==~ /2.0.26-9.1.2/ - || selection.candidate.version ==~ /2.0.26-9.1.1/ - || selection.candidate.version ==~ /2.0.26-9.1.0/) { + if (selection.candidate.version ==~ /2.0.26.*/) { selection.reject('1.7.22-11 is actually newer (strange version system)') } } From 7d717fdf0aa0540a207a415cca7f12b718f944ed Mon Sep 17 00:00:00 2001 From: Carl Christian Snethlage <50491877+calixtus@users.noreply.github.com> Date: Thu, 27 Feb 2020 19:22:06 +0100 Subject: [PATCH 5/7] Translation for SpecialField names in preferences (#6031) * Added Localization for SpecialField * l10n * Reverse everything and simplify --- src/main/java/org/jabref/gui/util/FieldsUtil.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/util/FieldsUtil.java b/src/main/java/org/jabref/gui/util/FieldsUtil.java index 7a72b944c91..f461a5123d4 100644 --- a/src/main/java/org/jabref/gui/util/FieldsUtil.java +++ b/src/main/java/org/jabref/gui/util/FieldsUtil.java @@ -2,6 +2,8 @@ import javafx.util.StringConverter; +import org.jabref.Globals; +import org.jabref.gui.specialfields.SpecialFieldViewModel; import org.jabref.logic.l10n.Localization; import org.jabref.model.entry.field.Field; import org.jabref.model.entry.field.FieldFactory; @@ -30,7 +32,8 @@ public Field fromString(String string) { public static String getNameWithType(Field field) { if (field instanceof SpecialField) { - return field.getDisplayName() + " (" + Localization.lang("Special") + ")"; + return new SpecialFieldViewModel((SpecialField) field, Globals.undoManager).getLocalization() + + " (" + Localization.lang("Special") + ")"; } else if (field instanceof IEEEField) { return field.getDisplayName() + " (" + Localization.lang("IEEE") + ")"; } else if (field instanceof InternalField) { From 2fad0200ff2ae7cba66abc3485dc69834d7b154e Mon Sep 17 00:00:00 2001 From: Stefan Kolb Date: Thu, 27 Feb 2020 20:08:58 +0100 Subject: [PATCH 6/7] Raise codecov threshold (#6027) * Raise codecov threshold * 0.5% is the threshold Co-authored-by: Oliver Kopp --- codecov.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/codecov.yml b/codecov.yml index 29aaa66eedc..78fd542fe8a 100644 --- a/codecov.yml +++ b/codecov.yml @@ -3,4 +3,7 @@ coverage: - src/gen/.* status: patch: false + project: + default: + threshold: 0.005 comment: off From 9424777b9e5403c5bebd5044149e1a7095eabcf5 Mon Sep 17 00:00:00 2001 From: Linus Dietz Date: Thu, 27 Feb 2020 23:21:03 +0100 Subject: [PATCH 7/7] Remove "Merge Entries" from Quality Menu (#6021) --- CHANGELOG.md | 1 + src/main/java/org/jabref/gui/JabRefFrame.java | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49dc2aac9bd..24af6f3b56c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ We refer to [GitHub issues](https://github.com/JabRef/jabref/issues) by using `# ### Removed - Ampersands are no longer escaped by default in the `bib` file. If you want to keep the current behaviour, you can use the new "Escape Ampersands" formatter as a save action. [#5869](https://github.com/JabRef/jabref/issues/5869) +- The "Merge Entries" entry was removed from the Quality Menu. Users should use the right-click menu instead. [#6021](https://github.com/JabRef/jabref/pull/6021) ## [5.0-beta] – 2019-12-15 diff --git a/src/main/java/org/jabref/gui/JabRefFrame.java b/src/main/java/org/jabref/gui/JabRefFrame.java index 698b89f1ca3..c7bc0a63088 100644 --- a/src/main/java/org/jabref/gui/JabRefFrame.java +++ b/src/main/java/org/jabref/gui/JabRefFrame.java @@ -89,7 +89,6 @@ import org.jabref.gui.keyboard.KeyBinding; import org.jabref.gui.libraryproperties.LibraryPropertiesAction; import org.jabref.gui.menus.FileHistoryMenu; -import org.jabref.gui.mergeentries.MergeEntriesAction; import org.jabref.gui.metadata.BibtexStringEditorAction; import org.jabref.gui.metadata.PreambleEditor; import org.jabref.gui.preferences.ShowPreferencesAction; @@ -760,7 +759,6 @@ private MenuBar createMenu() { quality.getItems().addAll( factory.createMenuItem(StandardActions.FIND_DUPLICATES, new DuplicateSearch(this, dialogService, stateManager)), - factory.createMenuItem(StandardActions.MERGE_ENTRIES, new MergeEntriesAction(this, stateManager)), factory.createMenuItem(StandardActions.CHECK_INTEGRITY, new IntegrityCheckAction(this, stateManager, Globals.TASK_EXECUTOR)), factory.createMenuItem(StandardActions.CLEANUP_ENTRIES, new OldDatabaseCommandWrapper(Actions.CLEANUP, this, stateManager)),