From 4ffcffb1463df6e0c298ab2c3f47c7b92a1372a2 Mon Sep 17 00:00:00 2001 From: John Josipovic Date: Thu, 15 Apr 2021 15:15:41 +0930 Subject: [PATCH 01/22] removed three menu titles: Remove subgroups, Remove group and subgroups and Remove group, keep subgroup --- .../org/jabref/gui/groups/GroupTreeView.java | 16 +-- .../jabref/gui/groups/GroupTreeViewModel.java | 103 +++++++++--------- 2 files changed, 62 insertions(+), 57 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index c44087f1423..9c50c6d5c2f 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -336,12 +336,12 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { menu.hide(); viewModel.addNewSubgroup(group); }); - MenuItem removeGroupAndSubgroups = new MenuItem(Localization.lang("Remove group and subgroups")); - removeGroupAndSubgroups.setOnAction(event -> viewModel.removeGroupAndSubgroups(group)); - MenuItem removeGroupKeepSubgroups = new MenuItem(Localization.lang("Remove group, keep subgroups")); - removeGroupKeepSubgroups.setOnAction(event -> viewModel.removeGroupKeepSubgroups(group)); - MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups")); - removeSubgroups.setOnAction(event -> viewModel.removeSubgroups(group)); +// MenuItem removeGroupAndSubgroups = new MenuItem(Localization.lang("Remove group and subgroups")); +// removeGroupAndSubgroups.setOnAction(event -> viewModel.removeGroupAndSubgroups(group)); +// MenuItem removeGroupKeepSubgroups = new MenuItem(Localization.lang("Remove group, keep subgroups")); +// removeGroupKeepSubgroups.setOnAction(event -> viewModel.removeGroupKeepSubgroups(group)); +// MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups")); +// removeSubgroups.setOnAction(event -> viewModel.removeSubgroups(group)); MenuItem addEntries = new MenuItem(Localization.lang("Add selected entries to this group")); addEntries.setOnAction(event -> viewModel.addSelectedEntries(group)); @@ -353,7 +353,9 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { menu.getItems().add(editGroup); menu.getItems().add(new SeparatorMenuItem()); - menu.getItems().addAll(addSubgroup, removeSubgroups, removeGroupAndSubgroups, removeGroupKeepSubgroups); +// menu.getItems().addAll(addSubgroup, removeSubgroups, removeGroupAndSubgroups, removeGroupKeepSubgroups); +// Line above replaced with: + menu.getItems().addAll(addSubgroup); menu.getItems().add(new SeparatorMenuItem()); menu.getItems().addAll(addEntries, removeEntries); menu.getItems().add(new SeparatorMenuItem()); diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java index 23a9619f968..3b58bb6c932 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java @@ -228,60 +228,63 @@ public void editGroup(GroupNodeViewModel oldGroup) { }); } - public void removeSubgroups(GroupNodeViewModel group) { - boolean confirmation = dialogService.showConfirmationDialogAndWait( - Localization.lang("Remove subgroups"), - Localization.lang("Remove all subgroups of \"%0\"?", group.getDisplayName())); - if (confirmation) { - /// TODO: Add undo - // final UndoableModifySubtree undo = new UndoableModifySubtree(getGroupTreeRoot(), node, "Remove subgroups"); - // panel.getUndoManager().addEdit(undo); - group.getGroupNode().removeAllChildren(); - dialogService.notify(Localization.lang("Removed all subgroups of group \"%0\".", group.getDisplayName())); - writeGroupChangesToMetaData(); - } - } - - public void removeGroupKeepSubgroups(GroupNodeViewModel group) { - boolean confirmation = dialogService.showConfirmationDialogAndWait( - Localization.lang("Remove group"), - Localization.lang("Remove group \"%0\"?", group.getDisplayName())); - - if (confirmation) { - // TODO: Add undo - // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_KEEP_CHILDREN); - // panel.getUndoManager().addEdit(undo); - GroupTreeNode groupNode = group.getGroupNode(); - groupNode.getParent() - .ifPresent(parent -> groupNode.moveAllChildrenTo(parent, parent.getIndexOfChild(groupNode).get())); - groupNode.removeFromParent(); - - dialogService.notify(Localization.lang("Removed group \"%0\".", group.getDisplayName())); - writeGroupChangesToMetaData(); - } - } +// Comment out following: +// public void removeSubgroups(GroupNodeViewModel group) { +// boolean confirmation = dialogService.showConfirmationDialogAndWait( +// Localization.lang("Remove subgroups"), +// Localization.lang("Remove all subgroups of \"%0\"?", group.getDisplayName())); +// if (confirmation) { +// /// TODO: Add undo +// // final UndoableModifySubtree undo = new UndoableModifySubtree(getGroupTreeRoot(), node, "Remove subgroups"); +// // panel.getUndoManager().addEdit(undo); +// group.getGroupNode().removeAllChildren(); +// dialogService.notify(Localization.lang("Removed all subgroups of group \"%0\".", group.getDisplayName())); +// writeGroupChangesToMetaData(); +// } +// } + +// Comment out following: +// public void removeGroupKeepSubgroups(GroupNodeViewModel group) { +// boolean confirmation = dialogService.showConfirmationDialogAndWait( +// Localization.lang("Remove group"), +// Localization.lang("Remove group \"%0\"?", group.getDisplayName())); +// +// if (confirmation) { +// // TODO: Add undo +// // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_KEEP_CHILDREN); +// // panel.getUndoManager().addEdit(undo); +// GroupTreeNode groupNode = group.getGroupNode(); +// groupNode.getParent() +// .ifPresent(parent -> groupNode.moveAllChildrenTo(parent, parent.getIndexOfChild(groupNode).get())); +// groupNode.removeFromParent(); +// +// dialogService.notify(Localization.lang("Removed group \"%0\".", group.getDisplayName())); +// writeGroupChangesToMetaData(); +// } +// } /** * Removes the specified group and its subgroups (after asking for confirmation). */ - public void removeGroupAndSubgroups(GroupNodeViewModel group) { - boolean confirmed = dialogService.showConfirmationDialogAndWait( - Localization.lang("Remove group and subgroups"), - Localization.lang("Remove group \"%0\" and its subgroups?", group.getDisplayName()), - Localization.lang("Remove")); - if (confirmed) { - // TODO: Add undo - // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_AND_CHILDREN); - // panel.getUndoManager().addEdit(undo); - - removeGroupsAndSubGroupsFromEntries(group); - - group.getGroupNode().removeFromParent(); - - dialogService.notify(Localization.lang("Removed group \"%0\" and its subgroups.", group.getDisplayName())); - writeGroupChangesToMetaData(); - } - } +// Comment out following: +// public void removeGroupAndSubgroups(GroupNodeViewModel group) { +// boolean confirmed = dialogService.showConfirmationDialogAndWait( +// Localization.lang("Remove group and subgroups"), +// Localization.lang("Remove group \"%0\" and its subgroups?", group.getDisplayName()), +// Localization.lang("Remove")); +// if (confirmed) { +// // TODO: Add undo +// // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_AND_CHILDREN); +// // panel.getUndoManager().addEdit(undo); +// +// removeGroupsAndSubGroupsFromEntries(group); +// +// group.getGroupNode().removeFromParent(); +// +// dialogService.notify(Localization.lang("Removed group \"%0\" and its subgroups.", group.getDisplayName())); +// writeGroupChangesToMetaData(); +// } +// } void removeGroupsAndSubGroupsFromEntries(GroupNodeViewModel group) { for (GroupNodeViewModel child : group.getChildren()) { From 8bd07480e9ed0148cdcfd0c6d609759049382c22 Mon Sep 17 00:00:00 2001 From: Khate Damaso Date: Fri, 30 Apr 2021 14:42:27 +0930 Subject: [PATCH 02/22] Move the add group button to the bottom of the group view pane --- .../java/org/jabref/gui/groups/GroupTree.css | 13 ++++++++++-- .../java/org/jabref/gui/groups/GroupTree.fxml | 21 ++++++++++--------- .../org/jabref/gui/groups/GroupTreeView.java | 20 ++++++++++++++++++ src/main/resources/l10n/JabRef_en.properties | 2 +- 4 files changed, 43 insertions(+), 13 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTree.css b/src/main/java/org/jabref/gui/groups/GroupTree.css index cfd75e2de0a..fb0a4a7a2b7 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTree.css +++ b/src/main/java/org/jabref/gui/groups/GroupTree.css @@ -102,8 +102,8 @@ -fx-translate-x: -0.4em; } -#newGroupButton { - -fx-padding: 0.1em 1.5em 0.1em 1.5em; +#addNewGroup { + /*-fx-padding: 0.1em 1.5em 0.1em 1.5em;*/ } #groupFilterBar { @@ -116,3 +116,12 @@ #groupFilterBar .glyph-icon { -fx-font-size: 2em; } + +#groupBar .glyph-icon { + -fx-font-size: 2em; +} + +.add-group-button:hover { + -fx-background-color: -jr-icon-background-active; + -fx-text-fill: -jr-black; +} diff --git a/src/main/java/org/jabref/gui/groups/GroupTree.fxml b/src/main/java/org/jabref/gui/groups/GroupTree.fxml index 8990ffada01..3f61dfc8c6a 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTree.fxml +++ b/src/main/java/org/jabref/gui/groups/GroupTree.fxml @@ -7,22 +7,12 @@ - -
@@ -39,4 +29,15 @@
+ + + + + +
diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index c44087f1423..5b7e951db51 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -15,6 +15,7 @@ import javafx.beans.property.ObjectProperty; import javafx.css.PseudoClass; import javafx.fxml.FXML; +import javafx.scene.control.Button; import javafx.scene.control.ContextMenu; import javafx.scene.control.Control; import javafx.scene.control.MenuItem; @@ -64,6 +65,7 @@ public class GroupTreeView { @FXML private TreeTableColumn numberColumn; @FXML private TreeTableColumn expansionNodeColumn; @FXML private CustomTextField searchField; + @FXML private Button addNewGroup; @Inject private StateManager stateManager; @Inject private DialogService dialogService; @@ -101,6 +103,8 @@ public void initialize() { }); searchField.textProperty().addListener((observable, oldValue, newValue) -> searchTask.restart()); + setNewGroupButtonStyle(groupTree); + groupTree.rootProperty().bind( EasyBind.map(viewModel.rootGroupProperty(), group -> { @@ -171,6 +175,7 @@ public void initialize() { groupTree.setRowFactory(treeTable -> { TreeTableRow row = new TreeTableRow<>(); row.treeItemProperty().addListener((ov, oldTreeItem, newTreeItem) -> { + setNewGroupButtonStyle(treeTable); boolean isRoot = newTreeItem == treeTable.getRoot(); row.pseudoClassStateChanged(rootPseudoClass, isRoot); @@ -397,6 +402,21 @@ private void setupClearButtonField(CustomTextField customTextField) { } } + private void setNewGroupButtonStyle(TreeTableView groupTree) { + if (groupTree.getRoot() != null) { + if (groupTree.getExpandedItemCount() <= 10) { + addNewGroup.setStyle("-fx-border-width: 0px; -fx-background-color: -jr-theme;" + + " -fx-padding: 0.5em; -fx-text-fill: -jr-white;"); + } else { + addNewGroup.setStyle("-fx-border-width: 0px; -fx-background-color: -jr-icon-background-active;" + + " -fx-padding: 0.5em; -fx-text-fill: -jr-black;"); + } + } else { + addNewGroup.setStyle("-fx-border-width: 0px; -fx-background-color: -jr-theme;" + + " -fx-padding: 0.5em; -fx-text-fill: -jr-white;"); + } + } + private static class DragExpansionHandler { private static final long DRAG_TIME_BEFORE_EXPANDING_MS = 1000; private TreeItem draggedItem; diff --git a/src/main/resources/l10n/JabRef_en.properties b/src/main/resources/l10n/JabRef_en.properties index 6eb511b34cf..96f2da8b4bc 100644 --- a/src/main/resources/l10n/JabRef_en.properties +++ b/src/main/resources/l10n/JabRef_en.properties @@ -1786,7 +1786,7 @@ No\ full\ text\ document\ found\ for\ entry\ %0.=No full text document found for Delete\ Entry=Delete Entry Next\ library=Next library Previous\ library=Previous library -add\ group=add group +add\ group=Add group Entry\ is\ contained\ in\ the\ following\ groups\:=Entry is contained in the following groups\: Delete\ entries=Delete entries Keep\ entries=Keep entries From 53c75c720184336ae37675d0d81e099bba53e91c Mon Sep 17 00:00:00 2001 From: John Josipovic Date: Fri, 30 Apr 2021 15:48:23 +0930 Subject: [PATCH 03/22] created remove group submenu function in group tree view --- .../org/jabref/gui/groups/GroupTreeView.java | 35 +++++++++++++-- .../jabref/gui/groups/GroupTreeViewModel.java | 44 +++++++++---------- 2 files changed, 53 insertions(+), 26 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 9c50c6d5c2f..9e4ce141c55 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -48,6 +48,7 @@ import org.jabref.preferences.PreferencesService; import com.tobiasdiez.easybind.EasyBind; +import de.saxsys.mvvmfx.Context; import org.controlsfx.control.textfield.CustomTextField; import org.controlsfx.control.textfield.TextFields; import org.reactfx.util.FxTimer; @@ -320,10 +321,32 @@ private Optional> getTreeItemByValue(TreeItem { menu.hide(); @@ -331,6 +354,10 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { groupTree.refresh(); }); + // JJ - Remove group - implement submenu + MenuItem removeGroup = new MenuItem(Localization.lang("Remove group")); + // JJ - Set on action + MenuItem addSubgroup = new MenuItem(Localization.lang("Add subgroup")); addSubgroup.setOnAction(event -> { menu.hide(); @@ -345,8 +372,8 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { MenuItem addEntries = new MenuItem(Localization.lang("Add selected entries to this group")); addEntries.setOnAction(event -> viewModel.addSelectedEntries(group)); - MenuItem removeEntries = new MenuItem(Localization.lang("Remove selected entries from this group")); - removeEntries.setOnAction(event -> viewModel.removeSelectedEntries(group)); +// MenuItem removeEntries = new MenuItem(Localization.lang("Remove selected entries from this group")); +// removeEntries.setOnAction(event -> viewModel.removeSelectedEntries(group)); MenuItem sortAlphabetically = new MenuItem(Localization.lang("Sort all subgroups (recursively)")); sortAlphabetically.setOnAction(event -> viewModel.sortAlphabeticallyRecursive(group)); @@ -357,7 +384,7 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { // Line above replaced with: menu.getItems().addAll(addSubgroup); menu.getItems().add(new SeparatorMenuItem()); - menu.getItems().addAll(addEntries, removeEntries); +// menu.getItems().addAll(addEntries, removeEntries); menu.getItems().add(new SeparatorMenuItem()); menu.getItems().add(sortAlphabetically); diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java index 3b58bb6c932..42afcf216be 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java @@ -286,17 +286,17 @@ public void editGroup(GroupNodeViewModel oldGroup) { // } // } - void removeGroupsAndSubGroupsFromEntries(GroupNodeViewModel group) { - for (GroupNodeViewModel child : group.getChildren()) { - removeGroupsAndSubGroupsFromEntries(child); - } - - // only remove explicit groups from the entries, keyword groups should not be deleted - if (group.getGroupNode().getGroup() instanceof ExplicitGroup) { - List entriesInGroup = group.getGroupNode().getEntriesInGroup(this.currentDatabase.get().getEntries()); - group.getGroupNode().removeEntriesFromGroup(entriesInGroup); - } - } +// void removeGroupsAndSubGroupsFromEntries(GroupNodeViewModel group) { +// for (GroupNodeViewModel child : group.getChildren()) { +// removeGroupsAndSubGroupsFromEntries(child); +// } +// +// // only remove explicit groups from the entries, keyword groups should not be deleted +// if (group.getGroupNode().getGroup() instanceof ExplicitGroup) { +// List entriesInGroup = group.getGroupNode().getEntriesInGroup(this.currentDatabase.get().getEntries()); +// group.getGroupNode().removeEntriesFromGroup(entriesInGroup); +// } +// } public void addSelectedEntries(GroupNodeViewModel group) { // TODO: Warn @@ -326,17 +326,17 @@ public void addSelectedEntries(GroupNodeViewModel group) { // } } - public void removeSelectedEntries(GroupNodeViewModel group) { - // TODO: warn if assignment has undesired side effects (modifies a field != keywords) - // if (!WarnAssignmentSideEffects.warnAssignmentSideEffects(mNode.getNode().getGroup(), mPanel.frame())) { - // return; // user aborted operation - - group.getGroupNode().removeEntriesFromGroup(stateManager.getSelectedEntries()); - - // TODO: Add undo - // if (!undo.isEmpty()) { - // mPanel.getUndoManager().addEdit(UndoableChangeEntriesOfGroup.getUndoableEdit(mNode, undo)); - } +// public void removeSelectedEntries(GroupNodeViewModel group) { +// // TODO: warn if assignment has undesired side effects (modifies a field != keywords) +// // if (!WarnAssignmentSideEffects.warnAssignmentSideEffects(mNode.getNode().getGroup(), mPanel.frame())) { +// // return; // user aborted operation +// +// group.getGroupNode().removeEntriesFromGroup(stateManager.getSelectedEntries()); +// +// // TODO: Add undo +// // if (!undo.isEmpty()) { +// // mPanel.getUndoManager().addEdit(UndoableChangeEntriesOfGroup.getUndoableEdit(mNode, undo)); +// } public void sortAlphabeticallyRecursive(GroupNodeViewModel group) { group.getGroupNode().sortChildren(compAlphabetIgnoreCase, true); From 22549b3765c0459d2ccb721d8b81e77ebd42a6c9 Mon Sep 17 00:00:00 2001 From: daolin Date: Fri, 30 Apr 2021 15:50:59 +0930 Subject: [PATCH 04/22] Fix the header tile in the add group/subgroup dialog box --- .../java/org/jabref/gui/groups/GroupDialogView.java | 10 +++++++--- .../org/jabref/gui/groups/GroupDialogViewModel.java | 4 +++- src/main/java/org/jabref/gui/groups/GroupTreeView.java | 2 +- .../java/org/jabref/gui/groups/GroupTreeViewModel.java | 10 ++++++---- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupDialogView.java b/src/main/java/org/jabref/gui/groups/GroupDialogView.java index 92883417a99..aecbfa9c637 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialogView.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialogView.java @@ -67,15 +67,19 @@ public class GroupDialogView extends BaseDialog { private final ControlsFxVisualizer validationVisualizer = new ControlsFxVisualizer(); private final GroupDialogViewModel viewModel; - public GroupDialogView(DialogService dialogService, BibDatabaseContext currentDatabase, PreferencesService preferencesService, AbstractGroup editedGroup) { - viewModel = new GroupDialogViewModel(dialogService, currentDatabase, preferencesService, editedGroup); + public GroupDialogView(DialogService dialogService, BibDatabaseContext currentDatabase, PreferencesService preferencesService, AbstractGroup editedGroup, boolean isGroup) { + viewModel = new GroupDialogViewModel(dialogService, currentDatabase, preferencesService, editedGroup, isGroup); ViewLoader.view(this) .load() .setAsDialogPane(this); if (editedGroup == null) { - this.setTitle(Localization.lang("Add subgroup")); + if (isGroup == true) { + this.setTitle(Localization.lang("Add group")); // header title + } else { + this.setTitle(Localization.lang("Add subgroup")); // header title\ + } } else { this.setTitle(Localization.lang("Edit group") + " " + editedGroup.getName()); } diff --git a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java index 17d0607efce..d7423221041 100644 --- a/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupDialogViewModel.java @@ -107,12 +107,14 @@ public class GroupDialogViewModel { private final PreferencesService preferencesService; private final BibDatabaseContext currentDatabase; private final AbstractGroup editedGroup; + private final boolean isGroup; - public GroupDialogViewModel(DialogService dialogService, BibDatabaseContext currentDatabase, PreferencesService preferencesService, AbstractGroup editedGroup) { + public GroupDialogViewModel(DialogService dialogService, BibDatabaseContext currentDatabase, PreferencesService preferencesService, AbstractGroup editedGroup, boolean isGroup) { this.dialogService = dialogService; this.preferencesService = preferencesService; this.currentDatabase = currentDatabase; this.editedGroup = editedGroup; + this.isGroup = isGroup; setupValidation(); setValues(); diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 5b7e951db51..22dd4823550 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -339,7 +339,7 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { MenuItem addSubgroup = new MenuItem(Localization.lang("Add subgroup")); addSubgroup.setOnAction(event -> { menu.hide(); - viewModel.addNewSubgroup(group); + viewModel.addNewSubgroup(group, false); }); MenuItem removeGroupAndSubgroups = new MenuItem(Localization.lang("Remove group and subgroups")); removeGroupAndSubgroups.setOnAction(event -> viewModel.removeGroupAndSubgroups(group)); diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java index 23a9619f968..eb7afc19ec5 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java @@ -111,7 +111,7 @@ private void onSelectedGroupChanged(ObservableList newValue) */ public void addNewGroupToRoot() { if (currentDatabase.isPresent()) { - addNewSubgroup(rootGroup.get()); + addNewSubgroup(rootGroup.get(), true); } else { dialogService.showWarningDialogAndWait(Localization.lang("Cannot create group"), Localization.lang("Cannot create group. Please create a library first.")); } @@ -147,13 +147,14 @@ private void onActiveDatabaseChanged(Optional newDatabase) { /** * Opens "New Group Dialog" and add the resulting group to the specified group */ - public void addNewSubgroup(GroupNodeViewModel parent) { + public void addNewSubgroup(GroupNodeViewModel parent, boolean isGroup) { currentDatabase.ifPresent(database -> { Optional newGroup = dialogService.showCustomDialogAndWait(new GroupDialogView( dialogService, database, preferences, - null)); + null, + isGroup)); newGroup.ifPresent(group -> { parent.addSubgroup(group); @@ -184,7 +185,8 @@ public void editGroup(GroupNodeViewModel oldGroup) { dialogService, database, preferences, - oldGroup.getGroupNode().getGroup())); + oldGroup.getGroupNode().getGroup(), + false)); newGroup.ifPresent(group -> { // TODO: Keep assignments From f851464e7a3fe96f3861636abf455512f7268de3 Mon Sep 17 00:00:00 2001 From: John Josipovic Date: Fri, 30 Apr 2021 19:09:05 +0930 Subject: [PATCH 05/22] implemented remove group submenu in view only --- .../org/jabref/gui/groups/GroupTreeView.java | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 9e4ce141c55..4d019edf3c3 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -17,6 +17,7 @@ import javafx.fxml.FXML; import javafx.scene.control.ContextMenu; import javafx.scene.control.Control; +import javafx.scene.control.Menu; import javafx.scene.control.MenuItem; import javafx.scene.control.SelectionMode; import javafx.scene.control.SeparatorMenuItem; @@ -322,29 +323,31 @@ private Optional> getTreeItemByValue(TreeItem Date: Fri, 30 Apr 2021 20:39:13 +0930 Subject: [PATCH 06/22] fixed menu titles --- .../org/jabref/gui/groups/GroupTreeView.java | 61 +++++++------------ 1 file changed, 23 insertions(+), 38 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 4d019edf3c3..2f72a5f77c9 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -322,34 +322,12 @@ private Optional> getTreeItemByValue(TreeItem { menu.hide(); @@ -357,16 +335,23 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { groupTree.refresh(); }); - // JJ - Remove group - implement submenu MenuItem keepSubmenu = new MenuItem(Localization.lang("Keep subgroups")); - MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups")); - // JJ - Set on action + // Specify action + MenuItem alsoRemoveSubgroups = new MenuItem(Localization.lang("Also remove subgroups")); + // Specify action MenuItem addSubgroup = new MenuItem(Localization.lang("Add subgroup")); addSubgroup.setOnAction(event -> { menu.hide(); viewModel.addNewSubgroup(group); }); + + MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups")); + // Specify action + + MenuItem sortSubgroups = new MenuItem(Localization.lang("Sort subgroups")); + // Specify action + // MenuItem removeGroupAndSubgroups = new MenuItem(Localization.lang("Remove group and subgroups")); // removeGroupAndSubgroups.setOnAction(event -> viewModel.removeGroupAndSubgroups(group)); // MenuItem removeGroupKeepSubgroups = new MenuItem(Localization.lang("Remove group, keep subgroups")); @@ -374,29 +359,29 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { // MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups")); // removeSubgroups.setOnAction(event -> viewModel.removeSubgroups(group)); - MenuItem addEntries = new MenuItem(Localization.lang("Add selected entries to this group")); - addEntries.setOnAction(event -> viewModel.addSelectedEntries(group)); +// MenuItem addEntries = new MenuItem(Localization.lang("Add selected entries to this group")); +// addEntries.setOnAction(event -> viewModel.addSelectedEntries(group)); // MenuItem removeEntries = new MenuItem(Localization.lang("Remove selected entries from this group")); // removeEntries.setOnAction(event -> viewModel.removeSelectedEntries(group)); - MenuItem sortAlphabetically = new MenuItem(Localization.lang("Sort all subgroups (recursively)")); - sortAlphabetically.setOnAction(event -> viewModel.sortAlphabeticallyRecursive(group)); +// MenuItem sortAlphabetically = new MenuItem(Localization.lang("Sort all subgroups (recursively)")); +// sortAlphabetically.setOnAction(event -> viewModel.sortAlphabeticallyRecursive(group)); menu.getItems().add(editGroup); - menu.getItems().add(new SeparatorMenuItem()); -// menu.getItems().addAll(addSubgroup, removeSubgroups, removeGroupAndSubgroups, removeGroupKeepSubgroups); -// Line above replaced with: removeGroup.getItems().add(keepSubmenu); - removeGroup.getItems().add(new SeparatorMenuItem()); - removeGroup.getItems().add(removeSubgroups); + removeGroup.getItems().add(alsoRemoveSubgroups); menu.getItems().add(removeGroup); - menu.getItems().add(addSubgroup); - menu.getItems().add(new SeparatorMenuItem()); -// menu.getItems().addAll(addEntries, removeEntries); - menu.getItems().add(sortAlphabetically); + + menu.getItems().add(removeSubgroups); + + menu.getItems().add(sortSubgroups); + + + +// menu.getItems().add(sortAlphabetically); // TODO: Disable some actions under certain conditions // if (group.canBeEdited()) { From 96f69d4f37634eae006b11fabb92ee2dc369f427 Mon Sep 17 00:00:00 2001 From: John Josipovic Date: Mon, 3 May 2021 15:47:17 +0930 Subject: [PATCH 07/22] implemented subgroup behaviours in menu --- .../org/jabref/gui/groups/GroupTreeView.java | 19 +-- .../jabref/gui/groups/GroupTreeViewModel.java | 123 +++++++++--------- 2 files changed, 70 insertions(+), 72 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 2f72a5f77c9..9d3ba13151a 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -322,7 +322,7 @@ private Optional> getTreeItemByValue(TreeItem viewModel.removeGroupKeepSubgroups(group)); + + MenuItem removeGroupAndSubgroups = new MenuItem(Localization.lang("Also remove subgroups")); + removeGroupAndSubgroups.setOnAction(event -> viewModel.removeGroupAndSubgroups(group)); MenuItem addSubgroup = new MenuItem(Localization.lang("Add subgroup")); addSubgroup.setOnAction(event -> { @@ -347,10 +348,10 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { }); MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups")); - // Specify action + removeSubgroups.setOnAction(event -> viewModel.removeSubgroups(group)); MenuItem sortSubgroups = new MenuItem(Localization.lang("Sort subgroups")); - // Specify action + sortSubgroups.setOnAction(event -> viewModel.sortAlphabeticallyRecursive(group)); // MenuItem removeGroupAndSubgroups = new MenuItem(Localization.lang("Remove group and subgroups")); // removeGroupAndSubgroups.setOnAction(event -> viewModel.removeGroupAndSubgroups(group)); @@ -369,8 +370,8 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { menu.getItems().add(editGroup); - removeGroup.getItems().add(keepSubmenu); - removeGroup.getItems().add(alsoRemoveSubgroups); + removeGroup.getItems().add(removeGroupKeepSubgroups); + removeGroup.getItems().add(removeGroupAndSubgroups); menu.getItems().add(removeGroup); menu.getItems().add(addSubgroup); diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java index 42afcf216be..139e2c1cb79 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java @@ -228,75 +228,72 @@ public void editGroup(GroupNodeViewModel oldGroup) { }); } -// Comment out following: -// public void removeSubgroups(GroupNodeViewModel group) { -// boolean confirmation = dialogService.showConfirmationDialogAndWait( -// Localization.lang("Remove subgroups"), -// Localization.lang("Remove all subgroups of \"%0\"?", group.getDisplayName())); -// if (confirmation) { -// /// TODO: Add undo -// // final UndoableModifySubtree undo = new UndoableModifySubtree(getGroupTreeRoot(), node, "Remove subgroups"); -// // panel.getUndoManager().addEdit(undo); -// group.getGroupNode().removeAllChildren(); -// dialogService.notify(Localization.lang("Removed all subgroups of group \"%0\".", group.getDisplayName())); -// writeGroupChangesToMetaData(); -// } -// } + public void removeSubgroups(GroupNodeViewModel group) { + boolean confirmation = dialogService.showConfirmationDialogAndWait( + Localization.lang("Remove subgroups"), + Localization.lang("Remove all subgroups of \"%0\"?", group.getDisplayName())); + if (confirmation) { + /// TODO: Add undo + // final UndoableModifySubtree undo = new UndoableModifySubtree(getGroupTreeRoot(), node, "Remove subgroups"); + // panel.getUndoManager().addEdit(undo); + group.getGroupNode().removeAllChildren(); + dialogService.notify(Localization.lang("Removed all subgroups of group \"%0\".", group.getDisplayName())); + writeGroupChangesToMetaData(); + } + } -// Comment out following: -// public void removeGroupKeepSubgroups(GroupNodeViewModel group) { -// boolean confirmation = dialogService.showConfirmationDialogAndWait( -// Localization.lang("Remove group"), -// Localization.lang("Remove group \"%0\"?", group.getDisplayName())); -// -// if (confirmation) { -// // TODO: Add undo -// // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_KEEP_CHILDREN); -// // panel.getUndoManager().addEdit(undo); -// GroupTreeNode groupNode = group.getGroupNode(); -// groupNode.getParent() -// .ifPresent(parent -> groupNode.moveAllChildrenTo(parent, parent.getIndexOfChild(groupNode).get())); -// groupNode.removeFromParent(); -// -// dialogService.notify(Localization.lang("Removed group \"%0\".", group.getDisplayName())); -// writeGroupChangesToMetaData(); -// } -// } + public void removeGroupKeepSubgroups(GroupNodeViewModel group) { + boolean confirmation = dialogService.showConfirmationDialogAndWait( + Localization.lang("Remove group"), + Localization.lang("Remove group \"%0\"?", group.getDisplayName())); + + if (confirmation) { + // TODO: Add undo + // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_KEEP_CHILDREN); + // panel.getUndoManager().addEdit(undo); + GroupTreeNode groupNode = group.getGroupNode(); + groupNode.getParent() + .ifPresent(parent -> groupNode.moveAllChildrenTo(parent, parent.getIndexOfChild(groupNode).get())); + groupNode.removeFromParent(); + + dialogService.notify(Localization.lang("Removed group \"%0\".", group.getDisplayName())); + writeGroupChangesToMetaData(); + } + } /** * Removes the specified group and its subgroups (after asking for confirmation). */ -// Comment out following: -// public void removeGroupAndSubgroups(GroupNodeViewModel group) { -// boolean confirmed = dialogService.showConfirmationDialogAndWait( -// Localization.lang("Remove group and subgroups"), -// Localization.lang("Remove group \"%0\" and its subgroups?", group.getDisplayName()), -// Localization.lang("Remove")); -// if (confirmed) { -// // TODO: Add undo -// // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_AND_CHILDREN); -// // panel.getUndoManager().addEdit(undo); -// -// removeGroupsAndSubGroupsFromEntries(group); -// -// group.getGroupNode().removeFromParent(); -// -// dialogService.notify(Localization.lang("Removed group \"%0\" and its subgroups.", group.getDisplayName())); -// writeGroupChangesToMetaData(); -// } -// } + public void removeGroupAndSubgroups(GroupNodeViewModel group) { + boolean confirmed = dialogService.showConfirmationDialogAndWait( + Localization.lang("Remove group and subgroups"), + Localization.lang("Remove group \"%0\" and its subgroups?", group.getDisplayName()), + Localization.lang("Remove")); + if (confirmed) { + // TODO: Add undo + // final UndoableAddOrRemoveGroup undo = new UndoableAddOrRemoveGroup(groupsRoot, node, UndoableAddOrRemoveGroup.REMOVE_NODE_AND_CHILDREN); + // panel.getUndoManager().addEdit(undo); + + removeGroupsAndSubGroupsFromEntries(group); + + group.getGroupNode().removeFromParent(); + + dialogService.notify(Localization.lang("Removed group \"%0\" and its subgroups.", group.getDisplayName())); + writeGroupChangesToMetaData(); + } + } -// void removeGroupsAndSubGroupsFromEntries(GroupNodeViewModel group) { -// for (GroupNodeViewModel child : group.getChildren()) { -// removeGroupsAndSubGroupsFromEntries(child); -// } -// -// // only remove explicit groups from the entries, keyword groups should not be deleted -// if (group.getGroupNode().getGroup() instanceof ExplicitGroup) { -// List entriesInGroup = group.getGroupNode().getEntriesInGroup(this.currentDatabase.get().getEntries()); -// group.getGroupNode().removeEntriesFromGroup(entriesInGroup); -// } -// } + void removeGroupsAndSubGroupsFromEntries(GroupNodeViewModel group) { + for (GroupNodeViewModel child : group.getChildren()) { + removeGroupsAndSubGroupsFromEntries(child); + } + + // only remove explicit groups from the entries, keyword groups should not be deleted + if (group.getGroupNode().getGroup() instanceof ExplicitGroup) { + List entriesInGroup = group.getGroupNode().getEntriesInGroup(this.currentDatabase.get().getEntries()); + group.getGroupNode().removeEntriesFromGroup(entriesInGroup); + } + } public void addSelectedEntries(GroupNodeViewModel group) { // TODO: Warn From 783198ad3af567cc55221c6f2e14caf0dbf8bc8f Mon Sep 17 00:00:00 2001 From: John Josipovic Date: Mon, 3 May 2021 17:11:28 +0930 Subject: [PATCH 08/22] Ready to test implementation of submenu --- .../org/jabref/gui/groups/GroupTreeView.java | 36 +++++++------------ .../jabref/gui/groups/GroupTreeViewModel.java | 25 ++++++------- 2 files changed, 25 insertions(+), 36 deletions(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index ab954dae1ed..49a7e24d0ba 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -50,7 +50,6 @@ import org.jabref.preferences.PreferencesService; import com.tobiasdiez.easybind.EasyBind; -import de.saxsys.mvvmfx.Context; import org.controlsfx.control.textfield.CustomTextField; import org.controlsfx.control.textfield.TextFields; import org.reactfx.util.FxTimer; @@ -349,45 +348,34 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { MenuItem addSubgroup = new MenuItem(Localization.lang("Add subgroup")); addSubgroup.setOnAction(event -> { menu.hide(); - viewModel.addNewSubgroup(group, false); + viewModel.addNewSubgroup(group, true); }); MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups")); - removeSubgroups.setOnAction(event -> viewModel.removeSubgroups(group)); + removeSubgroups.setOnAction(event -> { + viewModel.removeSubgroups(group); + }); MenuItem sortSubgroups = new MenuItem(Localization.lang("Sort subgroups")); sortSubgroups.setOnAction(event -> viewModel.sortAlphabeticallyRecursive(group)); -// MenuItem removeGroupAndSubgroups = new MenuItem(Localization.lang("Remove group and subgroups")); -// removeGroupAndSubgroups.setOnAction(event -> viewModel.removeGroupAndSubgroups(group)); -// MenuItem removeGroupKeepSubgroups = new MenuItem(Localization.lang("Remove group, keep subgroups")); -// removeGroupKeepSubgroups.setOnAction(event -> viewModel.removeGroupKeepSubgroups(group)); -// MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups")); -// removeSubgroups.setOnAction(event -> viewModel.removeSubgroups(group)); - -// MenuItem addEntries = new MenuItem(Localization.lang("Add selected entries to this group")); -// addEntries.setOnAction(event -> viewModel.addSelectedEntries(group)); -// MenuItem removeEntries = new MenuItem(Localization.lang("Remove selected entries from this group")); -// removeEntries.setOnAction(event -> viewModel.removeSelectedEntries(group)); + MenuItem addEntries = new MenuItem(Localization.lang("Add Selected Entries to this Group")); + addEntries.setOnAction(event -> viewModel.addSelectedEntries(group)); -// MenuItem sortAlphabetically = new MenuItem(Localization.lang("Sort all subgroups (recursively)")); -// sortAlphabetically.setOnAction(event -> viewModel.sortAlphabeticallyRecursive(group)); + MenuItem removeEntries = new MenuItem(Localization.lang("Remove Selected Entries from this Group")); + removeEntries.setOnAction(event -> viewModel.removeSelectedEntries(group)); menu.getItems().add(editGroup); - removeGroup.getItems().add(removeGroupKeepSubgroups); removeGroup.getItems().add(removeGroupAndSubgroups); menu.getItems().add(removeGroup); - + menu.getItems().add(new SeparatorMenuItem()); menu.getItems().add(addSubgroup); - menu.getItems().add(removeSubgroups); - menu.getItems().add(sortSubgroups); - - - -// menu.getItems().add(sortAlphabetically); + menu.getItems().add(new SeparatorMenuItem()); + menu.getItems().add(addEntries); + menu.getItems().add(removeEntries); // TODO: Disable some actions under certain conditions // if (group.canBeEdited()) { diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java index ec1f0acff9f..c11aaf74485 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeViewModel.java @@ -147,7 +147,8 @@ private void onActiveDatabaseChanged(Optional newDatabase) { /** * Opens "New Group Dialog" and add the resulting group to the specified group */ - public void addNewSubgroup(GroupNodeViewModel parent, boolean isGroup) { + + public void addNewSubgroup(GroupNodeViewModel parent, boolean isGroup) { currentDatabase.ifPresent(database -> { Optional newGroup = dialogService.showCustomDialogAndWait(new GroupDialogView( dialogService, @@ -325,17 +326,17 @@ public void addSelectedEntries(GroupNodeViewModel group) { // } } -// public void removeSelectedEntries(GroupNodeViewModel group) { -// // TODO: warn if assignment has undesired side effects (modifies a field != keywords) -// // if (!WarnAssignmentSideEffects.warnAssignmentSideEffects(mNode.getNode().getGroup(), mPanel.frame())) { -// // return; // user aborted operation -// -// group.getGroupNode().removeEntriesFromGroup(stateManager.getSelectedEntries()); -// -// // TODO: Add undo -// // if (!undo.isEmpty()) { -// // mPanel.getUndoManager().addEdit(UndoableChangeEntriesOfGroup.getUndoableEdit(mNode, undo)); -// } + public void removeSelectedEntries(GroupNodeViewModel group) { + // TODO: warn if assignment has undesired side effects (modifies a field != keywords) + // if (!WarnAssignmentSideEffects.warnAssignmentSideEffects(mNode.getNode().getGroup(), mPanel.frame())) { + // return; // user aborted operation + + group.getGroupNode().removeEntriesFromGroup(stateManager.getSelectedEntries()); + + // TODO: Add undo + // if (!undo.isEmpty()) { + // mPanel.getUndoManager().addEdit(UndoableChangeEntriesOfGroup.getUndoableEdit(mNode, undo)); + } public void sortAlphabeticallyRecursive(GroupNodeViewModel group) { group.getGroupNode().sortChildren(compAlphabetIgnoreCase, true); From 35b9a0605400253a240ee7f84bced66b5f13136a Mon Sep 17 00:00:00 2001 From: daolin Date: Tue, 4 May 2021 16:14:35 +0930 Subject: [PATCH 09/22] fixed the header title with the latest code --- src/main/java/org/jabref/gui/groups/GroupTreeView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTreeView.java b/src/main/java/org/jabref/gui/groups/GroupTreeView.java index 49a7e24d0ba..548cf07cce3 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTreeView.java +++ b/src/main/java/org/jabref/gui/groups/GroupTreeView.java @@ -348,7 +348,7 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) { MenuItem addSubgroup = new MenuItem(Localization.lang("Add subgroup")); addSubgroup.setOnAction(event -> { menu.hide(); - viewModel.addNewSubgroup(group, true); + viewModel.addNewSubgroup(group, false); }); MenuItem removeSubgroups = new MenuItem(Localization.lang("Remove subgroups")); From 705f29f6cdd7c6fc2122ea2251bd29aa8668cd14 Mon Sep 17 00:00:00 2001 From: Apurva Churi <42309636+apurvachuri@users.noreply.github.com> Date: Sat, 8 May 2021 16:26:44 +0930 Subject: [PATCH 10/22] Update CHANGELOG.md with fixes for #4682 --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd67967d3c1..b76a05a5739 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We added two new fields to track the creation and most recent modification date and time for each entry. [koppor#130](https://github.com/koppor/jabref/issues/130) - We added a feature that allows the user to copy highlighted text in the preview window. [#6962](https://github.com/JabRef/jabref/issues/6962) - We added a feature that allows you to create new BibEntry via paste arxivId [#2292](https://github.com/JabRef/jabref/issues/2292) +- We added a add group functionality at the bottom of the side pane. [#4682](https://github.com/JabRef/jabref/issues/4682) ### Changed @@ -33,6 +34,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We improved the linking of the `python3` interpreter via the shebang to dynamically use the systems default Python. Related to [JabRef-Browser-Extension #177](https://github.com/JabRef/JabRef-Browser-Extension/issues/177) - Automatically found pdf files now have the linking button to the far left and uses a link icon with a plus instead of a briefcase. The file name also has lowered opacity(70%) until added. [#3607](https://github.com/JabRef/jabref/issues/3607) - We simplified the select entry type form by splitting it into two parts ("Recommended" and "Others") based on internal usage data. [#6730](https://github.com/JabRef/jabref/issues/6730) +- We improved the submenu list by merging the'Remove group' having two options, with or without subgroups. [#4682](https://github.com/JabRef/jabref/issues/4682) ### Fixed @@ -70,8 +72,10 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve - We fixed an issue where Content selector does not seem to work for custom fields. [#6819](https://github.com/JabRef/jabref/issues/6819) - We fixed an issue in which a linked online file consisting of a web page was saved as an invalid pdf file upon being downloaded. The user is now notified when downloading a linked file results in an HTML file. [#7452](https://github.com/JabRef/jabref/issues/7452) - We fixed an issue where opening BibTex file (doubleclick) from Folder with spaces not working. [#6487](https://github.com/JabRef/jabref/issues/6487) +- We fixed the header title in the Add Group/Subgroup Dialog box. [#4682](https://github.com/JabRef/jabref/issues/4682) ### Removed +- We removed add group button beside the filter group tab. [#4682](https://github.com/JabRef/jabref/issues/4682) ## [5.2] – 2020-12-24 From d8ab8bbce2a016525568b83b0f93877331c13428 Mon Sep 17 00:00:00 2001 From: Khate Damaso Date: Tue, 11 May 2021 18:00:48 +0930 Subject: [PATCH 11/22] Change the maxWidth of the `add group` button to infinity --- src/main/java/org/jabref/gui/groups/GroupTree.css | 4 ++++ src/main/java/org/jabref/gui/groups/GroupTree.fxml | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/jabref/gui/groups/GroupTree.css b/src/main/java/org/jabref/gui/groups/GroupTree.css index fb0a4a7a2b7..ad1376c8b16 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTree.css +++ b/src/main/java/org/jabref/gui/groups/GroupTree.css @@ -121,6 +121,10 @@ -fx-font-size: 2em; } +.add-group-button { + -fx-max-width: Infinity; +} + .add-group-button:hover { -fx-background-color: -jr-icon-background-active; -fx-text-fill: -jr-black; diff --git a/src/main/java/org/jabref/gui/groups/GroupTree.fxml b/src/main/java/org/jabref/gui/groups/GroupTree.fxml index 3f61dfc8c6a..163c1fe46ff 100644 --- a/src/main/java/org/jabref/gui/groups/GroupTree.fxml +++ b/src/main/java/org/jabref/gui/groups/GroupTree.fxml @@ -32,7 +32,7 @@