Skip to content
Merged
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We added `--provider=crossref` to `get-cited-works` at `JabKit`. [#14357](https://github.com/JabRef/jabref/pull/14357)
- We added [unpaywall](https://unpaywall.org/) as fulltext fetcher. [#14340](https://github.com/JabRef/jabref/pull/14340)
- We added the possibility to configure the email provided to unpaywall. [#14340](https://github.com/JabRef/jabref/pull/14340)
- We added "Close library" to the File menu. [#14381](https://github.com/JabRef/jabref/issues/14381)
- We added a "Regenerate" button for the AI chat allowing the user to make the language model reformulate its response to the previous prompt. [#12191](https://github.com/JabRef/jabref/issues/12191)
- We added support for transliteration of fields to English and automatic transliteration of generated citation key. [#11377](https://github.com/JabRef/jabref/issues/11377)

Expand Down
67 changes: 35 additions & 32 deletions jabgui/src/main/java/org/jabref/gui/frame/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,13 @@ private void updateEditorPane() {

public void updateHorizontalDividerPosition() {
if (mainStage.isShowing() && !sidePane.getChildren().isEmpty()) {
horizontalSplit.setDividerPositions(preferences.getGuiPreferences().getHorizontalDividerPosition() / horizontalSplit.getWidth());
horizontalSplit.setDividerPositions(preferences.getGuiPreferences()
.getHorizontalDividerPosition() / horizontalSplit.getWidth());
horizontalDividerSubscription = EasyBind.valueAt(horizontalSplit.getDividers(), 0)
.mapObservable(SplitPane.Divider::positionProperty)
.listenToValues((_, newValue) -> preferences.getGuiPreferences().setHorizontalDividerPosition(newValue.doubleValue()));
.listenToValues((_, newValue) ->
preferences.getGuiPreferences()
.setHorizontalDividerPosition(newValue.doubleValue()));
}
}

Expand All @@ -313,7 +316,9 @@ public void updateVerticalDividerPosition() {
verticalSplit.setDividerPositions(preferences.getGuiPreferences().getVerticalDividerPosition());
verticalDividerSubscription = EasyBind.valueAt(verticalSplit.getDividers(), 0)
.mapObservable(SplitPane.Divider::positionProperty)
.listenToValues((_, newValue) -> preferences.getGuiPreferences().setVerticalDividerPosition(newValue.doubleValue()));
.listenToValues((_, newValue) ->
preferences.getGuiPreferences()
.setVerticalDividerPosition(newValue.doubleValue()));
}
}

Expand Down Expand Up @@ -436,7 +441,9 @@ private void initBindings() {
String activeUID = stateManager.getActiveDatabase().get().getUid();
boolean wasClosed = tabbedPane.getTabs().stream()
.filter(tab -> tab instanceof LibraryTab)
.noneMatch(ltab -> ((LibraryTab) ltab).getBibDatabaseContext().getUid().equals(activeUID));
.noneMatch(ltab -> ((LibraryTab) ltab).getBibDatabaseContext()
.getUid()
.equals(activeUID));
if (wasClosed) {
tabbedPane.getSelectionModel().selectNext();
}
Expand All @@ -454,6 +461,7 @@ private void initBindings() {
BindingsHelper.bindBidirectional((ObservableValue<Boolean>) stateManager.getEditorShowing(), panelMode,
mode -> stateManager.getEditorShowing().setValue(mode == PanelMode.MAIN_TABLE_AND_ENTRY_EDITOR),
showing -> panelMode.setValue(showing ? PanelMode.MAIN_TABLE_AND_ENTRY_EDITOR : PanelMode.MAIN_TABLE));

EasyBind.subscribe(panelMode, mode -> {
updateEditorPane();
if (mode == PanelMode.MAIN_TABLE_AND_ENTRY_EDITOR) {
Expand Down Expand Up @@ -545,8 +553,7 @@ public void showWelcomeTab() {
taskExecutor,
fileHistory,
Injector.instantiateModelOrService(BuildInfo.class),
preferences.getWorkspacePreferences()
);
preferences.getWorkspacePreferences());
tabbedPane.getTabs().add(welcomeTab);
tabbedPane.getSelectionModel().select(welcomeTab);
}
Expand Down Expand Up @@ -588,16 +595,21 @@ private ContextMenu createTabContextMenuFor(LibraryTab tab) {
ActionFactory factory = new ActionFactory();

contextMenu.getItems().addAll(
factory.createMenuItem(StandardActions.LIBRARY_PROPERTIES, new LibraryPropertiesAction(tab::getBibDatabaseContext, stateManager)),
factory.createMenuItem(StandardActions.OPEN_DATABASE_FOLDER, new OpenDatabaseFolder(dialogService, stateManager, preferences, tab::getBibDatabaseContext)),
factory.createMenuItem(StandardActions.OPEN_CONSOLE, new OpenConsoleAction(() -> {
LibraryTab currentTab = getCurrentLibraryTab();
return (currentTab == null) ? null : currentTab.getBibDatabaseContext();
}, stateManager, preferences, dialogService)),
factory.createMenuItem(StandardActions.LIBRARY_PROPERTIES,
new LibraryPropertiesAction(tab::getBibDatabaseContext, stateManager)),
factory.createMenuItem(StandardActions.OPEN_DATABASE_FOLDER,
new OpenDatabaseFolder(dialogService, stateManager, preferences, tab::getBibDatabaseContext)),
factory.createMenuItem(StandardActions.OPEN_CONSOLE,
new OpenConsoleAction(() -> {
LibraryTab currentTab = getCurrentLibraryTab();
return (currentTab == null) ? null : currentTab.getBibDatabaseContext();
}, stateManager, preferences, dialogService)),
new SeparatorMenuItem(),
factory.createMenuItem(StandardActions.CLOSE_LIBRARY, new CloseDatabaseAction(this, tab, stateManager)),
factory.createMenuItem(StandardActions.CLOSE_OTHER_LIBRARIES, new CloseOthersDatabaseAction(tab)),
factory.createMenuItem(StandardActions.CLOSE_ALL_LIBRARIES, new CloseAllDatabaseAction()));
factory.createMenuItem(StandardActions.CLOSE_LIBRARY,
new CloseDatabaseAction(this, tab, stateManager)),
factory.createMenuItem(StandardActions.CLOSE_OTHER_LIBRARIES,
new CloseOthersDatabaseAction(tab))
);

return contextMenu;
}
Expand Down Expand Up @@ -741,7 +753,7 @@ public void execute() {
}
}

private class CloseOthersDatabaseAction extends SimpleCommand {
protected class CloseOthersDatabaseAction extends SimpleCommand {

private final LibraryTab libraryTab;

Expand All @@ -753,22 +765,13 @@ public CloseOthersDatabaseAction(LibraryTab libraryTab) {
@Override
public void execute() {
LibraryTab toKeepLibraryTab = Optional.of(libraryTab).get();
for (Tab tab : tabbedPane.getTabs()) {
LibraryTab libraryTab = (LibraryTab) tab;
if (libraryTab != toKeepLibraryTab) {
Platform.runLater(() -> closeTab(libraryTab));
}
}
}
}

private class CloseAllDatabaseAction extends SimpleCommand {

@Override
public void execute() {
tabbedPane.getTabs().removeIf(t -> t instanceof WelcomeTab);
for (Tab tab : tabbedPane.getTabs()) {
Platform.runLater(() -> closeTab((LibraryTab) tab));
List<LibraryTab> libraryTabs = tabbedPane.getTabs().stream()
.filter(LibraryTab.class::isInstance)
.map(LibraryTab.class::cast)
.filter(tab -> tab != toKeepLibraryTab)
.toList();
for (LibraryTab tab : libraryTabs) {
Platform.runLater(() -> closeTab(tab));
}
}
}
Expand Down
1 change: 1 addition & 0 deletions jabgui/src/main/java/org/jabref/gui/frame/MainMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ private void createMenu() {
factory.createMenuItem(StandardActions.SAVE_LIBRARY, new SaveAction(SaveAction.SaveMethod.SAVE, frame::getCurrentLibraryTab, dialogService, preferences, stateManager)),
factory.createMenuItem(StandardActions.SAVE_LIBRARY_AS, new SaveAction(SaveAction.SaveMethod.SAVE_AS, frame::getCurrentLibraryTab, dialogService, preferences, stateManager)),
factory.createMenuItem(StandardActions.SAVE_ALL, new SaveAllAction(frame::getLibraryTabs, preferences, dialogService, stateManager)),
factory.createMenuItem(StandardActions.CLOSE_LIBRARY, new JabRefFrame.CloseDatabaseAction(frame, stateManager)),

new SeparatorMenuItem(),

Expand Down
Loading