From 066bbab4b693b42646d76ad73a7b7dc7e56aeb75 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Sun, 20 Oct 2024 22:17:21 +1100 Subject: [PATCH 01/30] First version of the double click issue --- .../gui/entryeditor/LatexCitationsTab.java | 2 ++ .../LatexCitationsTabViewModel.java | 36 +++++++++++++++++++ .../gui/push/AbstractPushToApplication.java | 33 +++++++++++++++++ .../jabref/gui/push/PushToApplication.java | 3 ++ .../gui/push/PushToApplicationCommand.java | 4 +++ .../org/jabref/gui/push/PushToTeXstudio.java | 11 ++++++ 6 files changed, 89 insertions(+) diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java index 6e45f1d491e..330767314cb 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java @@ -59,6 +59,8 @@ private void setSearchPane() { citationsDisplay.basePathProperty().bindBidirectional(viewModel.directoryProperty()); citationsDisplay.setItems(viewModel.getCitationList()); + citationsDisplay.setOnMouseClicked(event -> viewModel.handleMouseClick(event, citationsDisplay)); + RowConstraints mainRow = new RowConstraints(); mainRow.setVgrow(Priority.ALWAYS); diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index b4fa51069b3..bc4242afbcb 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -15,10 +15,18 @@ import javafx.beans.property.StringProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; +import javafx.scene.input.MouseButton; +import javafx.scene.input.MouseEvent; import org.jabref.gui.AbstractViewModel; import org.jabref.gui.DialogService; +import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.preferences.GuiPreferences; +import org.jabref.gui.push.PushToApplication; +import org.jabref.gui.push.PushToApplicationCommand; +import org.jabref.gui.push.PushToApplications; +import org.jabref.gui.push.PushToEmacs; +import org.jabref.gui.texparser.CitationsDisplay; import org.jabref.gui.util.DirectoryDialogConfiguration; import org.jabref.gui.util.UiTaskExecutor; import org.jabref.logic.l10n.Localization; @@ -154,6 +162,34 @@ public void onDirectoryDelete(File directory) { }; } + // Handle mouse click event + public void handleMouseClick(MouseEvent event, CitationsDisplay citationsDisplay) { + // Get the currently selected item + Citation selectedItem = citationsDisplay.getSelectionModel().getSelectedItem(); + + // Check if the left mouse button was double-clicked + if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() == 1 && selectedItem != null) { + // Perform a jump or other actions + System.out.println("Double-clicked on: " + selectedItem); + PushToApplicationCommand abstractPushToApplication; +// abstractPushToApplication = new PushToApplicationCommand(dialogService, preferences); +// }; +// abstractPushToApplication.publicJumpToLine(selectedItem.path(), selectedItem.line(), selectedItem.colStart()); +// jumpToAction(selectedItem); + String applicationName = preferences.getPushToApplicationPreferences() + .getActiveApplicationName(); + final ActionFactory factory = new ActionFactory(); + PushToApplication application = PushToApplications.getApplicationByName( + applicationName, + dialogService, + preferences) + .orElse(new PushToEmacs(dialogService, preferences)); + + preferences.getPushToApplicationPreferences().setActiveApplicationName(application.getDisplayName()); + application.publicJumpToLine(selectedItem.path(), selectedItem.line(), selectedItem.colStart()); + } + } + public void bindToEntry(BibEntry entry) { checkAndUpdateDirectory(); diff --git a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java index 40c04c97a8d..0355c8450e8 100644 --- a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java +++ b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java @@ -1,6 +1,7 @@ package org.jabref.gui.push; import java.io.IOException; +import java.nio.file.Path; import java.util.List; import java.util.Optional; @@ -181,4 +182,36 @@ public Optional getKeyBinding() { return Optional.of(KeyBinding.PUSH_TO_APPLICATION); } } + + /** + * This function is to jump to a specific line due to different editor. + * + */ + protected void jumpToLine(Path fileName, int line, int column) { + commandPath = preferences.getPushToApplicationPreferences().getCommandPaths().get(this.getDisplayName()); + + // Check if a path to the command has been specified + if (StringUtil.isNullOrEmpty(commandPath)) { + notDefined = true; + return; + } + // Execute the command + String command = jumpString(fileName, line, column); + try { + Runtime.getRuntime().exec(command); + } catch ( + IOException e) { + // Handle exceptions (log or show error message) + e.printStackTrace(); + dialogService.showErrorDialogAndWait("Error", "Could not open TeXstudio at the specified location."); + } + } + + protected String jumpString(Path fileName, int line, int column) { + return ""; + } + + public void publicJumpToLine(Path fileName, int line, int column) { + jumpToLine(fileName, line, column); + } } diff --git a/src/main/java/org/jabref/gui/push/PushToApplication.java b/src/main/java/org/jabref/gui/push/PushToApplication.java index 18e012e904f..d5b508c88d3 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplication.java +++ b/src/main/java/org/jabref/gui/push/PushToApplication.java @@ -1,5 +1,6 @@ package org.jabref.gui.push; +import java.nio.file.Path; import java.util.List; import org.jabref.gui.actions.Action; @@ -56,4 +57,6 @@ public interface PushToApplication { PushToApplicationSettings getSettings(PushToApplication application, PushToApplicationPreferences pushToApplicationPreferences); String getDelimiter(); + + void publicJumpToLine(Path fileName, int line, int column); } diff --git a/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java b/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java index c5fa4c905eb..482ef485920 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java +++ b/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java @@ -142,4 +142,8 @@ private void pushEntries() { BibDatabaseContext database = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null")); application.pushEntries(database, stateManager.getSelectedEntries(), getKeyString(stateManager.getSelectedEntries(), application.getDelimiter())); } +// private void jump(Path fileName, int line, int column) { +// BibDatabaseContext database = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null")); +// application.publicJumpToLine(database, stateManager.getSelectedEntries(), getKeyString(stateManager.getSelectedEntries(), application.getDelimiter())); +// } } diff --git a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java index 17c6d5650c6..f35dbff7f2f 100644 --- a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java +++ b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java @@ -1,5 +1,7 @@ package org.jabref.gui.push; +import java.nio.file.Path; + import org.jabref.gui.DialogService; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; @@ -27,4 +29,13 @@ public JabRefIcon getApplicationIcon() { protected String[] getCommandLine(String keyString) { return new String[] {commandPath, "--insert-cite", "%s%s%s".formatted(getCitePrefix(), keyString, getCiteSuffix())}; } + + /** + * Method to open TeXstudio at the given line number in the specified LaTeX file. + */ + @Override + public String jumpString(Path fileName, int line, int column) { + // Construct the TeXstudio command + return commandPath + " --line " + line + " " + fileName.toString(); + } } From b0821bf0d99a480e7c26eb7f8be6ee7336d1988f Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Sun, 20 Oct 2024 22:37:08 +1100 Subject: [PATCH 02/30] First version to use double click to open TeXstudio --- buildres/abbrv.jabref.org | 2 +- src/main/resources/csl-styles | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildres/abbrv.jabref.org b/buildres/abbrv.jabref.org index d87037495de..6ec4cd0ea47 160000 --- a/buildres/abbrv.jabref.org +++ b/buildres/abbrv.jabref.org @@ -1 +1 @@ -Subproject commit d87037495de7213b896dbb6a20170387de170709 +Subproject commit 6ec4cd0ea474313bc39e0d81aae43a9e8b598f21 diff --git a/src/main/resources/csl-styles b/src/main/resources/csl-styles index b413a778b81..1e20dd605e3 160000 --- a/src/main/resources/csl-styles +++ b/src/main/resources/csl-styles @@ -1 +1 @@ -Subproject commit b413a778b8170cf5aebbb9aeffec62cfd068e19e +Subproject commit 1e20dd605e3db1d87a5426eada0a6b1fe4fe52e6 From 84fdf955368a7fb9b03a28342a88a783a9fa4029 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Sun, 20 Oct 2024 23:05:08 +1100 Subject: [PATCH 03/30] change the click count to two --- .../org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index bc4242afbcb..b704cf34a6e 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -168,7 +168,7 @@ public void handleMouseClick(MouseEvent event, CitationsDisplay citationsDisplay Citation selectedItem = citationsDisplay.getSelectionModel().getSelectedItem(); // Check if the left mouse button was double-clicked - if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() == 1 && selectedItem != null) { + if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() == 2 && selectedItem != null) { // Perform a jump or other actions System.out.println("Double-clicked on: " + selectedItem); PushToApplicationCommand abstractPushToApplication; From 7f95c8b95a3a27d64d6341e75fd24eeeafc328fc Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Mon, 21 Oct 2024 00:02:02 +1100 Subject: [PATCH 04/30] I set the GitHub page for the test --- src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java index 330767314cb..7dbc5f8f26d 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java @@ -60,7 +60,6 @@ private void setSearchPane() { citationsDisplay.setItems(viewModel.getCitationList()); citationsDisplay.setOnMouseClicked(event -> viewModel.handleMouseClick(event, citationsDisplay)); - RowConstraints mainRow = new RowConstraints(); mainRow.setVgrow(Priority.ALWAYS); From a41d5dd7d5c96c9eb85970b9d33cc893b00efc47 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Mon, 21 Oct 2024 00:57:53 +1100 Subject: [PATCH 05/30] Replace exec() with ProcessBuilder and printStackTrace() with LOGGER --- .../LatexCitationsTabViewModel.java | 10 ---------- .../gui/push/AbstractPushToApplication.java | 20 +++++++++++-------- .../org/jabref/gui/push/PushToTeXstudio.java | 4 ++-- 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index b704cf34a6e..46339cd00d4 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -20,10 +20,8 @@ import org.jabref.gui.AbstractViewModel; import org.jabref.gui.DialogService; -import org.jabref.gui.actions.ActionFactory; import org.jabref.gui.preferences.GuiPreferences; import org.jabref.gui.push.PushToApplication; -import org.jabref.gui.push.PushToApplicationCommand; import org.jabref.gui.push.PushToApplications; import org.jabref.gui.push.PushToEmacs; import org.jabref.gui.texparser.CitationsDisplay; @@ -170,21 +168,13 @@ public void handleMouseClick(MouseEvent event, CitationsDisplay citationsDisplay // Check if the left mouse button was double-clicked if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() == 2 && selectedItem != null) { // Perform a jump or other actions - System.out.println("Double-clicked on: " + selectedItem); - PushToApplicationCommand abstractPushToApplication; -// abstractPushToApplication = new PushToApplicationCommand(dialogService, preferences); -// }; -// abstractPushToApplication.publicJumpToLine(selectedItem.path(), selectedItem.line(), selectedItem.colStart()); -// jumpToAction(selectedItem); String applicationName = preferences.getPushToApplicationPreferences() .getActiveApplicationName(); - final ActionFactory factory = new ActionFactory(); PushToApplication application = PushToApplications.getApplicationByName( applicationName, dialogService, preferences) .orElse(new PushToEmacs(dialogService, preferences)); - preferences.getPushToApplicationPreferences().setActiveApplicationName(application.getDisplayName()); application.publicJumpToLine(selectedItem.path(), selectedItem.line(), selectedItem.colStart()); } diff --git a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java index 0355c8450e8..c4f863170bc 100644 --- a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java +++ b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java @@ -195,20 +195,24 @@ protected void jumpToLine(Path fileName, int line, int column) { notDefined = true; return; } + // Execute the command - String command = jumpString(fileName, line, column); + String[] command = jumpString(fileName, line, column); + try { - Runtime.getRuntime().exec(command); - } catch ( - IOException e) { - // Handle exceptions (log or show error message) - e.printStackTrace(); + ProcessBuilder processBuilder = new ProcessBuilder(command); + processBuilder.start(); + } catch (IOException e) { + // Use robust logging instead of printStackTrace() + LOGGER.error("Could not open TeXstudio at the specified location.", e); + + // Show an error dialog to the user dialogService.showErrorDialogAndWait("Error", "Could not open TeXstudio at the specified location."); } } - protected String jumpString(Path fileName, int line, int column) { - return ""; + protected String[] jumpString(Path fileName, int line, int column) { + return new String[0]; } public void publicJumpToLine(Path fileName, int line, int column) { diff --git a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java index f35dbff7f2f..a13bdf507ec 100644 --- a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java +++ b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java @@ -34,8 +34,8 @@ protected String[] getCommandLine(String keyString) { * Method to open TeXstudio at the given line number in the specified LaTeX file. */ @Override - public String jumpString(Path fileName, int line, int column) { + public String[] jumpString(Path fileName, int line, int column) { // Construct the TeXstudio command - return commandPath + " --line " + line + " " + fileName.toString(); + return new String[] {commandPath, "--line", Integer.toString(line), fileName.toString()}; } } From 677c6045f870f52a55e1076f06f68a7153ba2f7a Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Tue, 22 Oct 2024 15:55:16 +1100 Subject: [PATCH 06/30] change some useless functions --- .../LatexCitationsTabViewModel.java | 2 +- .../gui/push/AbstractPushToApplication.java | 19 +++++++------------ .../jabref/gui/push/PushToApplication.java | 2 +- .../gui/push/PushToApplicationCommand.java | 5 ----- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index 46339cd00d4..605dbef47d4 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -176,7 +176,7 @@ public void handleMouseClick(MouseEvent event, CitationsDisplay citationsDisplay preferences) .orElse(new PushToEmacs(dialogService, preferences)); preferences.getPushToApplicationPreferences().setActiveApplicationName(application.getDisplayName()); - application.publicJumpToLine(selectedItem.path(), selectedItem.line(), selectedItem.colStart()); + application.jumpToLine(selectedItem.path(), selectedItem.line(), selectedItem.colStart()); } } diff --git a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java index c4f863170bc..4dadf4af650 100644 --- a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java +++ b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java @@ -187,27 +187,22 @@ public Optional getKeyBinding() { * This function is to jump to a specific line due to different editor. * */ - protected void jumpToLine(Path fileName, int line, int column) { + protected void jumpToLine(Path fileName, int line, int column, ProcessBuilder processBuilder) { commandPath = preferences.getPushToApplicationPreferences().getCommandPaths().get(this.getDisplayName()); - // Check if a path to the command has been specified if (StringUtil.isNullOrEmpty(commandPath)) { notDefined = true; return; } - // Execute the command String[] command = jumpString(fileName, line, column); try { - ProcessBuilder processBuilder = new ProcessBuilder(command); + processBuilder.command(command); processBuilder.start(); - } catch (IOException e) { - // Use robust logging instead of printStackTrace() - LOGGER.error("Could not open TeXstudio at the specified location.", e); - - // Show an error dialog to the user - dialogService.showErrorDialogAndWait("Error", "Could not open TeXstudio at the specified location."); + } catch (IOException excep) { + LOGGER.warn("Error: Could not call executable '{}'", commandPath, excep); + couldNotCall = true; } } @@ -215,7 +210,7 @@ protected String[] jumpString(Path fileName, int line, int column) { return new String[0]; } - public void publicJumpToLine(Path fileName, int line, int column) { - jumpToLine(fileName, line, column); + public void jumpToLine(Path fileName, int line, int column) { + jumpToLine(fileName, line, column, new ProcessBuilder()); } } diff --git a/src/main/java/org/jabref/gui/push/PushToApplication.java b/src/main/java/org/jabref/gui/push/PushToApplication.java index d5b508c88d3..9292b433fb9 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplication.java +++ b/src/main/java/org/jabref/gui/push/PushToApplication.java @@ -58,5 +58,5 @@ public interface PushToApplication { String getDelimiter(); - void publicJumpToLine(Path fileName, int line, int column); + void jumpToLine(Path fileName, int line, int column); } diff --git a/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java b/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java index 482ef485920..92d3c1824cd 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java +++ b/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java @@ -104,7 +104,6 @@ private static String getKeyString(List entries, String delimiter) { for (BibEntry bes : entries) { citeKey = bes.getCitationKey(); if (citeKey.isEmpty() || citeKey.get().isEmpty()) { - // Should never occur, because we made sure that all entries have keys continue; } if (first) { @@ -142,8 +141,4 @@ private void pushEntries() { BibDatabaseContext database = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null")); application.pushEntries(database, stateManager.getSelectedEntries(), getKeyString(stateManager.getSelectedEntries(), application.getDelimiter())); } -// private void jump(Path fileName, int line, int column) { -// BibDatabaseContext database = stateManager.getActiveDatabase().orElseThrow(() -> new NullPointerException("Database null")); -// application.publicJumpToLine(database, stateManager.getSelectedEntries(), getKeyString(stateManager.getSelectedEntries(), application.getDelimiter())); -// } } From 52158ee10f3ffaf7947d33432f2fb4bfba770781 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Tue, 22 Oct 2024 16:39:38 +1100 Subject: [PATCH 07/30] I solve the csl-styles submodel problem --- .github/workflows/assign-issue.yml | 14 ++-- .github/workflows/automerge.yml | 10 +-- .github/workflows/on-review-submitted.yml | 21 +++++ CHANGELOG.md | 2 + CONTRIBUTING.md | 20 +++-- build.gradle | 10 +-- .../jabref/gui/entryeditor/CommentsTab.java | 5 +- .../gui/externalfiles/ImportHandler.java | 24 ------ .../gui/fieldeditors/MarkdownEditor.java | 5 +- .../jabref/gui/fieldeditors/SimpleEditor.java | 4 + .../gui/mergeentries/FetchAndMergeEntry.java | 1 + .../gui/preferences/JabRefGuiPreferences.java | 5 +- .../bibtex/InvalidFieldValueException.java | 5 +- .../logic/importer/CompositeIdFetcher.java | 11 ++- .../preferences/JabRefCliPreferences.java | 5 +- .../model/entry/field/FieldFactory.java | 6 +- .../jabref/model/entry/identifier/SSRN.java | 78 +++++++++++++++++++ src/main/resources/csl-styles | 2 +- .../model/entry/identifier/SSRNTest.java | 67 ++++++++++++++++ 19 files changed, 232 insertions(+), 63 deletions(-) create mode 100644 .github/workflows/on-review-submitted.yml create mode 100644 src/main/java/org/jabref/model/entry/identifier/SSRN.java create mode 100644 src/test/java/org/jabref/model/entry/identifier/SSRNTest.java diff --git a/.github/workflows/assign-issue.yml b/.github/workflows/assign-issue.yml index 30a2e19e2f3..e88f6b762d2 100644 --- a/.github/workflows/assign-issue.yml +++ b/.github/workflows/assign-issue.yml @@ -15,27 +15,23 @@ jobs: steps: - name: Assign the user or unassign stale assignments id: assign - uses: takanome-dev/assign-issue-action@refactor-rewrite-action + uses: takanome-dev/assign-issue-action@beta with: github_token: '${{ secrets.GITHUB_TOKEN }}' days_until_unassign: 30 maintainers: koppor, Siedlerchr, ThiloteE, calixtus, HoussemNasri assigned_comment: | - 👋 Hey @{{ comment.user.login }}, + 👋 Hey @{{ handle }}, thank you for your interest in this issue! 🎉 - Thanks for your interest in this issue! 🎉 - - Newcomers, we're excited to have you on board. Start by exploring our [Contributing](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md) guidelines, and don't forget to check out our [workspace setup guidelines](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace) to get started smoothly. + We're excited to have you on board. Start by exploring our [Contributing](https://github.com/JabRef/jabref/blob/main/CONTRIBUTING.md) guidelines, and don't forget to check out our [workspace setup guidelines](https://devdocs.jabref.org/getting-into-the-code/guidelines-for-setting-up-a-local-workspace) to get started smoothly. In case you encounter failing tests during development, please check our [developer FAQs](https://devdocs.jabref.org/code-howtos/faq.html)! Having any questions or issues? Feel free to ask here on GitHub. Need help setting up your local workspace? Join the conversation on [JabRef's Gitter chat](https://gitter.im/JabRef/jabref). And don't hesitate to open a (draft) pull request early on to show the direction it is heading towards. This way, you will receive valuable feedback. - ⚠ Note that this issue will become unassigned if it isn't closed within **{{ totalDays }} days**. - - 🔧 A maintainer can also add the **{{ inputs.pin_label }}** label to prevent it from being unassigned automatically. - Happy coding! 🚀 + + ⏳ Please note, you will be automatically unassigned if the issue isn't closed within **{{ total_days }} days** (by **{{ unassigned_date }}**). A maintainer can also add the "**{{ pin_label }}**"" label to prevent automatic unassignment. - name: Move Issue to "Assigned" Column in "Candidates for University Projects" if: steps.assign.outputs.assigned == 'yes' uses: m7kvqbe1/github-action-move-issues@feat/skip-if-not-in-project-flag diff --git a/.github/workflows/automerge.yml b/.github/workflows/automerge.yml index 1e5c7011f23..856b3f66b57 100644 --- a/.github/workflows/automerge.yml +++ b/.github/workflows/automerge.yml @@ -10,13 +10,13 @@ jobs: runs-on: ubuntu-latest # Run only if PR is inside JabRef's main repository and created by dependabot or by an update workflow if: > - (github.repository == 'JabRef/jabref') && + (github.repository == 'JabRef/jabref') && (github.event.pull_request.head.repo.full_name == 'JabRef/jabref') && ( (github.actor == 'dependabot[bot]') || ( - startsWith(github.event.pull_request.title, '[Bot] ') || - startsWith(github.event.pull_request.title, 'Bump ') || + startsWith(github.event.pull_request.title, '[Bot] ') || + startsWith(github.event.pull_request.title, 'Bump ') || startsWith(github.event.pull_request.title, 'New Crowdin updates') || startsWith(github.event.pull_request.title, 'Update Gradle Wrapper from') ) @@ -26,9 +26,9 @@ jobs: run: gh pr review --approve "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}} + GH_TOKEN: ${{secrets.GH_TOKEN_JABREF_MACHINE_PR_APPROVE}} - name: Merge PR run: gh pr merge --auto --squash "$PR_URL" env: PR_URL: ${{github.event.pull_request.html_url}} - GITHUB_TOKEN: ${{secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER}} + GH_TOKEN: ${{secrets.GH_TOKEN_UPDATE_GRADLE_WRAPPER}} diff --git a/.github/workflows/on-review-submitted.yml b/.github/workflows/on-review-submitted.yml new file mode 100644 index 00000000000..7774da9a455 --- /dev/null +++ b/.github/workflows/on-review-submitted.yml @@ -0,0 +1,21 @@ +name: On reviewed PR + +on: + pull_request_review: + types: + - submitted + +jobs: + add-label-changes-required: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - run: echo ${{ github.event.review.state }} + - if: ${{ github.event.review.state == 'changes_requested' }} + run: | + gh pr edit "$PR_URL" --remove-label "status: ready-for-review" + gh pr edit "$PR_URL" --add-label "status: changes required" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GH_TOKEN: ${{ github.token }} diff --git a/CHANGELOG.md b/CHANGELOG.md index 789d8ec6968..2f5ba62e7df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We added a different background color to the search bar to indicate when the search syntax is wrong. [#11658](https://github.com/JabRef/jabref/pull/11658) - We added a setting which always adds the literal "Cited on pages" text before each JStyle citation. [#11691](https://github.com/JabRef/jabref/pull/11732) - We added a new plain citation parser that uses LLMs. [#11825](https://github.com/JabRef/jabref/issues/11825) +- We added an importer for SSRN URLs. [#12021](https://github.com/JabRef/jabref/pull/12021) - We added a compare button to the duplicates in the citation relations tab to open the "Possible duplicate entries" window. [#11192](https://github.com/JabRef/jabref/issues/11192) - We added automatic browser extension install on Windows for Chrome and Edge. [#6076](https://github.com/JabRef/jabref/issues/6076) - We added a search bar for filtering keyboard shortcuts. [#11686](https://github.com/JabRef/jabref/issues/11686) @@ -97,6 +98,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We fixed an issue where recently opened files were not displayed in the main menu properly. [#9042](https://github.com/JabRef/jabref/issues/9042) - We fixed an issue where the DOI lookup would show an error when a DOI was found for an entry. [#11850](https://github.com/JabRef/jabref/issues/11850) - We fixed an issue where Tab cannot be used to jump to next field in some single-line fields. [#11785](https://github.com/JabRef/jabref/issues/11785) +- We fixed an issue where it was not possible to select selecting content of other user's comments.[#11106](https://github.com/JabRef/jabref/issues/11106) - We fixed an issue where web search preferences "Custom API key" table modifications not discarded. [#11925](https://github.com/JabRef/jabref/issues/11925) ### Removed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5f6a209fdc5..e0efbdd98f2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -130,18 +130,22 @@ We reserve the right to reject pull requests that contain little or no genuine a ### After submission of a pull request After you submitted a pull request, automated checks will run. -You will maybe see "Some checks were not successful". +You may see "Some checks were not successful". +You can click on failing checks to see more information about why they failed. Then, please look into them and handle accordingly. -Afterwards, you will receive comments on it. -Maybe, the pull request is approved immediatly, maybe changes are requested. -In case changes are requested, please implement them. +Afterwards, you will receive comments on your pull request. +The pull request may be approved immediatly, or a reviewer may request changes. +In that case, please implement the requested changes. -After changing your code, commit on the branch and push. -The pull request will update automatically. +After implementing changes, commit to the branch your pull request is *from* and push. +The pull request will automatically be updated with your changes. +Your commits will also be automatically squashed upon the pull request being accepted. -Never ever close the pull request and open a new one. -This causes much load on our side and is not the style of the GitHub open source community. +Please – **Never ever close a pull request and open a new one** - +This causes unessesary work on our side, and is not in the the style of the GitHub open source community. +You can push any changes you need to make to the branch your pull request is *from*. +These changes will be automatically added to your pull request. ### Development hints diff --git a/build.gradle b/build.gradle index 0c7558981c8..85e3d12f0d6 100644 --- a/build.gradle +++ b/build.gradle @@ -29,9 +29,9 @@ plugins { id 'idea' - id 'org.openrewrite.rewrite' version '6.23.4' + id 'org.openrewrite.rewrite' version '6.25.1' - id "org.itsallcode.openfasttrace" version "3.0.0" + id "org.itsallcode.openfasttrace" version "3.0.1" } // Enable following for debugging @@ -238,7 +238,7 @@ dependencies { } implementation 'org.fxmisc.flowless:flowless:0.7.3' implementation 'org.fxmisc.richtext:richtextfx:0.11.3' - implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '2.58.0') { + implementation (group: 'com.dlsc.gemsfx', name: 'gemsfx', version: '2.60.0') { exclude module: 'javax.inject' // Split package, use only jakarta.inject exclude module: 'commons-lang3' exclude group: 'org.apache.commons.validator' @@ -304,7 +304,7 @@ dependencies { // Implementation of the API implementation 'org.glassfish.jersey.core:jersey-server:3.1.9' // injection framework - implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.8' + implementation 'org.glassfish.jersey.inject:jersey-hk2:3.1.9' implementation 'org.glassfish.hk2:hk2-api:3.1.1' // testImplementation 'org.glassfish.hk2:hk2-testing:3.0.4' // implementation 'org.glassfish.hk2:hk2-testing-jersey:3.0.4' @@ -374,7 +374,7 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter:5.11.0' testImplementation 'org.junit.platform:junit-platform-launcher:1.10.3' - testImplementation 'org.mockito:mockito-core:5.14.1' + testImplementation 'org.mockito:mockito-core:5.14.2' testImplementation 'org.xmlunit:xmlunit-core:2.10.0' testImplementation 'org.xmlunit:xmlunit-matchers:2.10.0' testRuntimeOnly 'com.tngtech.archunit:archunit-junit5-engine:1.3.0' diff --git a/src/main/java/org/jabref/gui/entryeditor/CommentsTab.java b/src/main/java/org/jabref/gui/entryeditor/CommentsTab.java index 428052847bf..95e2b927dd9 100644 --- a/src/main/java/org/jabref/gui/entryeditor/CommentsTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/CommentsTab.java @@ -20,6 +20,7 @@ import org.jabref.gui.autocompleter.SuggestionProviders; import org.jabref.gui.fieldeditors.FieldEditorFX; import org.jabref.gui.fieldeditors.FieldNameLabel; +import org.jabref.gui.fieldeditors.MarkdownEditor; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.preferences.GuiPreferences; import org.jabref.gui.theme.ThemeManager; @@ -135,12 +136,12 @@ protected void setupPanel(BibEntry entry, boolean compressed) { Optional fieldEditorForUserDefinedComment = editors.entrySet().stream().filter(f -> f.getKey().getName().contains(defaultOwner)).map(Map.Entry::getValue).findFirst(); for (Map.Entry fieldEditorEntry : editors.entrySet()) { Field field = fieldEditorEntry.getKey(); - FieldEditorFX editor = fieldEditorEntry.getValue(); + MarkdownEditor editor = (MarkdownEditor) fieldEditorEntry.getValue().getNode(); boolean isStandardBibtexComment = field == StandardField.COMMENT; boolean isDefaultOwnerComment = field.equals(userSpecificCommentField); boolean shouldBeEnabled = isStandardBibtexComment || isDefaultOwnerComment; - editor.getNode().setDisable(!shouldBeEnabled); + editor.setEditable(shouldBeEnabled); } // Show "Hide" button only if user-specific comment field is empty. Otherwise, it is a strange UI, because the diff --git a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java index d3b621fe16e..00e4124bc76 100644 --- a/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java +++ b/src/main/java/org/jabref/gui/externalfiles/ImportHandler.java @@ -32,9 +32,6 @@ import org.jabref.logic.importer.ImportFormatReader; import org.jabref.logic.importer.ImportFormatReader.UnknownFormatImport; import org.jabref.logic.importer.ParseException; -import org.jabref.logic.importer.fetcher.ArXivFetcher; -import org.jabref.logic.importer.fetcher.DoiFetcher; -import org.jabref.logic.importer.fetcher.isbntobibtex.IsbnFetcher; import org.jabref.logic.importer.fileformat.BibtexParser; import org.jabref.logic.l10n.Localization; import org.jabref.logic.util.BackgroundTask; @@ -49,9 +46,6 @@ import org.jabref.model.entry.BibtexString; import org.jabref.model.entry.LinkedFile; import org.jabref.model.entry.field.StandardField; -import org.jabref.model.entry.identifier.ArXivIdentifier; -import org.jabref.model.entry.identifier.DOI; -import org.jabref.model.entry.identifier.ISBN; import org.jabref.model.groups.GroupEntryChanger; import org.jabref.model.groups.GroupTreeNode; import org.jabref.model.util.FileUpdateMonitor; @@ -385,24 +379,6 @@ private List tryImportFormats(String data) { } } - private List fetchByDOI(DOI doi) throws FetcherException { - LOGGER.info("Found DOI identifier in clipboard"); - Optional entry = new DoiFetcher(preferences.getImportFormatPreferences()).performSearchById(doi.getDOI()); - return OptionalUtil.toList(entry); - } - - private List fetchByArXiv(ArXivIdentifier arXivIdentifier) throws FetcherException { - LOGGER.info("Found arxiv identifier in clipboard"); - Optional entry = new ArXivFetcher(preferences.getImportFormatPreferences()).performSearchById(arXivIdentifier.getNormalizedWithoutVersion()); - return OptionalUtil.toList(entry); - } - - private List fetchByISBN(ISBN isbn) throws FetcherException { - LOGGER.info("Found ISBN identifier in clipboard"); - Optional entry = new IsbnFetcher(preferences.getImportFormatPreferences()).performSearchById(isbn.getNormalized()); - return OptionalUtil.toList(entry); - } - public void importEntriesWithDuplicateCheck(BibDatabaseContext database, List entriesToAdd) { boolean firstEntry = true; for (BibEntry entry : entriesToAdd) { diff --git a/src/main/java/org/jabref/gui/fieldeditors/MarkdownEditor.java b/src/main/java/org/jabref/gui/fieldeditors/MarkdownEditor.java index 891757d43ca..7d230d3db2a 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/MarkdownEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/MarkdownEditor.java @@ -15,7 +15,6 @@ import com.vladsch.flexmark.html2md.converter.FlexmarkHtmlConverter; public class MarkdownEditor extends SimpleEditor { - private final FlexmarkHtmlConverter flexmarkHtmlConverter = FlexmarkHtmlConverter.builder().build(); public MarkdownEditor(Field field, SuggestionProvider suggestionProvider, FieldCheckers fieldCheckers, GuiPreferences preferences, UndoManager undoManager, UndoAction undoAction, RedoAction redoAction) { @@ -37,4 +36,8 @@ public void paste() { } }; } + + public void setEditable(boolean isEditable) { + getTextInput().setEditable(isEditable); + } } diff --git a/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java b/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java index 89a6464d843..9b9537c967e 100644 --- a/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java +++ b/src/main/java/org/jabref/gui/fieldeditors/SimpleEditor.java @@ -72,4 +72,8 @@ public Parent getNode() { public void requestFocus() { textInput.requestFocus(); } + + protected TextInputControl getTextInput() { + return textInput; + } } diff --git a/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java b/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java index dbe205a24c4..c14e0770c15 100644 --- a/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java +++ b/src/main/java/org/jabref/gui/mergeentries/FetchAndMergeEntry.java @@ -40,6 +40,7 @@ */ public class FetchAndMergeEntry { + // All identifiers listed here should also appear at {@link org.jabref.logic.importer.CompositeIdFetcher#performSearchById} public static List SUPPORTED_FIELDS = Arrays.asList(StandardField.DOI, StandardField.EPRINT, StandardField.ISBN); private static final Logger LOGGER = LoggerFactory.getLogger(FetchAndMergeEntry.class); diff --git a/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java b/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java index d3cfb4de424..de125cf5613 100644 --- a/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java +++ b/src/main/java/org/jabref/gui/preferences/JabRefGuiPreferences.java @@ -394,7 +394,10 @@ private JabRefGuiPreferences() { // endregion } - @Deprecated + /** + * Never ever add a call to this method. There should be only one caller. + * All other usages should get the preferences passed (or injected). + */ public static JabRefGuiPreferences getInstance() { if (JabRefGuiPreferences.singleton == null) { JabRefGuiPreferences.singleton = new JabRefGuiPreferences(); diff --git a/src/main/java/org/jabref/logic/bibtex/InvalidFieldValueException.java b/src/main/java/org/jabref/logic/bibtex/InvalidFieldValueException.java index 6ee28e171d5..2e55ce86c6c 100644 --- a/src/main/java/org/jabref/logic/bibtex/InvalidFieldValueException.java +++ b/src/main/java/org/jabref/logic/bibtex/InvalidFieldValueException.java @@ -1,9 +1,10 @@ package org.jabref.logic.bibtex; /** - * @deprecated implement as {@link org.jabref.logic.integrity.IntegrityCheck} instead. + * Use only if you know what you are doing. + * + * Otherwise, you should implement your functionality as {@link org.jabref.logic.integrity.IntegrityCheck} instead. */ -@Deprecated public class InvalidFieldValueException extends Exception { public InvalidFieldValueException(String message) { diff --git a/src/main/java/org/jabref/logic/importer/CompositeIdFetcher.java b/src/main/java/org/jabref/logic/importer/CompositeIdFetcher.java index 83d939a3085..b1630a12468 100644 --- a/src/main/java/org/jabref/logic/importer/CompositeIdFetcher.java +++ b/src/main/java/org/jabref/logic/importer/CompositeIdFetcher.java @@ -10,6 +10,7 @@ import org.jabref.model.entry.identifier.ArXivIdentifier; import org.jabref.model.entry.identifier.DOI; import org.jabref.model.entry.identifier.ISBN; +import org.jabref.model.entry.identifier.SSRN; public class CompositeIdFetcher { @@ -20,6 +21,8 @@ public CompositeIdFetcher(ImportFormatPreferences importFormatPreferences) { } public Optional performSearchById(String identifier) throws FetcherException { + // All identifiers listed here should also be appear at {@link org.jabref.gui.mergeentries.FetchAndMergeEntry.SUPPORTED_FIELDS} and vice versa. + Optional doi = DOI.findInText(identifier); if (doi.isPresent()) { return new DoiFetcher(importFormatPreferences).performSearchById(doi.get().getNormalized()); @@ -41,6 +44,11 @@ public Optional performSearchById(String identifier) throws FetcherExc return new IacrEprintFetcher(importFormatPreferences).performSearchById(iacrEprint.get().getNormalized()); }*/ + Optional ssrn = SSRN.parse(identifier); + if (ssrn.isPresent()) { + return new DoiFetcher(importFormatPreferences).performSearchById(ssrn.get().toDoi().getNormalized()); + } + return Optional.empty(); } @@ -52,7 +60,8 @@ public static boolean containsValidId(String identifier) { Optional doi = DOI.findInText(identifier); Optional arXivIdentifier = ArXivIdentifier.parse(identifier); Optional isbn = ISBN.parse(identifier); + Optional ssrn = SSRN.parse(identifier); - return Stream.of(doi, arXivIdentifier, isbn).anyMatch(Optional::isPresent); + return Stream.of(doi, arXivIdentifier, isbn, ssrn).anyMatch(Optional::isPresent); } } diff --git a/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java b/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java index 79492a8f72c..195909355dd 100644 --- a/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java +++ b/src/main/java/org/jabref/logic/preferences/JabRefCliPreferences.java @@ -665,10 +665,9 @@ public void setLanguageDependentDefaultValues() { } /** - * @return Instance of JaRefPreferences - * @deprecated Use {@link CliPreferences} instead + * Never ever add a call to this method. There should be only one caller. + * All other usages should get the preferences passed (or injected). */ - @Deprecated public static JabRefCliPreferences getInstance() { if (JabRefCliPreferences.singleton == null) { JabRefCliPreferences.singleton = new JabRefCliPreferences(); diff --git a/src/main/java/org/jabref/model/entry/field/FieldFactory.java b/src/main/java/org/jabref/model/entry/field/FieldFactory.java index ff660ad4ab6..1d0eb8ccfcf 100644 --- a/src/main/java/org/jabref/model/entry/field/FieldFactory.java +++ b/src/main/java/org/jabref/model/entry/field/FieldFactory.java @@ -222,7 +222,11 @@ public static List getDefaultGeneralFields() { return defaultGeneralFields; } - // TODO: This should ideally be user configurable! (https://github.com/JabRef/jabref/issues/9840) + /** + * Note: User configurability is discussed at #9840. + * + * @param nonWrappableFields This comes from the preferences - and introduces user configuration. + */ // TODO: Move somewhere more appropriate in the future public static boolean isMultiLineField(final Field field, List nonWrappableFields) { return field.getProperties().contains(FieldProperty.MULTILINE_TEXT) || nonWrappableFields.contains(field); diff --git a/src/main/java/org/jabref/model/entry/identifier/SSRN.java b/src/main/java/org/jabref/model/entry/identifier/SSRN.java new file mode 100644 index 00000000000..3ff7c7dcf1c --- /dev/null +++ b/src/main/java/org/jabref/model/entry/identifier/SSRN.java @@ -0,0 +1,78 @@ +package org.jabref.model.entry.identifier; + +import java.net.URI; +import java.util.Objects; +import java.util.Optional; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * Represents an SSRN article, identified by its abstract ID. + */ +public class SSRN extends EprintIdentifier { + + private static final String SSRN_URL_REGEX = "(https?://)?(papers\\.)?ssrn\\.com/(sol3/papers.cfm\\?)?abstract(_id)?=(?\\d+)"; + private static final Pattern SSRN_URL_FULL_MATCH = Pattern.compile("^" + SSRN_URL_REGEX + "$", Pattern.CASE_INSENSITIVE); + private static final Pattern SSRN_URL_MATCH = Pattern.compile(SSRN_URL_REGEX, Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); + + private final Integer abstractId; + + /** + * Tries to parse an SSRN identifier + * + * @param string Either a number or a SSRN url that has the abstract ID in it + * @throws NullPointerException If you pass a null to the constructor + * @throws IllegalArgumentException Invalid string passed to the constructor + */ + public SSRN(String string) { + Objects.requireNonNull(string); + string = string.trim(); + + if (string.chars().allMatch(Character::isDigit)) { + abstractId = Integer.parseInt(string); + return; + } + + Matcher matcher = SSRN_URL_FULL_MATCH.matcher(string); + if (matcher.find()) { + abstractId = Integer.parseInt(matcher.group("id")); + return; + } + + throw new IllegalArgumentException(string + " is not a valid SSRN identifier"); + } + + public SSRN(Integer abstractId) { + this.abstractId = abstractId; + } + + public static Optional parse(String data) { + Matcher matcher = SSRN_URL_MATCH.matcher(data); + if (matcher.find()) { + int abstractId = Integer.parseInt(matcher.group("id")); + return Optional.of(new SSRN(abstractId)); + } + + return Optional.empty(); + } + + @Override + public String getNormalized() { + return String.valueOf(abstractId); + } + + @Override + public Optional getExternalURI() { + URI uri = URI.create("https://ssrn.com/abstract=" + abstractId); + return Optional.of(uri); + } + + /** + * Generate the DOI based on the SSRN + * + * @return a DOI formatted as 10.2139/ssrn.[article] + */ + public DOI toDoi() { + return new DOI("10.2139/ssrn." + abstractId); + } +} diff --git a/src/main/resources/csl-styles b/src/main/resources/csl-styles index 1e20dd605e3..b413a778b81 160000 --- a/src/main/resources/csl-styles +++ b/src/main/resources/csl-styles @@ -1 +1 @@ -Subproject commit 1e20dd605e3db1d87a5426eada0a6b1fe4fe52e6 +Subproject commit b413a778b8170cf5aebbb9aeffec62cfd068e19e diff --git a/src/test/java/org/jabref/model/entry/identifier/SSRNTest.java b/src/test/java/org/jabref/model/entry/identifier/SSRNTest.java new file mode 100644 index 00000000000..c7dbe3abfcd --- /dev/null +++ b/src/test/java/org/jabref/model/entry/identifier/SSRNTest.java @@ -0,0 +1,67 @@ +package org.jabref.model.entry.identifier; + +import java.net.URI; +import java.util.Optional; +import java.util.stream.Stream; + +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class SSRNTest { + private static Stream provideTestData() { + return Stream.of( + // Basic string + Arguments.of(false, "4904445"), + Arguments.of(false, " 4904445 "), + + // URLs + Arguments.of(true, "https://ssrn.com/abstract=4904445"), + Arguments.of(true, "https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4904445"), + Arguments.of(true, " https://ssrn.com/abstract=4904445 "), + Arguments.of(true, " https://papers.ssrn.com/sol3/papers.cfm?abstract_id=4904445 "), + Arguments.of(true, "http://ssrn.com/abstract=4904445") + ); + } + + /** + * @param findInText if the input should be found when passing through "find in text" + * @param input the input to be checked + */ + @ParameterizedTest + @MethodSource("provideTestData") + public void acceptCorrectSSRNAbstracts(boolean findInText, String input) { + assertEquals("4904445", new SSRN(input).getNormalized()); + Optional parsed = SSRN.parse(input); + + if (findInText) { + assertTrue(parsed.isPresent()); + assertEquals("4904445", parsed.get().getNormalized()); + } else { + assertTrue(parsed.isEmpty()); + } + } + + @Test + public void findInText() { + Optional parsed = SSRN.parse("The example paper (https://ssrn.com/abstract=4904445) should be found within this text"); + assertTrue(parsed.isPresent()); + assertEquals("4904445", parsed.get().getNormalized()); + } + + @Test + public void identifierNormalisation() { + assertEquals("123456", new SSRN(123456).getNormalized()); + } + + @Test + public void identifierExternalUrl() { + SSRN ssrnIdentifier = new SSRN(123456); + URI uri = URI.create("https://ssrn.com/abstract=123456"); + assertEquals(Optional.of(uri), ssrnIdentifier.getExternalURI()); + } +} From eef355e8f187e3c656b1542e5fda6b442d62d3b7 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Tue, 22 Oct 2024 16:55:38 +1100 Subject: [PATCH 08/30] Solve the avvrv.jabref.org conflict --- buildres/abbrv.jabref.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildres/abbrv.jabref.org b/buildres/abbrv.jabref.org index 6ec4cd0ea47..d87037495de 160000 --- a/buildres/abbrv.jabref.org +++ b/buildres/abbrv.jabref.org @@ -1 +1 @@ -Subproject commit 6ec4cd0ea474313bc39e0d81aae43a9e8b598f21 +Subproject commit d87037495de7213b896dbb6a20170387de170709 From 998659c980e44b8987888c771e409855fe01a8d8 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 14:45:33 +1100 Subject: [PATCH 09/30] The double click function works fine for the emacs external program --- src/main/java/org/jabref/gui/push/PushToEmacs.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/org/jabref/gui/push/PushToEmacs.java b/src/main/java/org/jabref/gui/push/PushToEmacs.java index c3d612b2d48..2f07c766685 100644 --- a/src/main/java/org/jabref/gui/push/PushToEmacs.java +++ b/src/main/java/org/jabref/gui/push/PushToEmacs.java @@ -2,6 +2,7 @@ import java.io.IOException; import java.io.InputStream; +import java.nio.file.Path; import java.util.Arrays; import java.util.List; @@ -147,4 +148,9 @@ protected String getCommandName() { public PushToApplicationSettings getSettings(PushToApplication application, PushToApplicationPreferences preferences) { return new PushToEmacsSettings(application, dialogService, this.preferences.getFilePreferences(), preferences); } + + @Override + protected String[] jumpString(Path fileName, int line, int column) { + return new String[] {commandPath, "+%s".formatted(line), fileName.toString()}; + } } From 1c22c560717eb382386e2643d82c0366aa60f683 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 17:00:49 +1100 Subject: [PATCH 10/30] The double click function works fine for the TeXworks external program --- src/main/java/org/jabref/gui/push/PushToTexmaker.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/jabref/gui/push/PushToTexmaker.java b/src/main/java/org/jabref/gui/push/PushToTexmaker.java index 75bae32116a..a1eee811b24 100644 --- a/src/main/java/org/jabref/gui/push/PushToTexmaker.java +++ b/src/main/java/org/jabref/gui/push/PushToTexmaker.java @@ -1,5 +1,7 @@ package org.jabref.gui.push; +import java.nio.file.Path; + import org.jabref.gui.DialogService; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; @@ -30,4 +32,9 @@ public JabRefIcon getApplicationIcon() { protected String[] getCommandLine(String keyString) { return new String[] {commandPath, "-insert", getCitePrefix() + keyString + getCiteSuffix()}; } + + @Override + protected String[] jumpString(Path fileName, int line, int column) { + return new String[] {commandPath, "-line", Integer.toString(line), fileName.toString()}; + } } From 8294e735862c498e4c14d408f7fa32d0c7ddfdb8 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 20:22:57 +1100 Subject: [PATCH 11/30] I changed the required code. I also delete some useless comment. I make TeXworks works for this feature --- .../gui/entryeditor/LatexCitationsTabViewModel.java | 4 ---- .../jabref/gui/push/AbstractPushToApplication.java | 13 +++---------- .../jabref/gui/push/PushToApplicationCommand.java | 1 + src/main/java/org/jabref/gui/push/PushToLyx.java | 7 +++++++ .../java/org/jabref/gui/push/PushToTeXstudio.java | 3 --- .../java/org/jabref/gui/push/PushToTeXworks.java | 7 +++++++ 6 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index 605dbef47d4..43adc3960a9 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -160,14 +160,10 @@ public void onDirectoryDelete(File directory) { }; } - // Handle mouse click event public void handleMouseClick(MouseEvent event, CitationsDisplay citationsDisplay) { - // Get the currently selected item Citation selectedItem = citationsDisplay.getSelectionModel().getSelectedItem(); - // Check if the left mouse button was double-clicked if (event.getButton() == MouseButton.PRIMARY && event.getClickCount() == 2 && selectedItem != null) { - // Perform a jump or other actions String applicationName = preferences.getPushToApplicationPreferences() .getActiveApplicationName(); PushToApplication application = PushToApplications.getApplicationByName( diff --git a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java index 4dadf4af650..5b5003ab5b3 100644 --- a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java +++ b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java @@ -183,11 +183,7 @@ public Optional getKeyBinding() { } } - /** - * This function is to jump to a specific line due to different editor. - * - */ - protected void jumpToLine(Path fileName, int line, int column, ProcessBuilder processBuilder) { + public void jumpToLine(Path fileName, int line, int column) { commandPath = preferences.getPushToApplicationPreferences().getCommandPaths().get(this.getDisplayName()); if (StringUtil.isNullOrEmpty(commandPath)) { @@ -196,7 +192,7 @@ protected void jumpToLine(Path fileName, int line, int column, ProcessBuilder pr } String[] command = jumpString(fileName, line, column); - + ProcessBuilder processBuilder = new ProcessBuilder(); try { processBuilder.command(command); processBuilder.start(); @@ -207,10 +203,7 @@ protected void jumpToLine(Path fileName, int line, int column, ProcessBuilder pr } protected String[] jumpString(Path fileName, int line, int column) { + LOGGER.error("Not yet implemented"); return new String[0]; } - - public void jumpToLine(Path fileName, int line, int column) { - jumpToLine(fileName, line, column, new ProcessBuilder()); - } } diff --git a/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java b/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java index 92d3c1824cd..5ab1c532d4d 100644 --- a/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java +++ b/src/main/java/org/jabref/gui/push/PushToApplicationCommand.java @@ -104,6 +104,7 @@ private static String getKeyString(List entries, String delimiter) { for (BibEntry bes : entries) { citeKey = bes.getCitationKey(); if (citeKey.isEmpty() || citeKey.get().isEmpty()) { + LOGGER.warn("Should never occur, because we made sure that all entries have keys"); continue; } if (first) { diff --git a/src/main/java/org/jabref/gui/push/PushToLyx.java b/src/main/java/org/jabref/gui/push/PushToLyx.java index 0bcb7795fc8..660a68df463 100644 --- a/src/main/java/org/jabref/gui/push/PushToLyx.java +++ b/src/main/java/org/jabref/gui/push/PushToLyx.java @@ -5,6 +5,7 @@ import java.io.FileWriter; import java.io.IOException; import java.nio.charset.StandardCharsets; +import java.nio.file.Path; import java.util.List; import org.jabref.gui.DialogService; @@ -95,4 +96,10 @@ public void pushEntries(BibDatabaseContext database, final List entrie } }); } + + @Override + protected String[] jumpString(Path fileName, int line, int column) { + LOGGER.warn("not implemented"); + return new String[0]; + } } diff --git a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java index a13bdf507ec..0b7a12320c6 100644 --- a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java +++ b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java @@ -30,9 +30,6 @@ protected String[] getCommandLine(String keyString) { return new String[] {commandPath, "--insert-cite", "%s%s%s".formatted(getCitePrefix(), keyString, getCiteSuffix())}; } - /** - * Method to open TeXstudio at the given line number in the specified LaTeX file. - */ @Override public String[] jumpString(Path fileName, int line, int column) { // Construct the TeXstudio command diff --git a/src/main/java/org/jabref/gui/push/PushToTeXworks.java b/src/main/java/org/jabref/gui/push/PushToTeXworks.java index c59df18ba0f..1f25c795233 100644 --- a/src/main/java/org/jabref/gui/push/PushToTeXworks.java +++ b/src/main/java/org/jabref/gui/push/PushToTeXworks.java @@ -1,5 +1,7 @@ package org.jabref.gui.push; +import java.nio.file.Path; + import org.jabref.gui.DialogService; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; @@ -33,4 +35,9 @@ public JabRefIcon getApplicationIcon() { protected String[] getCommandLine(String keyString) { return new String[] {commandPath, "--insert-text", "%s%s%s".formatted(getCitePrefix(), keyString, getCiteSuffix())}; } + + @Override + protected String[] jumpString(Path fileName, int line, int column) { + return new String[] {commandPath, fileName.toString(), "-line", Integer.toString(line)}; + } } From 45c67771f037541dae24ffc921426e444436782f Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 20:24:46 +1100 Subject: [PATCH 12/30] finished texWorks and delete some comments --- buildres/abbrv.jabref.org | 2 +- src/main/resources/csl-styles | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/buildres/abbrv.jabref.org b/buildres/abbrv.jabref.org index d87037495de..6ec4cd0ea47 160000 --- a/buildres/abbrv.jabref.org +++ b/buildres/abbrv.jabref.org @@ -1 +1 @@ -Subproject commit d87037495de7213b896dbb6a20170387de170709 +Subproject commit 6ec4cd0ea474313bc39e0d81aae43a9e8b598f21 diff --git a/src/main/resources/csl-styles b/src/main/resources/csl-styles index b413a778b81..1e20dd605e3 160000 --- a/src/main/resources/csl-styles +++ b/src/main/resources/csl-styles @@ -1 +1 @@ -Subproject commit b413a778b8170cf5aebbb9aeffec62cfd068e19e +Subproject commit 1e20dd605e3db1d87a5426eada0a6b1fe4fe52e6 From ac62f2ddf444b1429ae444b0202ebe114d44ea09 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 20:48:33 +1100 Subject: [PATCH 13/30] delete some comments --- src/main/java/org/jabref/gui/push/PushToTeXworks.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/push/PushToTeXworks.java b/src/main/java/org/jabref/gui/push/PushToTeXworks.java index 1f25c795233..4dba2e83db6 100644 --- a/src/main/java/org/jabref/gui/push/PushToTeXworks.java +++ b/src/main/java/org/jabref/gui/push/PushToTeXworks.java @@ -38,6 +38,7 @@ protected String[] getCommandLine(String keyString) { @Override protected String[] jumpString(Path fileName, int line, int column) { - return new String[] {commandPath, fileName.toString(), "-line", Integer.toString(line)}; + // didn't find any command to jump to a specific line + return new String[] {commandPath, fileName.toString()}; } } From 6bf9f304597faa426e17c8d04260f690162c1461 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 21:05:38 +1100 Subject: [PATCH 14/30] solve untrack files --- feature-latex-editor#11996 | 0 src/main/resources/csl-locales | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 feature-latex-editor#11996 diff --git a/feature-latex-editor#11996 b/feature-latex-editor#11996 new file mode 100644 index 00000000000..e69de29bb2d diff --git a/src/main/resources/csl-locales b/src/main/resources/csl-locales index 4753e3a9aca..8bc2af16f51 160000 --- a/src/main/resources/csl-locales +++ b/src/main/resources/csl-locales @@ -1 +1 @@ -Subproject commit 4753e3a9aca4b806ac0e3036ed727d47bf8f678e +Subproject commit 8bc2af16f5180a8e4fb591c2be916650f75bb8f6 From 1372e2a24200a0d61aafdc30cae3a14d18b65a3e Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 21:17:11 +1100 Subject: [PATCH 15/30] I make Sublime Text works for this feature --- src/main/java/org/jabref/gui/push/PushToSublimeText.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/java/org/jabref/gui/push/PushToSublimeText.java b/src/main/java/org/jabref/gui/push/PushToSublimeText.java index af0820e7ab2..cc6883a5a67 100644 --- a/src/main/java/org/jabref/gui/push/PushToSublimeText.java +++ b/src/main/java/org/jabref/gui/push/PushToSublimeText.java @@ -86,4 +86,9 @@ protected String[] getCommandLine(String keyString) { return new String[] {"sh", "-c", "\"" + commandPath + "\"" + " --command 'insert {\"characters\": \"" + citeCommand + keyString + getCiteSuffix() + "\"}'"}; } } + + @Override + protected String[] jumpString(Path fileName, int line, int column) { + return new String[] {commandPath, "%s:%s:%s".formatted(fileName.toString(), line, column)}; + } } From 7944ee3bda3aa94b80933a2ac3ffbcfecb91351f Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 21:43:31 +1100 Subject: [PATCH 16/30] I make WinEdt works for this feature --- src/main/java/org/jabref/gui/push/PushToWinEdt.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/jabref/gui/push/PushToWinEdt.java b/src/main/java/org/jabref/gui/push/PushToWinEdt.java index 7545a75244c..6eb5cdfab84 100644 --- a/src/main/java/org/jabref/gui/push/PushToWinEdt.java +++ b/src/main/java/org/jabref/gui/push/PushToWinEdt.java @@ -1,5 +1,7 @@ package org.jabref.gui.push; +import java.nio.file.Path; + import org.jabref.gui.DialogService; import org.jabref.gui.icon.IconTheme; import org.jabref.gui.icon.JabRefIcon; @@ -28,4 +30,9 @@ protected String[] getCommandLine(String keyString) { return new String[] {commandPath, "\"[InsText('" + getCitePrefix() + keyString.replace("'", "''") + getCiteSuffix() + "');]\""}; } + + @Override + protected String[] jumpString(Path fileName, int line, int column) { + return new String[] {commandPath, "\"[Open(|%s|);SelLine(%s,%s);]\"".formatted(fileName.toString(), Integer.toString(line), Integer.toString(0))}; + } } From 85fa67e18abb769c6c353f233a4c1f8d307969e4 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 21:52:13 +1100 Subject: [PATCH 17/30] delete some command and change jumpString to jumpToLineCommandlineArguments --- .github/workflows/on-review-submitted.yml | 21 ------------------- .../gui/push/AbstractPushToApplication.java | 4 ++-- .../java/org/jabref/gui/push/PushToEmacs.java | 2 +- .../java/org/jabref/gui/push/PushToLyx.java | 2 +- .../jabref/gui/push/PushToSublimeText.java | 2 +- .../org/jabref/gui/push/PushToTeXstudio.java | 2 +- .../org/jabref/gui/push/PushToTeXworks.java | 4 ++-- .../org/jabref/gui/push/PushToTexmaker.java | 2 +- .../org/jabref/gui/push/PushToWinEdt.java | 2 +- 9 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/on-review-submitted.yml diff --git a/.github/workflows/on-review-submitted.yml b/.github/workflows/on-review-submitted.yml deleted file mode 100644 index 7774da9a455..00000000000 --- a/.github/workflows/on-review-submitted.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: On reviewed PR - -on: - pull_request_review: - types: - - submitted - -jobs: - add-label-changes-required: - runs-on: ubuntu-latest - permissions: - issues: write - steps: - - run: echo ${{ github.event.review.state }} - - if: ${{ github.event.review.state == 'changes_requested' }} - run: | - gh pr edit "$PR_URL" --remove-label "status: ready-for-review" - gh pr edit "$PR_URL" --add-label "status: changes required" - env: - PR_URL: ${{github.event.pull_request.html_url}} - GH_TOKEN: ${{ github.token }} diff --git a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java index 5b5003ab5b3..15615c88691 100644 --- a/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java +++ b/src/main/java/org/jabref/gui/push/AbstractPushToApplication.java @@ -191,7 +191,7 @@ public void jumpToLine(Path fileName, int line, int column) { return; } - String[] command = jumpString(fileName, line, column); + String[] command = jumpToLineCommandlineArguments(fileName, line, column); ProcessBuilder processBuilder = new ProcessBuilder(); try { processBuilder.command(command); @@ -202,7 +202,7 @@ public void jumpToLine(Path fileName, int line, int column) { } } - protected String[] jumpString(Path fileName, int line, int column) { + protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { LOGGER.error("Not yet implemented"); return new String[0]; } diff --git a/src/main/java/org/jabref/gui/push/PushToEmacs.java b/src/main/java/org/jabref/gui/push/PushToEmacs.java index 2f07c766685..0139dc02da1 100644 --- a/src/main/java/org/jabref/gui/push/PushToEmacs.java +++ b/src/main/java/org/jabref/gui/push/PushToEmacs.java @@ -150,7 +150,7 @@ public PushToApplicationSettings getSettings(PushToApplication application, Push } @Override - protected String[] jumpString(Path fileName, int line, int column) { + protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { return new String[] {commandPath, "+%s".formatted(line), fileName.toString()}; } } diff --git a/src/main/java/org/jabref/gui/push/PushToLyx.java b/src/main/java/org/jabref/gui/push/PushToLyx.java index 660a68df463..ffe1a0c9b0c 100644 --- a/src/main/java/org/jabref/gui/push/PushToLyx.java +++ b/src/main/java/org/jabref/gui/push/PushToLyx.java @@ -98,7 +98,7 @@ public void pushEntries(BibDatabaseContext database, final List entrie } @Override - protected String[] jumpString(Path fileName, int line, int column) { + protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { LOGGER.warn("not implemented"); return new String[0]; } diff --git a/src/main/java/org/jabref/gui/push/PushToSublimeText.java b/src/main/java/org/jabref/gui/push/PushToSublimeText.java index cc6883a5a67..fbcef0b4cc2 100644 --- a/src/main/java/org/jabref/gui/push/PushToSublimeText.java +++ b/src/main/java/org/jabref/gui/push/PushToSublimeText.java @@ -88,7 +88,7 @@ protected String[] getCommandLine(String keyString) { } @Override - protected String[] jumpString(Path fileName, int line, int column) { + protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { return new String[] {commandPath, "%s:%s:%s".formatted(fileName.toString(), line, column)}; } } diff --git a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java index 0b7a12320c6..e44e7631c5d 100644 --- a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java +++ b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java @@ -31,7 +31,7 @@ protected String[] getCommandLine(String keyString) { } @Override - public String[] jumpString(Path fileName, int line, int column) { + public String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { // Construct the TeXstudio command return new String[] {commandPath, "--line", Integer.toString(line), fileName.toString()}; } diff --git a/src/main/java/org/jabref/gui/push/PushToTeXworks.java b/src/main/java/org/jabref/gui/push/PushToTeXworks.java index 4dba2e83db6..6459d848c13 100644 --- a/src/main/java/org/jabref/gui/push/PushToTeXworks.java +++ b/src/main/java/org/jabref/gui/push/PushToTeXworks.java @@ -37,8 +37,8 @@ protected String[] getCommandLine(String keyString) { } @Override - protected String[] jumpString(Path fileName, int line, int column) { - // didn't find any command to jump to a specific line + protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { + // No command known to jump to a specific line return new String[] {commandPath, fileName.toString()}; } } diff --git a/src/main/java/org/jabref/gui/push/PushToTexmaker.java b/src/main/java/org/jabref/gui/push/PushToTexmaker.java index a1eee811b24..509fb6626ff 100644 --- a/src/main/java/org/jabref/gui/push/PushToTexmaker.java +++ b/src/main/java/org/jabref/gui/push/PushToTexmaker.java @@ -34,7 +34,7 @@ protected String[] getCommandLine(String keyString) { } @Override - protected String[] jumpString(Path fileName, int line, int column) { + protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { return new String[] {commandPath, "-line", Integer.toString(line), fileName.toString()}; } } diff --git a/src/main/java/org/jabref/gui/push/PushToWinEdt.java b/src/main/java/org/jabref/gui/push/PushToWinEdt.java index 6eb5cdfab84..aa31377eed0 100644 --- a/src/main/java/org/jabref/gui/push/PushToWinEdt.java +++ b/src/main/java/org/jabref/gui/push/PushToWinEdt.java @@ -32,7 +32,7 @@ protected String[] getCommandLine(String keyString) { } @Override - protected String[] jumpString(Path fileName, int line, int column) { + protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { return new String[] {commandPath, "\"[Open(|%s|);SelLine(%s,%s);]\"".formatted(fileName.toString(), Integer.toString(line), Integer.toString(0))}; } } From d1208352d73325ac65a97e28278a08aa30499117 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 21:52:39 +1100 Subject: [PATCH 18/30] Fix csl-styles Please enter the commit message for your changes. Lines starting --- src/main/resources/csl-styles | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/csl-styles b/src/main/resources/csl-styles index 1e20dd605e3..b413a778b81 160000 --- a/src/main/resources/csl-styles +++ b/src/main/resources/csl-styles @@ -1 +1 @@ -Subproject commit 1e20dd605e3db1d87a5426eada0a6b1fe4fe52e6 +Subproject commit b413a778b8170cf5aebbb9aeffec62cfd068e19e From 6afaaefa99292c1b6c6ca0139a5bba035ce66a96 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 21:54:56 +1100 Subject: [PATCH 19/30] Fix abbrv.jabref.org submodules --- buildres/abbrv.jabref.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildres/abbrv.jabref.org b/buildres/abbrv.jabref.org index 6ec4cd0ea47..d87037495de 160000 --- a/buildres/abbrv.jabref.org +++ b/buildres/abbrv.jabref.org @@ -1 +1 @@ -Subproject commit 6ec4cd0ea474313bc39e0d81aae43a9e8b598f21 +Subproject commit d87037495de7213b896dbb6a20170387de170709 From b7b2312ca39f7b9af694814c8f2b07e54c067496 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 23:01:56 +1100 Subject: [PATCH 20/30] I make Vim works for this feature --- .../java/org/jabref/gui/push/PushToVim.java | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/src/main/java/org/jabref/gui/push/PushToVim.java b/src/main/java/org/jabref/gui/push/PushToVim.java index 8702cd11eed..6402d8e1617 100644 --- a/src/main/java/org/jabref/gui/push/PushToVim.java +++ b/src/main/java/org/jabref/gui/push/PushToVim.java @@ -2,6 +2,7 @@ import java.io.IOException; import java.io.InputStream; +import java.nio.file.Path; import java.util.Arrays; import java.util.List; @@ -10,6 +11,7 @@ import org.jabref.gui.icon.JabRefIcon; import org.jabref.gui.preferences.GuiPreferences; import org.jabref.logic.l10n.Localization; +import org.jabref.logic.os.OS; import org.jabref.logic.util.HeadlessExecutorService; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; @@ -105,4 +107,58 @@ public void onOperationCompleted() { super.onOperationCompleted(); } } + + @Override + public void jumpToLine(Path fileName, int line, int column) { + couldNotPush = false; + couldNotCall = false; + notDefined = false; + + commandPath = preferences.getPushToApplicationPreferences().getCommandPaths().get(this.getDisplayName()); + + if ((commandPath == null) || commandPath.trim().isEmpty()) { + notDefined = true; + return; + } + + ProcessBuilder processBuilder = new ProcessBuilder(); + try { + String[] command = jumpToLineCommandlineArguments(fileName, line, column); + if (OS.WINDOWS) { + processBuilder.command("cmd", + "/c", + "start", + "", + "\"%s\"".formatted(command[0]), + "\"%s\"".formatted(command[1]), + "\"%s\"".formatted(command[2]), + "\"+normal %s|\"".formatted(Integer.toString(column))); + } else if (OS.LINUX) { + processBuilder.command("gnome-terminal", + "--", + command[0], + command[1], + command[2], + command[3]); + } else if (OS.OS_X) { + processBuilder.command("open", + "-a", + "Terminal", + "--args", + command[0], + command[1], + command[2], + command[3]); + } + Process process = processBuilder.start(); + } catch (IOException excep) { + LOGGER.warn("Problem pushing to Vim.", excep); + couldNotCall = true; + } + } + + @Override + protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { + return new String[] {commandPath, "+%s".formatted(Integer.toString(line)), fileName.toString(), "+\"normal %s|\"".formatted(Integer.toString(column))}; + } } From b5040b3dc1104e276da1ca35de2f6e2ad9a79abe Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 23:17:45 +1100 Subject: [PATCH 21/30] I rewrite jumpToLine for TexShop. But I don't hava a Mac OS machine. I hope it's working. --- .../org/jabref/gui/push/PushToTexShop.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/main/java/org/jabref/gui/push/PushToTexShop.java b/src/main/java/org/jabref/gui/push/PushToTexShop.java index 889982ca8ce..3f38c0deb05 100644 --- a/src/main/java/org/jabref/gui/push/PushToTexShop.java +++ b/src/main/java/org/jabref/gui/push/PushToTexShop.java @@ -1,6 +1,7 @@ package org.jabref.gui.push; import java.io.IOException; +import java.nio.file.Path; import java.util.List; import org.jabref.gui.DialogService; @@ -13,6 +14,7 @@ import org.jabref.logic.util.HeadlessExecutorService; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; +import org.jabref.model.strings.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -86,4 +88,38 @@ protected String[] getCommandLine(String keyString) { return new String[] {}; } } + + @Override + public void jumpToLine(Path fileName, int line, int column) { + commandPath = preferences.getPushToApplicationPreferences().getCommandPaths().get(this.getDisplayName()); + + if (StringUtil.isNullOrEmpty(commandPath)) { + notDefined = true; + return; + } + + String appleScriptCommand = String.format( + "tell application \"TeXShop\"\n" + + " open POSIX file \"%s\"\n" + + " tell front document\n" + + " go to line %s\n" + + " end tell\n" + + "end tell", fileName.toString(), Integer.toString(line)); + + String[] command = {"osascript", "-e", appleScriptCommand}; + + ProcessBuilder processBuilder = new ProcessBuilder(command); + + try { + Process process = processBuilder.start(); + int exitCode = process.waitFor(); + + if (exitCode != 0) { + LOGGER.warn("Failed to execute AppleScript. Exit code: '{}'", exitCode); + } + } catch (IOException | InterruptedException excep) { + LOGGER.warn("Error: Could not call executable '{}'", commandPath, excep); + couldNotCall = true; + } + } } From 5d0bbfb1f8970cb405be9d56ee45e38a087e6a20 Mon Sep 17 00:00:00 2001 From: Ricky Du Date: Wed, 23 Oct 2024 23:45:20 +1100 Subject: [PATCH 22/30] Delete the JumpToLine in TeXshop and a comment line in TeXstudio --- .../org/jabref/gui/push/PushToTeXstudio.java | 1 - .../org/jabref/gui/push/PushToTexShop.java | 36 ------------------- 2 files changed, 37 deletions(-) diff --git a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java index e44e7631c5d..ac5ba327275 100644 --- a/src/main/java/org/jabref/gui/push/PushToTeXstudio.java +++ b/src/main/java/org/jabref/gui/push/PushToTeXstudio.java @@ -32,7 +32,6 @@ protected String[] getCommandLine(String keyString) { @Override public String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { - // Construct the TeXstudio command return new String[] {commandPath, "--line", Integer.toString(line), fileName.toString()}; } } diff --git a/src/main/java/org/jabref/gui/push/PushToTexShop.java b/src/main/java/org/jabref/gui/push/PushToTexShop.java index 3f38c0deb05..889982ca8ce 100644 --- a/src/main/java/org/jabref/gui/push/PushToTexShop.java +++ b/src/main/java/org/jabref/gui/push/PushToTexShop.java @@ -1,7 +1,6 @@ package org.jabref.gui.push; import java.io.IOException; -import java.nio.file.Path; import java.util.List; import org.jabref.gui.DialogService; @@ -14,7 +13,6 @@ import org.jabref.logic.util.HeadlessExecutorService; import org.jabref.model.database.BibDatabaseContext; import org.jabref.model.entry.BibEntry; -import org.jabref.model.strings.StringUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -88,38 +86,4 @@ protected String[] getCommandLine(String keyString) { return new String[] {}; } } - - @Override - public void jumpToLine(Path fileName, int line, int column) { - commandPath = preferences.getPushToApplicationPreferences().getCommandPaths().get(this.getDisplayName()); - - if (StringUtil.isNullOrEmpty(commandPath)) { - notDefined = true; - return; - } - - String appleScriptCommand = String.format( - "tell application \"TeXShop\"\n" + - " open POSIX file \"%s\"\n" + - " tell front document\n" + - " go to line %s\n" + - " end tell\n" + - "end tell", fileName.toString(), Integer.toString(line)); - - String[] command = {"osascript", "-e", appleScriptCommand}; - - ProcessBuilder processBuilder = new ProcessBuilder(command); - - try { - Process process = processBuilder.start(); - int exitCode = process.waitFor(); - - if (exitCode != 0) { - LOGGER.warn("Failed to execute AppleScript. Exit code: '{}'", exitCode); - } - } catch (IOException | InterruptedException excep) { - LOGGER.warn("Error: Could not call executable '{}'", commandPath, excep); - couldNotCall = true; - } - } } From ac33148d6ebf8067aea08a9d59989667a1cca6aa Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 23 Oct 2024 19:49:44 +0200 Subject: [PATCH 23/30] Fix submodules (and wrong file) --- buildres/abbrv.jabref.org | 2 +- feature-latex-editor#11996 | 0 src/main/resources/csl-locales | 2 +- src/main/resources/csl-styles | 2 +- 4 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 feature-latex-editor#11996 diff --git a/buildres/abbrv.jabref.org b/buildres/abbrv.jabref.org index d87037495de..50edbd56165 160000 --- a/buildres/abbrv.jabref.org +++ b/buildres/abbrv.jabref.org @@ -1 +1 @@ -Subproject commit d87037495de7213b896dbb6a20170387de170709 +Subproject commit 50edbd56165d8efa27be7d06ff1df5d20aa8d2c7 diff --git a/feature-latex-editor#11996 b/feature-latex-editor#11996 deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/src/main/resources/csl-locales b/src/main/resources/csl-locales index 8bc2af16f51..4753e3a9aca 160000 --- a/src/main/resources/csl-locales +++ b/src/main/resources/csl-locales @@ -1 +1 @@ -Subproject commit 8bc2af16f5180a8e4fb591c2be916650f75bb8f6 +Subproject commit 4753e3a9aca4b806ac0e3036ed727d47bf8f678e diff --git a/src/main/resources/csl-styles b/src/main/resources/csl-styles index b413a778b81..5cfc7ae46c1 160000 --- a/src/main/resources/csl-styles +++ b/src/main/resources/csl-styles @@ -1 +1 @@ -Subproject commit b413a778b8170cf5aebbb9aeffec62cfd068e19e +Subproject commit 5cfc7ae46c1d596351d75aaa11ab06e98e0aeeaf From f48766bde390d8001136360201a1da3e09a23d33 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 23 Oct 2024 19:51:02 +0200 Subject: [PATCH 24/30] Fix empty lines --- .../java/org/jabref/gui/entryeditor/LatexCitationsTab.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java index 7dbc5f8f26d..7114b863bba 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTab.java @@ -56,10 +56,11 @@ public LatexCitationsTab(BibDatabaseContext databaseContext, private void setSearchPane() { progressIndicator.setMaxSize(100, 100); + citationsDisplay.basePathProperty().bindBidirectional(viewModel.directoryProperty()); citationsDisplay.setItems(viewModel.getCitationList()); - citationsDisplay.setOnMouseClicked(event -> viewModel.handleMouseClick(event, citationsDisplay)); + RowConstraints mainRow = new RowConstraints(); mainRow.setVgrow(Priority.ALWAYS); From b6bbf06e8c1caf7e8e0f180e50d78a12a4d52f19 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 23 Oct 2024 19:52:09 +0200 Subject: [PATCH 25/30] Default should be TeXstudio --- .../jabref/gui/entryeditor/LatexCitationsTabViewModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java index 43adc3960a9..dd4b46bbec0 100644 --- a/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java +++ b/src/main/java/org/jabref/gui/entryeditor/LatexCitationsTabViewModel.java @@ -23,7 +23,7 @@ import org.jabref.gui.preferences.GuiPreferences; import org.jabref.gui.push.PushToApplication; import org.jabref.gui.push.PushToApplications; -import org.jabref.gui.push.PushToEmacs; +import org.jabref.gui.push.PushToTeXstudio; import org.jabref.gui.texparser.CitationsDisplay; import org.jabref.gui.util.DirectoryDialogConfiguration; import org.jabref.gui.util.UiTaskExecutor; @@ -170,7 +170,7 @@ public void handleMouseClick(MouseEvent event, CitationsDisplay citationsDisplay applicationName, dialogService, preferences) - .orElse(new PushToEmacs(dialogService, preferences)); + .orElse(new PushToTeXstudio(dialogService, preferences)); preferences.getPushToApplicationPreferences().setActiveApplicationName(application.getDisplayName()); application.jumpToLine(selectedItem.path(), selectedItem.line(), selectedItem.colStart()); } From e117247b9e755f55665777e1666a10f7e0a4d0ee Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 23 Oct 2024 19:55:53 +0200 Subject: [PATCH 26/30] Remvoe "Integer.format" (and add test) --- .../org/jabref/gui/push/PushToWinEdt.java | 2 +- .../org/jabref/gui/push/PushToWinEdtTest.java | 30 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 src/test/java/org/jabref/gui/push/PushToWinEdtTest.java diff --git a/src/main/java/org/jabref/gui/push/PushToWinEdt.java b/src/main/java/org/jabref/gui/push/PushToWinEdt.java index aa31377eed0..e1c8269d7b9 100644 --- a/src/main/java/org/jabref/gui/push/PushToWinEdt.java +++ b/src/main/java/org/jabref/gui/push/PushToWinEdt.java @@ -33,6 +33,6 @@ protected String[] getCommandLine(String keyString) { @Override protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { - return new String[] {commandPath, "\"[Open(|%s|);SelLine(%s,%s);]\"".formatted(fileName.toString(), Integer.toString(line), Integer.toString(0))}; + return new String[] {commandPath, "\"[Open(|%s|);SelLine(%s,%s);]\"".formatted(fileName.toString(), line, column)}; } } diff --git a/src/test/java/org/jabref/gui/push/PushToWinEdtTest.java b/src/test/java/org/jabref/gui/push/PushToWinEdtTest.java new file mode 100644 index 00000000000..3ca3ed7cc30 --- /dev/null +++ b/src/test/java/org/jabref/gui/push/PushToWinEdtTest.java @@ -0,0 +1,30 @@ +package org.jabref.gui.push; + +import java.nio.file.Path; + +import org.jabref.gui.DialogService; +import org.jabref.gui.preferences.GuiPreferences; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.Answers; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.mockito.Mockito.mock; + +class PushToWinEdtTest { + + private DialogService dialogService; + private GuiPreferences preferences; + + @BeforeEach + void setup() { + dialogService = mock(DialogService.class, Answers.RETURNS_DEEP_STUBS); + preferences = mock(GuiPreferences.class); + } + + @Test + void jumpToLineCommandlineArguments() { + assertNotNull(new PushToWinEdt(dialogService, preferences).jumpToLineCommandlineArguments(Path.of("test.tex"), 1, 5)); + } +} From 551b074b2a2722fc591eff96fd0b13aa5d34a769 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 23 Oct 2024 19:58:29 +0200 Subject: [PATCH 27/30] Fix PushToVim --- src/main/java/org/jabref/gui/push/PushToVim.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jabref/gui/push/PushToVim.java b/src/main/java/org/jabref/gui/push/PushToVim.java index 6402d8e1617..da306279c01 100644 --- a/src/main/java/org/jabref/gui/push/PushToVim.java +++ b/src/main/java/org/jabref/gui/push/PushToVim.java @@ -150,15 +150,15 @@ public void jumpToLine(Path fileName, int line, int column) { command[2], command[3]); } - Process process = processBuilder.start(); - } catch (IOException excep) { - LOGGER.warn("Problem pushing to Vim.", excep); + processBuilder.start(); + } catch (IOException e) { + LOGGER.warn("Problem pushing to Vim.", e); couldNotCall = true; } } @Override protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { - return new String[] {commandPath, "+%s".formatted(Integer.toString(line)), fileName.toString(), "+\"normal %s|\"".formatted(Integer.toString(column))}; + return new String[] {commandPath, "+%s".formatted(line), fileName.toString(), "+\"normal %s|\"".formatted(column)}; } } From 61395fa063d50b964a228bff63b6625ee2bd1a31 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 23 Oct 2024 19:59:42 +0200 Subject: [PATCH 28/30] Cleanup PushToLyx --- src/main/java/org/jabref/gui/push/PushToLyx.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/main/java/org/jabref/gui/push/PushToLyx.java b/src/main/java/org/jabref/gui/push/PushToLyx.java index ffe1a0c9b0c..0bcb7795fc8 100644 --- a/src/main/java/org/jabref/gui/push/PushToLyx.java +++ b/src/main/java/org/jabref/gui/push/PushToLyx.java @@ -5,7 +5,6 @@ import java.io.FileWriter; import java.io.IOException; import java.nio.charset.StandardCharsets; -import java.nio.file.Path; import java.util.List; import org.jabref.gui.DialogService; @@ -96,10 +95,4 @@ public void pushEntries(BibDatabaseContext database, final List entrie } }); } - - @Override - protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { - LOGGER.warn("not implemented"); - return new String[0]; - } } From aeedbb42b43e37a500e4178550ed09a3058dcbe4 Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 23 Oct 2024 20:01:37 +0200 Subject: [PATCH 29/30] Refactor PushToVim --- .../java/org/jabref/gui/push/PushToVim.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/java/org/jabref/gui/push/PushToVim.java b/src/main/java/org/jabref/gui/push/PushToVim.java index da306279c01..3e2f3d4fb04 100644 --- a/src/main/java/org/jabref/gui/push/PushToVim.java +++ b/src/main/java/org/jabref/gui/push/PushToVim.java @@ -46,14 +46,7 @@ public PushToApplicationSettings getSettings(PushToApplication application, Push @Override public void pushEntries(BibDatabaseContext database, List entries, String keys) { - couldNotPush = false; - couldNotCall = false; - notDefined = false; - - commandPath = preferences.getPushToApplicationPreferences().getCommandPaths().get(this.getDisplayName()); - - if ((commandPath == null) || commandPath.trim().isEmpty()) { - notDefined = true; + if (!determineCommandPath()) { return; } @@ -110,14 +103,7 @@ public void onOperationCompleted() { @Override public void jumpToLine(Path fileName, int line, int column) { - couldNotPush = false; - couldNotCall = false; - notDefined = false; - - commandPath = preferences.getPushToApplicationPreferences().getCommandPaths().get(this.getDisplayName()); - - if ((commandPath == null) || commandPath.trim().isEmpty()) { - notDefined = true; + if (!determineCommandPath()) { return; } @@ -157,6 +143,20 @@ public void jumpToLine(Path fileName, int line, int column) { } } + private boolean determineCommandPath() { + couldNotPush = false; + couldNotCall = false; + notDefined = false; + + commandPath = preferences.getPushToApplicationPreferences().getCommandPaths().get(this.getDisplayName()); + + if ((commandPath == null) || commandPath.trim().isEmpty()) { + notDefined = true; + return false; + } + return true; + } + @Override protected String[] jumpToLineCommandlineArguments(Path fileName, int line, int column) { return new String[] {commandPath, "+%s".formatted(line), fileName.toString(), "+\"normal %s|\"".formatted(column)}; From 3b9fbac0f160160eb675d24fd9dd86a246564a9e Mon Sep 17 00:00:00 2001 From: Oliver Kopp Date: Wed, 23 Oct 2024 20:06:07 +0200 Subject: [PATCH 30/30] Add CHANGELOG.md entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fdab50d663..aa016a8aa28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv - We added a switch not to store the linked file URL, because it caused troubles at other apps. [#11735](https://github.com/JabRef/jabref/pull/11735) - When starting a new SLR, the selected catalogs now persist within and across JabRef sessions. [koppor#614](https://github.com/koppor/jabref/issues/614) - We added support for drag'n'drop on an entry in the maintable to an external application to get the entry preview dropped. [#11846](https://github.com/JabRef/jabref/pull/11846) +- We added the functionality to double click on a [LaTeX citation](https://docs.jabref.org/advanced/entryeditor/latex-citations) to jump to the respective line in the LaTeX editor. [#11996](https://github.com/JabRef/jabref/issues/11996) - We added a different background color to the search bar to indicate when the search syntax is wrong. [#11658](https://github.com/JabRef/jabref/pull/11658) - We added a setting which always adds the literal "Cited on pages" text before each JStyle citation. [#11691](https://github.com/JabRef/jabref/pull/11732) - We added a new plain citation parser that uses LLMs. [#11825](https://github.com/JabRef/jabref/issues/11825)