diff --git a/CHANGELOG.md b/CHANGELOG.md index aaa8590f40f..22ca95cdefc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv ### Added +- We added the ability to add the current selection to a newly created group. [#11449](https://github.com/JabRef/jabref/issues/11449) - We added support for selecting and using CSL Styles in JabRef's OpenOffice/LibreOffice integration for inserting bibliographic and in-text citations into a document. [#2146](https://github.com/JabRef/jabref/issues/2146), [#8893](https://github.com/JabRef/jabref/issues/8893) - We added Tools > New library based on references in PDF file... to create a new library based on the references section in a PDF file. [#11522](https://github.com/JabRef/jabref/pull/11522) - When converting the references section of a paper (PDF file), more than the last page is treated. [#11522](https://github.com/JabRef/jabref/pull/11522) diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 06bfb4c6c41..6cc0ca5ff3e 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -53,7 +53,7 @@ // endregion provides org.tinylog.writers.Writer - with org.jabref.gui.logging.GuiWriter; + with org.jabref.gui.logging.GuiWriter; // Preferences and XML requires java.prefs; diff --git a/src/main/java/org/jabref/gui/StateManager.java b/src/main/java/org/jabref/gui/StateManager.java index 792a6ba01b3..356132cdef4 100644 --- a/src/main/java/org/jabref/gui/StateManager.java +++ b/src/main/java/org/jabref/gui/StateManager.java @@ -76,7 +76,12 @@ public class StateManager { private final ObservableList searchHistory = FXCollections.observableArrayList(); public StateManager() { - activeGroups.bind(Bindings.valueAt(selectedGroups, activeDatabase.orElseOpt(null).map(BibDatabaseContext::getUid))); + activeGroups.bind(Bindings.valueAt( + selectedGroups, + activeDatabase + .orElseOpt(null) + .map(BibDatabaseContext::getUid)) + .orElse(FXCollections.observableArrayList())); } public ObservableList getVisibleSidePaneComponents() { @@ -162,6 +167,7 @@ public void setActiveDatabase(BibDatabaseContext database) { LOGGER.info("No open database detected"); activeDatabaseProperty().set(Optional.empty()); } else { + selectedGroups.computeIfAbsent(database.getUid(), k -> FXCollections.emptyObservableList()); activeDatabaseProperty().set(Optional.of(database)); } } diff --git a/src/main/java/org/jabref/gui/actions/StandardActions.java b/src/main/java/org/jabref/gui/actions/StandardActions.java index 1ec41a584f8..ad103f052ce 100644 --- a/src/main/java/org/jabref/gui/actions/StandardActions.java +++ b/src/main/java/org/jabref/gui/actions/StandardActions.java @@ -36,6 +36,7 @@ public enum StandardActions implements Action { EXTRACT_FILE_REFERENCES_OFFLINE(Localization.lang("Extract references from file (offline)"), IconTheme.JabRefIcons.FILE_STAR), OPEN_URL(Localization.lang("Open URL or DOI"), IconTheme.JabRefIcons.WWW, KeyBinding.OPEN_URL_OR_DOI), SEARCH_SHORTSCIENCE(Localization.lang("Search ShortScience")), + ADD_SUBGROUP_FROM_SELECTION(Localization.lang("Add subgroup from selection")), MERGE_WITH_FETCHED_ENTRY(Localization.lang("Get bibliographic data from %0", "DOI/ISBN/...")), ATTACH_FILE(Localization.lang("Attach file"), IconTheme.JabRefIcons.ATTACH_FILE), ATTACH_FILE_FROM_URL(Localization.lang("Attach file from URL"), IconTheme.JabRefIcons.DOWNLOAD_FILE), diff --git a/src/main/java/org/jabref/gui/exporter/ExportCommand.java b/src/main/java/org/jabref/gui/exporter/ExportCommand.java index ccf81b353ff..814d639199a 100644 --- a/src/main/java/org/jabref/gui/exporter/ExportCommand.java +++ b/src/main/java/org/jabref/gui/exporter/ExportCommand.java @@ -2,12 +2,12 @@ import java.io.IOException; import java.nio.file.Path; -import java.util.Collections; import java.util.Comparator; import java.util.List; import java.util.function.Supplier; import java.util.stream.Collectors; +import javafx.collections.FXCollections; import javafx.stage.FileChooser; import javafx.util.Duration; @@ -111,7 +111,7 @@ private void export(Path file, FileChooser.ExtensionFilter selectedExtensionFilt // All entries entries = stateManager.getActiveDatabase() .map(BibDatabaseContext::getEntries) - .orElse(Collections.emptyList()); + .orElse(FXCollections.emptyObservableList()); } List fileDirForDatabase = stateManager.getActiveDatabase() diff --git a/src/main/java/org/jabref/gui/groups/GroupDialog.fxml b/src/main/java/org/jabref/gui/groups/GroupDialog.fxml index 02b19876250..57f2770ab67 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialog.fxml +++ b/src/main/java/org/jabref/gui/groups/GroupDialog.fxml @@ -102,6 +102,9 @@ + + +