Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
87a8c32
live reloading when switching themes, refs #7335
docrjp Jan 12, 2021
0e3310f
preview fully live reloads now, refs #7335
docrjp Jan 12, 2021
3d442d5
remove restart warnings for theme, rfs #7335
docrjp Jan 12, 2021
be101ba
fix import checkstyle violations
docrjp Jan 12, 2021
6293332
add custom static factory to ThemePreference
docrjp Jan 12, 2021
04a202d
live reload font override preference changes
docrjp Jan 17, 2021
752095a
rename Theme to ThemeManager
docrjp Jan 17, 2021
27445da
rename empty theme to light and remove StyleSheetEmpty
docrjp Jan 17, 2021
ed8feb2
remove redundant restart messages from resource bundle
docrjp Jan 17, 2021
fcff1d5
Merge remote-tracking branch 'upstream/master' into fix-7335
calixtus Feb 26, 2021
4902c79
Moved construction of ThemeManager to Globals and added some small fixes
calixtus Feb 28, 2021
7d6d510
Fixed some tests
calixtus Feb 28, 2021
ac437d5
Merge remote-tracking branch 'upstream/master' into fix-7335
calixtus Mar 5, 2021
13a9f2e
Merge remote-tracking branch 'upstream/master' into fix-7335
calixtus Mar 10, 2021
09cd062
Fixed ThemeTest
calixtus Mar 10, 2021
0593492
Removed Light.css
calixtus Mar 10, 2021
9c1e9d0
Merge remote-tracking branch 'upstream/master' into fix-7335
calixtus Mar 11, 2021
8e8ceb7
Injecting ThemeManager
calixtus Mar 11, 2021
c04ed80
Removed restart message
calixtus Mar 11, 2021
a4c0917
Minor tweaks and checkstyle
calixtus Mar 13, 2021
ebddcaa
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus Apr 26, 2021
557f0de
Changed constant names to more meaningful ones
calixtus Apr 26, 2021
9cdab98
Removed workaround for fixed bug with external jrt stylesheets and re…
calixtus Apr 26, 2021
699aaca
Fixed concurrency issue
calixtus Apr 26, 2021
8a7e119
Fixed ThemeTest
calixtus Apr 27, 2021
f295619
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus May 7, 2021
a89b255
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus May 9, 2021
74b5559
Restored DataUrl
calixtus May 10, 2021
2d2e506
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus Jun 1, 2021
477dbdc
Removed currentAppearancePreferences, refactored ThemeManager and add…
calixtus Jun 2, 2021
c9c9595
Removed setter in PreviewViewer
calixtus Jun 2, 2021
767830e
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus Jun 4, 2021
f7b6e82
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus Aug 18, 2021
471659e
Fixed merge errors
calixtus Aug 18, 2021
9c833f4
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus Sep 2, 2021
c1216eb
Fixed merge errors
calixtus Sep 2, 2021
a4d782a
Fixed merge errors
calixtus Sep 2, 2021
d9ca623
Fixed IndexOutOfBoundsException
calixtus Sep 2, 2021
27352cc
Fixed IndexOutOfBoundsException
calixtus Sep 2, 2021
5d261c1
WIP tests
calixtus Sep 10, 2021
a40d317
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus Sep 10, 2021
35af350
Fixed merge error
calixtus Sep 10, 2021
02cee7c
Checkstyle
calixtus Sep 10, 2021
cdf354a
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus Dec 14, 2021
4f1fa8f
Fixed merge conflicts and annoying race condition
calixtus Dec 14, 2021
1053f9c
Merge remote-tracking branch 'upstream/main' into fix-7335
calixtus Dec 30, 2021
f8ca9dd
Fixed merge errors
calixtus Dec 30, 2021
85787e3
Fixed tests
calixtus Dec 31, 2021
8574d53
Avoided Optional as field, implemented TDiez suggestion
calixtus Dec 31, 2021
ae0e432
Checkstyle and CHANGELOG.md
calixtus Dec 31, 2021
749f023
Fix issue about font sizing, removed restart warnings
calixtus Jan 1, 2022
12c9839
Fixed tests
calixtus Jan 1, 2022
0253a3a
checkstyle
calixtus Jan 1, 2022
ad7a8a8
l10n
calixtus Jan 1, 2022
72775e9
Modified comments
calixtus Jan 3, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve
### Changed

