Skip to content

Commit

Permalink
Add 'Open in File Explorer' option to the menu
Browse files Browse the repository at this point in the history
  • Loading branch information
priyanshu16095 committed Jan 22, 2025
1 parent 0ad599f commit 35c555d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/main/java/org/jabref/gui/frame/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ private ContextMenu createTabContextMenuFor(LibraryTab tab) {

contextMenu.getItems().addAll(
factory.createMenuItem(StandardActions.LIBRARY_PROPERTIES, new LibraryPropertiesAction(tab::getBibDatabaseContext, stateManager)),
factory.createMenuItem(StandardActions.OPEN_DATABASE_FOLDER, new OpenDatabaseFolder(tab::getBibDatabaseContext)),
factory.createMenuItem(StandardActions.OPEN_DATABASE_FOLDER, new OpenDatabaseFolder(dialogService, stateManager, preferences, tab::getBibDatabaseContext)),
factory.createMenuItem(StandardActions.OPEN_CONSOLE, new OpenConsoleAction(tab::getBibDatabaseContext, stateManager, preferences, dialogService)),
new SeparatorMenuItem(),
factory.createMenuItem(StandardActions.CLOSE_LIBRARY, new CloseDatabaseAction(this, tab, stateManager)),
Expand Down Expand Up @@ -636,11 +636,17 @@ public void execute() {
}
}

private class OpenDatabaseFolder extends SimpleCommand {
public static class OpenDatabaseFolder extends SimpleCommand {

private final Supplier<BibDatabaseContext> databaseContext;

public OpenDatabaseFolder(Supplier<BibDatabaseContext> databaseContext) {
private final DialogService dialogService;
private final StateManager stateManager;
private final GuiPreferences preferences;

public OpenDatabaseFolder(DialogService dialogService, StateManager stateManager, GuiPreferences preferences, Supplier<BibDatabaseContext> databaseContext) {
this.dialogService = dialogService;
this.stateManager = stateManager;
this.preferences = preferences;
this.databaseContext = databaseContext;
this.executable.bind(needsSavedLocalDatabase(stateManager));
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/frame/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void createMenu() {

new SeparatorMenuItem(),

// factory.createMenuItem(StandardActions.OPEN_DATABASE_FOLDER, new JabRefFrame.OpenDatabaseFolder(tab::getBibDatabaseContext)),
factory.createMenuItem(StandardActions.OPEN_DATABASE_FOLDER, new JabRefFrame.OpenDatabaseFolder(dialogService, stateManager, preferences, () -> stateManager.getActiveDatabase().orElse(null))),
factory.createMenuItem(StandardActions.OPEN_CONSOLE, new OpenConsoleAction(stateManager, preferences, dialogService)),

new SeparatorMenuItem(),
Expand Down

0 comments on commit 35c555d

Please sign in to comment.