Skip to content

Commit

Permalink
Follow up fix for copy paste
Browse files Browse the repository at this point in the history
Fixes #6293
Also enable paste menu/action for empty libraries with no entries yet
  • Loading branch information
Siedlerchr committed Aug 31, 2020
1 parent dfefd4d commit 93da5af
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/main/java/org/jabref/gui/edit/EditAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.jabref.gui.actions.ActionHelper;
import org.jabref.gui.actions.SimpleCommand;
import org.jabref.gui.actions.StandardActions;
import org.jabref.gui.maintable.MainTable;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand All @@ -29,7 +28,11 @@ public EditAction(StandardActions action, JabRefFrame frame, StateManager stateM
this.frame = frame;
this.stateManager = stateManager;

this.executable.bind(ActionHelper.needsEntriesSelected(stateManager));
if (action == StandardActions.PASTE) {
this.executable.bind(ActionHelper.needsDatabase(stateManager));
} else {
this.executable.bind(ActionHelper.needsEntriesSelected(stateManager));
}
}

@Override
Expand Down Expand Up @@ -62,9 +65,9 @@ public void execute() {
throw new IllegalStateException("Only cut/copy/paste supported in TextInputControl but got " + action);
}

} else if (focusOwner instanceof MainTable) {
} else {

LOGGER.debug("EditAction - MainTable: {}", frame.getCurrentBasePanel().getTabTitle());
LOGGER.debug("EditAction - Else: {}", frame.getCurrentBasePanel().getTabTitle());
// Not sure what is selected -> copy/paste/cut selected entries

// ToDo: Should be handled by BibDatabaseContext instead of BasePanel
Expand Down

0 comments on commit 93da5af

Please sign in to comment.