Skip to content

Commit

Permalink
Fixed disable remove All Entries group
Browse files Browse the repository at this point in the history
  • Loading branch information
calixtus committed Apr 2, 2023
1 parent 36256d1 commit 831ff0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/org/jabref/gui/groups/GroupTreeView.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private void initialize() {
this::updateSelection
));

// We try to to prevent publishing changes in the search field directly to the search task that takes some time
// We try to prevent publishing changes in the search field directly to the search task that takes some time
// for larger group structures.
final Timer searchTask = FxTimer.create(Duration.ofMillis(400), () -> {
LOGGER.debug("Run group search " + searchField.getText());
Expand Down Expand Up @@ -475,7 +475,7 @@ private ContextMenu createContextMenuForGroup(GroupNodeViewModel group) {
ActionFactory factory = new ActionFactory(Globals.getKeyPrefs());

MenuItem removeGroup;
if (viewModel.hasSubgroups(group) && viewModel.canAddGroupsIn(group)) {
if (viewModel.hasSubgroups(group) && viewModel.canAddGroupsIn(group) && !group.isRoot()) {
removeGroup = new Menu(Localization.lang("Remove group"), null,
factory.createMenuItem(StandardActions.GROUP_REMOVE_KEEP_SUBGROUPS,
new GroupTreeView.ContextAction(StandardActions.GROUP_REMOVE_KEEP_SUBGROUPS, group)),
Expand Down Expand Up @@ -568,7 +568,7 @@ public ContextAction(StandardActions command, GroupNodeViewModel group) {
switch (command) {
case GROUP_EDIT ->
viewModel.isEditable(group);
case GROUP_REMOVE ->
case GROUP_REMOVE, GROUP_REMOVE_WITH_SUBGROUPS, GROUP_REMOVE_KEEP_SUBGROUPS ->
viewModel.isEditable(group) && viewModel.canAddGroupsIn(group);
case GROUP_SUBGROUP_ADD ->
viewModel.isEditable(group) && viewModel.canAddGroupsIn(group)
Expand Down

0 comments on commit 831ff0d

Please sign in to comment.