Skip to content

Commit ac64607

Browse files
authored
Merge branch 'main' into fix/online-tab
2 parents ec28110 + 72399dc commit ac64607

File tree

76 files changed

+833
-636
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+833
-636
lines changed

.github/workflows/tests-code.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,8 @@ jobs:
483483
with:
484484
files: |
485485
jablib/src/main/java/**/*.java
486+
files_ignore: |
487+
jablib/src/main/java/**/*-*.java
486488
487489
- name: Build ${{ matrix.launcher }} launcher including changed classes
488490
shell: bash

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
2828
- We added a new ID based fetcher for [EuropePMC](https://europepmc.org/). [#13389](https://github.com/JabRef/jabref/pull/13389)
2929
- We added quick settings for welcome tab. [#12664](https://github.com/JabRef/jabref/issues/12664)
3030
- We added an initial [cite as you write](https://retorque.re/zotero-better-bibtex/citing/cayw/) endpoint. [#13187](https://github.com/JabRef/jabref/issues/13187)
31+
- We added pagination support for the web search entries dialog, improving navigation for large search results. [#5507](https://github.com/JabRef/jabref/issues/5507)
3132
- We added "copy preview as markdown" feature. [#12552](https://github.com/JabRef/jabref/issues/12552)
3233
- In case no citation relation information can be fetched, we show the data providers reason. [#13549](https://github.com/JabRef/jabref/pull/13549)
3334
- When relativizing file names, symlinks are now taken into account. [#12995](https://github.com/JabRef/jabref/issues/12995)
@@ -120,6 +121,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
120121
- We fixed an issue where the groups were still displayed after closing all libraries. [#13382](https://github.com/JabRef/jabref/issues/13382)
121122
- Enhanced field selection logic in the Merge Entries dialog when fetching from DOI to prefer valid years and entry types. [#12549](https://github.com/JabRef/jabref/issues/12549)
122123
- We fixed an issue where theme or font size are not respected for all dialogs [#13558](https://github.com/JabRef/jabref/issues/13558)
124+
- We removed unnecessary spacing and margin in the AutomaticFieldEditor. [#13792](https://github.com/JabRef/jabref/pull/13792)
123125

124126
### Removed
125127

docs/code-howtos/fetchers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Fetchers are the implementation of the [search using online services](https://do
1212
| [SAO/NASA Astrophysics Data System](https://docs.jabref.org/collect/import-using-online-bibliographic-database#sao-nasa-astrophysics-data-system) | [ADS UI](https://ui.adsabs.harvard.edu/user/settings/token) | `AstrophysicsDataSystemAPIKey` | 5000 calls/day |
1313
| [ScienceDirect](https://www.sciencedirect.com) | | `ScienceDirectApiKey` | |
1414
| [SemanticScholar](https://www.semanticscholar.org/) | <https://www.semanticscholar.org/product/api#api-key-form> | `SemanticScholarApiKey` | |
15-
| [Springer Nature](https://docs.jabref.org/collect/import-using-online-bibliographic-database#springer) | [Springer Nature API Portal](https://dev.springernature.com) | `SpringerNatureAPIKey` | 5000 calls/day |
15+
| [Springer Nature](https://docs.jabref.org/collect/import-using-online-bibliographic-database#springer) | [Springer Nature API Portal](https://dev.springernature.com). Use the "Meta API" API key. | `SpringerNatureAPIKey` | 5000 calls/day |
1616
| [Zentralblatt Math](https://www.zbmath.org) | (none) | (none) | Depending on the current network |
1717
| [Biodiversity Heritage Library](https://www.biodiversitylibrary.org/) | [Biodiversitylibrary](https://about.biodiversitylibrary.org/tools-and-services/developer-and-data-tools/#APIs) | `BiodiversityHeritageApiKey` | - |
1818

jabgui/src/main/java/org/jabref/gui/JabRefDialogService.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,11 +526,11 @@ public Optional<Path> showFileOpenFromArchiveDialog(Path archivePath) throws IOE
526526
}
527527

528528
@Override
529-
public void showCustomDialog(BaseDialog<?> aboutDialogView) {
530-
if (aboutDialogView.getOwner() == null) {
531-
aboutDialogView.initOwner(mainWindow);
529+
public void showCustomDialog(BaseDialog<?> dialogView) {
530+
if (dialogView.getOwner() == null) {
531+
dialogView.initOwner(mainWindow);
532532
}
533-
aboutDialogView.show();
533+
dialogView.show();
534534
}
535535

536536
@Override

jabgui/src/main/java/org/jabref/gui/JabRefGUI.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,8 +181,8 @@ public void initialize() {
181181

182182
JabRefGUI.themeManager = new ThemeManager(
183183
preferences.getWorkspacePreferences(),
184-
fileUpdateMonitor,
185-
Runnable::run);
184+
fileUpdateMonitor
185+
);
186186
Injector.setModelOrService(ThemeManager.class, themeManager);
187187

188188
JabRefGUI.countingUndoManager = new CountingUndoManager();

jabgui/src/main/java/org/jabref/gui/auximport/FromAuxDialog.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.jabref.gui.DialogService;
1212
import org.jabref.gui.LibraryTabContainer;
1313
import org.jabref.gui.StateManager;
14-
import org.jabref.gui.theme.ThemeManager;
1514
import org.jabref.gui.util.BaseDialog;
1615
import org.jabref.gui.util.ViewModelListCellFactory;
1716
import org.jabref.logic.l10n.Localization;
@@ -34,7 +33,6 @@ public class FromAuxDialog extends BaseDialog<Void> {
3433

3534
@Inject private CliPreferences preferences;
3635
@Inject private DialogService dialogService;
37-
@Inject private ThemeManager themeManager;
3836
@Inject private StateManager stateManager;
3937

4038
private final LibraryTabContainer tabContainer;
@@ -57,8 +55,6 @@ public FromAuxDialog(LibraryTabContainer tabContainer) {
5755
}
5856
return null;
5957
});
60-
61-
themeManager.updateFontStyle(getDialogPane().getScene());
6258
}
6359

6460
@FXML
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package org.jabref.gui.edit.automaticfiededitor;
22

3-
import javafx.scene.layout.AnchorPane;
3+
import javafx.scene.layout.VBox;
44

5-
public abstract class AbstractAutomaticFieldEditorTabView extends AnchorPane implements AutomaticFieldEditorTab {
5+
public abstract class AbstractAutomaticFieldEditorTabView extends VBox implements AutomaticFieldEditorTab {
66

77
@Override
8-
public AnchorPane getContent() {
8+
public VBox getContent() {
99
return this;
1010
}
1111
}

jabgui/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorDialog.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,17 +60,11 @@ public AutomaticFieldEditorDialog(StateManager stateManager, UndoManager undoMan
6060
}
6161
return "";
6262
});
63-
64-
// This will prevent all dialog buttons from having the same size
65-
// Read more: https://stackoverflow.com/questions/45866249/javafx-8-alert-different-button-sizes
66-
getDialogPane().getButtonTypes().stream()
67-
.map(getDialogPane()::lookupButton)
68-
.forEach(btn -> ButtonBar.setButtonUniformSize(btn, false));
6963
}
7064

7165
@FXML
7266
public void initialize() {
73-
viewModel = new AutomaticFieldEditorViewModel(selectedEntries, database, undoManager, stateManager);
67+
viewModel = new AutomaticFieldEditorViewModel(database, undoManager, stateManager);
7468

7569
for (AutomaticFieldEditorTab tabModel : viewModel.getFieldEditorTabs()) {
7670
NotificationPaneAdapter notificationPane = new NotificationPaneAdapter(tabModel.getContent());

jabgui/src/main/java/org/jabref/gui/edit/automaticfiededitor/AutomaticFieldEditorViewModel.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package org.jabref.gui.edit.automaticfiededitor;
22

3-
import java.util.List;
4-
53
import javax.swing.undo.UndoManager;
64

75
import javafx.collections.FXCollections;
@@ -14,7 +12,6 @@
1412
import org.jabref.gui.edit.automaticfiededitor.renamefield.RenameFieldTabView;
1513
import org.jabref.gui.undo.NamedCompound;
1614
import org.jabref.model.database.BibDatabase;
17-
import org.jabref.model.entry.BibEntry;
1815

1916
public class AutomaticFieldEditorViewModel extends AbstractViewModel {
2017
public static final String NAMED_COMPOUND_EDITS = "EDIT_FIELDS";
@@ -23,7 +20,7 @@ public class AutomaticFieldEditorViewModel extends AbstractViewModel {
2320

2421
private final UndoManager undoManager;
2522

26-
public AutomaticFieldEditorViewModel(List<BibEntry> selectedEntries, BibDatabase database, UndoManager undoManager, StateManager stateManager) {
23+
public AutomaticFieldEditorViewModel(BibDatabase database, UndoManager undoManager, StateManager stateManager) {
2724
this.undoManager = undoManager;
2825
fieldEditorTabs.addAll(
2926
new EditFieldContentTabView(database, stateManager),

jabgui/src/main/java/org/jabref/gui/errorconsole/ErrorConsoleView.java

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import javafx.collections.ListChangeListener;
44
import javafx.collections.ObservableList;
55
import javafx.fxml.FXML;
6+
import javafx.geometry.Pos;
67
import javafx.scene.Node;
78
import javafx.scene.control.ButtonType;
89
import javafx.scene.control.ContentDisplay;
@@ -24,7 +25,6 @@
2425
import org.jabref.gui.keyboard.KeyBinding;
2526
import org.jabref.gui.keyboard.KeyBindingRepository;
2627
import org.jabref.gui.preferences.GuiPreferences;
27-
import org.jabref.gui.theme.ThemeManager;
2828
import org.jabref.gui.util.BaseDialog;
2929
import org.jabref.gui.util.ControlHelper;
3030
import org.jabref.logic.l10n.Localization;
@@ -48,7 +48,6 @@ public class ErrorConsoleView extends BaseDialog<Void> {
4848
@Inject private ClipBoardManager clipBoardManager;
4949
@Inject private BuildInfo buildInfo;
5050
@Inject private KeyBindingRepository keyBindingRepository;
51-
@Inject private ThemeManager themeManager;
5251

5352
public ErrorConsoleView() {
5453
this.setTitle(Localization.lang("Event log"));
@@ -61,8 +60,6 @@ public ErrorConsoleView() {
6160
ControlHelper.setAction(copyLogButton, getDialogPane(), event -> copyLog());
6261
ControlHelper.setAction(clearLogButton, getDialogPane(), event -> clearLog());
6362
ControlHelper.setAction(createIssueButton, getDialogPane(), event -> createIssue());
64-
65-
themeManager.updateFontStyle(getDialogPane().getScene());
6663
}
6764

6865
@FXML
@@ -83,19 +80,21 @@ private void initialize() {
8380

8481
private Callback<ListView<LogEventViewModel>, ListCell<LogEventViewModel>> createCellFactory() {
8582
return cell -> new ListCell<>() {
86-
private HBox graphic;
87-
private Node icon;
88-
private VBox message;
89-
private Label heading;
90-
private Label stacktrace;
83+
private final HBox graphic;
84+
private final VBox message;
85+
private final Label heading;
86+
private final Label stacktrace;
9187

9288
{
93-
graphic = new HBox(10);
89+
graphic = new HBox();
9490
heading = new Label();
9591
stacktrace = new Label();
9692
message = new VBox();
93+
message.setAlignment(Pos.CENTER_LEFT);
9794
message.getChildren().setAll(heading, stacktrace);
95+
message.getStyleClass().add("message-box");
9896
setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
97+
getStyleClass().add("error-console-cell");
9998
}
10099

101100
@Override
@@ -105,10 +104,17 @@ public void updateItem(LogEventViewModel event, boolean empty) {
105104
if ((event == null) || empty) {
106105
setGraphic(null);
107106
} else {
108-
icon = event.getIcon().getGraphicNode();
107+
Node icon = event.getIcon().getGraphicNode();
109108
heading.setText(event.getDisplayText());
110109
heading.getStyleClass().setAll(event.getStyleClass());
111-
stacktrace.setText(event.getStackTrace().orElse(""));
110+
event.getStackTrace().ifPresentOrElse(text -> {
111+
stacktrace.setText(text);
112+
stacktrace.setVisible(true);
113+
stacktrace.setManaged(true);
114+
}, () -> {
115+
stacktrace.setVisible(false);
116+
stacktrace.setManaged(false);
117+
});
112118
graphic.getStyleClass().setAll(event.getStyleClass());
113119
graphic.getChildren().setAll(icon, message);
114120
setGraphic(graphic);

0 commit comments

Comments
 (0)