- We integrated the external file types dialog directly inside the preferences. [#8341](https://github.com/JabRef/jabref/pull/8341)
- We enabled switching themes in JabRef without the need to restart JabRef. [#7335](https://github.com/JabRef/jabref/pull/7335)

### Fixed

Expand Down
3 changes: 3 additions & 0 deletions src/main/java/org/jabref/gui/DefaultInjector.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import javax.swing.undo.UndoManager;

import org.jabref.gui.keyboard.KeyBindingRepository;
import org.jabref.gui.theme.ThemeManager;
import org.jabref.gui.util.TaskExecutor;
import org.jabref.logic.journals.JournalAbbreviationRepository;
import org.jabref.logic.protectedterms.ProtectedTermsLoader;
Expand Down Expand Up @@ -39,6 +40,8 @@ private static Object createDependency(Class<?> clazz) {
return Globals.journalAbbreviationRepository;
} else if (clazz == StateManager.class) {
return Globals.stateManager;
} else if (clazz == ThemeManager.class) {
return Globals.getThemeManager();
} else if (clazz == FileUpdateMonitor.class) {
return Globals.getFileUpdateMonitor();
} else if (clazz == ProtectedTermsLoader.class) {
Expand Down
18 changes: 15 additions & 3 deletions src/main/java/org/jabref/gui/Globals.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

import org.jabref.architecture.AllowedToUseAwt;
import org.jabref.gui.keyboard.KeyBindingRepository;
import org.jabref.gui.theme.ThemeManager;
import org.jabref.gui.undo.CountingUndoManager;
import org.jabref.gui.util.DefaultFileUpdateMonitor;
import org.jabref.gui.util.DefaultTaskExecutor;
Expand Down Expand Up @@ -76,9 +77,8 @@ public class Globals {
public static BibEntryTypesManager entryTypesManager = new BibEntryTypesManager();

private static ClipBoardManager clipBoardManager = null;

// Key binding preferences
private static KeyBindingRepository keyBindingRepository;
private static ThemeManager themeManager;

private static DefaultFileUpdateMonitor fileUpdateMonitor;
private static TelemetryClient telemetryClient;
Expand All @@ -101,6 +101,16 @@ public static synchronized ClipBoardManager getClipboardManager() {
return clipBoardManager;
}

public static synchronized ThemeManager getThemeManager() {
if (themeManager == null) {
themeManager = new ThemeManager(
prefs.getAppearancePreferences(),
getFileUpdateMonitor(),
Runnable::run);
}
return themeManager;
}

// Background tasks
public static void startBackgroundTasks() {
Globals.fileUpdateMonitor = new DefaultFileUpdateMonitor();
Expand Down Expand Up @@ -142,7 +152,9 @@ public static FileUpdateMonitor getFileUpdateMonitor() {

public static void shutdownThreadPools() {
TASK_EXECUTOR.shutdown();
fileUpdateMonitor.shutdown();
if (fileUpdateMonitor != null) {
fileUpdateMonitor.shutdown();
}
JabRefExecutorService.INSTANCE.shutdownEverything();
}

Expand Down
28 changes: 14 additions & 14 deletions src/main/java/org/jabref/gui/JabRefDialogService.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@
import javafx.util.Duration;

import org.jabref.gui.icon.IconTheme;
import org.jabref.gui.theme.ThemeManager;
import org.jabref.gui.util.BackgroundTask;
import org.jabref.gui.util.BaseDialog;
import org.jabref.gui.util.DirectoryDialogConfiguration;
import org.jabref.gui.util.FileDialogConfiguration;
import org.jabref.gui.util.ZipFileChooser;
import org.jabref.logic.l10n.Localization;
import org.jabref.preferences.PreferencesService;

import com.jfoenix.controls.JFXSnackbar;
import com.jfoenix.controls.JFXSnackbar.SnackbarEvent;
Expand All @@ -68,20 +68,20 @@ public class JabRefDialogService implements DialogService {

private static final Duration TOAST_MESSAGE_DISPLAY_TIME = Duration.millis(3000);
private static final Logger LOGGER = LoggerFactory.getLogger(JabRefDialogService.class);
private static PreferencesService preferences;

private final Window mainWindow;
private final JFXSnackbar statusLine;
private final ThemeManager themeManager;

public JabRefDialogService(Window mainWindow, Pane mainPane, PreferencesService preferences) {
public JabRefDialogService(Window mainWindow, Pane mainPane, ThemeManager themeManager) {
this.mainWindow = mainWindow;
this.themeManager = themeManager;
this.statusLine = new JFXSnackbar(mainPane);
JabRefDialogService.preferences = preferences;
}

private FXDialog createDialog(AlertType type, String title, String content) {
FXDialog alert = new FXDialog(type, title, true);
preferences.getTheme().installCss(alert.getDialogPane().getScene());
themeManager.installCss(alert.getDialogPane().getScene());
alert.setHeaderText(null);
alert.setContentText(content);
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
Expand Down Expand Up @@ -115,7 +115,7 @@ protected Node createDetailsButton() {

// Reset the dialog graphic using the default style
alert.getDialogPane().setGraphic(graphic);
preferences.getTheme().installCss(alert.getDialogPane().getScene());
themeManager.installCss(alert.getDialogPane().getScene());
alert.setHeaderText(null);
alert.setContentText(content);
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
Expand All @@ -140,7 +140,7 @@ public <T> Optional<T> showChoiceDialogAndWait(String title, String content, Str
choiceDialog.setTitle(title);
choiceDialog.setContentText(content);
choiceDialog.initOwner(mainWindow);
preferences.getTheme().installCss(choiceDialog.getDialogPane().getScene());
themeManager.installCss(choiceDialog.getDialogPane().getScene());
return choiceDialog.showAndWait();
}

Expand All @@ -150,7 +150,7 @@ public Optional<String> showInputDialogAndWait(String title, String content) {
inputDialog.setHeaderText(title);
inputDialog.setContentText(content);
inputDialog.initOwner(mainWindow);
preferences.getTheme().installCss(inputDialog.getDialogPane().getScene());
themeManager.installCss(inputDialog.getDialogPane().getScene());
return inputDialog.showAndWait();
}

Expand All @@ -160,7 +160,7 @@ public Optional<String> showInputDialogWithDefaultAndWait(String title, String c
inputDialog.setHeaderText(title);
inputDialog.setContentText(content);
inputDialog.initOwner(mainWindow);
preferences.getTheme().installCss(inputDialog.getDialogPane().getScene());
themeManager.installCss(inputDialog.getDialogPane().getScene());
return inputDialog.showAndWait();
}

Expand Down Expand Up @@ -188,7 +188,7 @@ public void showErrorDialogAndWait(String message, Throwable exception) {
exceptionDialog.getDialogPane().setMaxWidth(mainWindow.getWidth() / 2);
exceptionDialog.setHeaderText(message);
exceptionDialog.initOwner(mainWindow);
preferences.getTheme().installCss(exceptionDialog.getDialogPane().getScene());
themeManager.installCss(exceptionDialog.getDialogPane().getScene());
exceptionDialog.showAndWait();
}

Expand All @@ -198,7 +198,7 @@ public void showErrorDialogAndWait(String title, String content, Throwable excep
exceptionDialog.setHeaderText(title);
exceptionDialog.setContentText(content);
exceptionDialog.initOwner(mainWindow);
preferences.getTheme().installCss(exceptionDialog.getDialogPane().getScene());
themeManager.installCss(exceptionDialog.getDialogPane().getScene());
exceptionDialog.showAndWait();
}

Expand Down Expand Up @@ -268,7 +268,7 @@ public Optional<ButtonType> showCustomDialogAndWait(String title, DialogPane con
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
alert.setResizable(true);
alert.initOwner(mainWindow);
preferences.getTheme().installCss(alert.getDialogPane().getScene());
themeManager.installCss(alert.getDialogPane().getScene());
return alert.showAndWait();
}

Expand Down Expand Up @@ -296,7 +296,7 @@ public <V> void showProgressDialog(String title, String content, Task<V> task) {
task.cancel();
progressDialog.close();
});
preferences.getTheme().installCss(progressDialog.getDialogPane().getScene());
themeManager.installCss(progressDialog.getDialogPane().getScene());
progressDialog.initOwner(mainWindow);
progressDialog.show();
}
Expand All @@ -321,7 +321,7 @@ public <V> Optional<ButtonType> showBackgroundProgressDialogAndWait(String title
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
alert.setResizable(true);
alert.initOwner(mainWindow);
preferences.getTheme().installCss(alert.getDialogPane().getScene());
themeManager.installCss(alert.getDialogPane().getScene());

stateManager.getAnyTaskRunning().addListener((observable, oldValue, newValue) -> {
if (!newValue) {
Expand Down
15 changes: 9 additions & 6 deletions src/main/java/org/jabref/gui/JabRefFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
import org.jabref.gui.slr.StartNewStudyAction;
import org.jabref.gui.specialfields.SpecialFieldMenuItemFactory;
import org.jabref.gui.texparser.ParseLatexAction;
import org.jabref.gui.theme.ThemeManager;
import org.jabref.gui.undo.CountingUndoManager;
import org.jabref.gui.undo.UndoRedoAction;
import org.jabref.gui.util.BackgroundTask;
Expand Down Expand Up @@ -169,6 +170,7 @@ public class JabRefFrame extends BorderPane {

private final Stage mainStage;
private final StateManager stateManager;
private final ThemeManager themeManager;
private final CountingUndoManager undoManager;
private final PushToApplicationsManager pushToApplicationsManager;
private final DialogService dialogService;
Expand All @@ -183,8 +185,9 @@ public class JabRefFrame extends BorderPane {

public JabRefFrame(Stage mainStage) {
this.mainStage = mainStage;
this.dialogService = new JabRefDialogService(mainStage, this, prefs);
this.stateManager = Globals.stateManager;
this.themeManager = Globals.getThemeManager();
this.dialogService = new JabRefDialogService(mainStage, this, themeManager);
this.pushToApplicationsManager = new PushToApplicationsManager(dialogService, stateManager, prefs);
this.undoManager = Globals.undoManager;
this.globalSearchBar = new GlobalSearchBar(this, stateManager, prefs, undoManager);
Expand Down Expand Up @@ -494,7 +497,7 @@ private Node createToolbar() {

new HBox(
factory.createIconButton(StandardActions.NEW_LIBRARY, new NewDatabaseAction(this, prefs)),
factory.createIconButton(StandardActions.OPEN_LIBRARY, new OpenDatabaseAction(this, prefs, dialogService, stateManager)),
factory.createIconButton(StandardActions.OPEN_LIBRARY, new OpenDatabaseAction(this, prefs, dialogService, stateManager, themeManager)),
factory.createIconButton(StandardActions.SAVE_LIBRARY, new SaveAction(SaveAction.SaveMethod.SAVE, this, prefs, stateManager))),

leftSpacer,
Expand Down Expand Up @@ -841,8 +844,8 @@ private MenuBar createMenu() {
factory.createMenuItem(StandardActions.SEND_AS_EMAIL, new SendAsEMailAction(dialogService, this.prefs, stateManager)),
pushToApplicationMenuItem,
new SeparatorMenuItem(),
factory.createMenuItem(StandardActions.START_NEW_STUDY, new StartNewStudyAction(this, Globals.getFileUpdateMonitor(), Globals.TASK_EXECUTOR, prefs, stateManager)),
factory.createMenuItem(StandardActions.SEARCH_FOR_EXISTING_STUDY, new ExistingStudySearchAction(this, Globals.getFileUpdateMonitor(), Globals.TASK_EXECUTOR, prefs, stateManager)),
factory.createMenuItem(StandardActions.START_NEW_STUDY, new StartNewStudyAction(this, Globals.getFileUpdateMonitor(), Globals.TASK_EXECUTOR, prefs, stateManager, themeManager)),
factory.createMenuItem(StandardActions.SEARCH_FOR_EXISTING_STUDY, new ExistingStudySearchAction(this, Globals.getFileUpdateMonitor(), Globals.TASK_EXECUTOR, prefs, stateManager, themeManager)),

new SeparatorMenuItem(),

Expand Down Expand Up @@ -1104,7 +1107,7 @@ private void trackOpenNewDatabase(LibraryTab libraryTab) {
public LibraryTab addTab(BibDatabaseContext databaseContext, boolean raisePanel) {
Objects.requireNonNull(databaseContext);

LibraryTab libraryTab = new LibraryTab(this, prefs, stateManager, databaseContext, ExternalFileTypes.getInstance());
LibraryTab libraryTab = new LibraryTab(this, prefs, stateManager, themeManager, databaseContext, ExternalFileTypes.getInstance());
addTab(libraryTab, raisePanel);
return libraryTab;
}
Expand Down Expand Up @@ -1260,7 +1263,7 @@ public void closeCurrentTab() {
}

public OpenDatabaseAction getOpenDatabaseAction() {
return new OpenDatabaseAction(this, prefs, dialogService, stateManager);
return new OpenDatabaseAction(this, prefs, dialogService, stateManager, themeManager);
}

public PushToApplicationsManager getPushToApplicationsManager() {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jabref/gui/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private void openWindow(Stage mainStage) {
root.getChildren().add(JabRefGUI.mainFrame);

Scene scene = new Scene(root, 800, 800);
preferencesService.getTheme().installCss(scene);
Globals.getThemeManager().installCss(scene);

// Handle TextEditor key bindings
scene.addEventFilter(KeyEvent.KEY_PRESSED, event -> TextInputKeyBindings.call(scene, event));
Expand Down
16 changes: 13 additions & 3 deletions src/main/java/org/jabref/gui/LibraryTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.jabref.gui.importer.actions.OpenDatabaseAction;
import org.jabref.gui.maintable.MainTable;
import org.jabref.gui.maintable.MainTableDataModel;
import org.jabref.gui.theme.ThemeManager;
import org.jabref.gui.undo.CountingUndoManager;
import org.jabref.gui.undo.NamedCompound;
import org.jabref.gui.undo.UndoableFieldChange;
Expand Down Expand Up @@ -82,6 +83,7 @@ public class LibraryTab extends Tab {
private final DialogService dialogService;
private final PreferencesService preferencesService;
private final StateManager stateManager;
private final ThemeManager themeManager;
private final BooleanProperty changedProperty = new SimpleBooleanProperty(false);
private final BooleanProperty nonUndoableChangeProperty = new SimpleBooleanProperty(false);
private BibDatabaseContext bibDatabaseContext;
Expand Down Expand Up @@ -111,6 +113,7 @@ public class LibraryTab extends Tab {
public LibraryTab(JabRefFrame frame,
PreferencesService preferencesService,
StateManager stateManager,
ThemeManager themeManager,
BibDatabaseContext bibDatabaseContext,
ExternalFileTypes externalFileTypes) {
this.frame = Objects.requireNonNull(frame);
Expand All @@ -120,6 +123,7 @@ public LibraryTab(JabRefFrame frame,
this.dialogService = frame.getDialogService();
this.preferencesService = Objects.requireNonNull(preferencesService);
this.stateManager = Objects.requireNonNull(stateManager);
this.themeManager = Objects.requireNonNull(themeManager);

bibDatabaseContext.getDatabase().registerListener(this);
bibDatabaseContext.getMetaData().registerListener(this);
Expand Down Expand Up @@ -733,7 +737,13 @@ public FileAnnotationCache getAnnotationCache() {

public void resetChangeMonitorAndChangePane() {
changeMonitor.ifPresent(DatabaseChangeMonitor::unregister);
changeMonitor = Optional.of(new DatabaseChangeMonitor(bibDatabaseContext, Globals.getFileUpdateMonitor(), Globals.TASK_EXECUTOR, preferencesService, stateManager));
changeMonitor = Optional.of(new DatabaseChangeMonitor(bibDatabaseContext,
Globals.getFileUpdateMonitor(),
Globals.TASK_EXECUTOR,
dialogService,
preferencesService,
stateManager,
themeManager));

changePane = new DatabaseChangePane(splitPane, bibDatabaseContext, changeMonitor.get());

Expand Down Expand Up @@ -779,11 +789,11 @@ public void resetChangedProperties() {
}

public static class Factory {
public LibraryTab createLibraryTab(JabRefFrame frame, PreferencesService preferencesService, StateManager stateManager, Path file, BackgroundTask<ParserResult> dataLoadingTask) {
public LibraryTab createLibraryTab(JabRefFrame frame, PreferencesService preferencesService, StateManager stateManager, ThemeManager themeManager, Path file, BackgroundTask<ParserResult> dataLoadingTask) {
BibDatabaseContext context = new BibDatabaseContext();
context.setDatabasePath(file);

LibraryTab newTab = new LibraryTab(frame, preferencesService, stateManager, context, ExternalFileTypes.getInstance());
LibraryTab newTab = new LibraryTab(frame, preferencesService, stateManager, themeManager, context, ExternalFileTypes.getInstance());
newTab.setDataLoadingTask(dataLoadingTask);

dataLoadingTask.onRunning(newTab::onDatabaseLoadingStarted)
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/org/jabref/gui/auximport/FromAuxDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.jabref.gui.DialogService;
import org.jabref.gui.JabRefFrame;
import org.jabref.gui.LibraryTab;
import org.jabref.gui.theme.ThemeManager;
import org.jabref.gui.util.BaseDialog;
import org.jabref.gui.util.FileDialogConfiguration;
import org.jabref.logic.auxparser.AuxParser;
Expand Down Expand Up @@ -42,6 +43,7 @@ public class FromAuxDialog extends BaseDialog<Void> {

@Inject private PreferencesService preferences;
@Inject private DialogService dialogService;
@Inject private ThemeManager themeManager;

public FromAuxDialog(JabRefFrame frame) {
libraryTab = frame.getCurrentLibraryTab();
Expand All @@ -61,6 +63,8 @@ public FromAuxDialog(JabRefFrame frame) {
}
return null;
});

themeManager.updateFontStyle(getDialogPane().getScene());
}

@FXML
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/org/jabref/gui/collab/ChangeScanner.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
import java.util.Collections;
import java.util.List;

import org.jabref.gui.DialogService;
import org.jabref.gui.StateManager;
import org.jabref.gui.theme.ThemeManager;
import org.jabref.logic.bibtex.comparator.BibDatabaseDiff;
import org.jabref.logic.bibtex.comparator.BibEntryDiff;
import org.jabref.logic.bibtex.comparator.BibStringDiff;
Expand All @@ -24,13 +26,21 @@ public class ChangeScanner {

private static final Logger LOGGER = LoggerFactory.getLogger(ChangeScanner.class);
private final BibDatabaseContext database;
private final DialogService dialogService;
private final PreferencesService preferencesService;
private final StateManager stateManager;
private final ThemeManager themeManager;

public ChangeScanner(BibDatabaseContext database, PreferencesService preferencesService, StateManager stateManager) {
public ChangeScanner(BibDatabaseContext database,
DialogService dialogService,
PreferencesService preferencesService,
StateManager stateManager,
ThemeManager themeManager) {
this.database = database;
this.dialogService = dialogService;
this.preferencesService = preferencesService;
this.stateManager = stateManager;
this.themeManager = themeManager;
}

public List<DatabaseChangeViewModel> scanForChanges() {
Expand Down Expand Up @@ -82,7 +92,7 @@ private DatabaseChangeViewModel createBibStringDiff(BibStringDiff diff) {

private DatabaseChangeViewModel createBibEntryDiff(BibEntryDiff diff) {
if (diff.getOriginalEntry() == null) {
return new EntryAddChangeViewModel(diff.getNewEntry(), preferencesService, stateManager);
return new EntryAddChangeViewModel(diff.getNewEntry(), preferencesService, dialogService, stateManager, themeManager);
}

if (diff.getNewEntry() == null) {
Expand Down
Loading