Skip to content

Commit a0354bb

Browse files
SiedlerchrYubo-Cao
andauthored
Updatejfx25 (#13933)
* fix git modules requires and uses * update javafx 25 * update richtext * fix version * try to fix module? * try to fix module? * try to fix module? * fix module * fix: ThemeManager test * more explanation and check if test is on fx thrad * remove debug --------- Co-authored-by: Yubo-Cao <cao2006721@gmail.com>
1 parent 449f565 commit a0354bb

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

build-logic/src/main/kotlin/org.jabref.gradle.base.dependency-rules.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ extraJavaModuleInfo {
552552
requiresTransitive("jdk.unsupported")
553553
}
554554

555-
module("org.openjfx:jdk-jsobject", "jdk.jsobjectEmpty")
555+
module("org.openjfx:jdk-jsobject", "jdk.jsobjectEmpty") {}
556556

557557
module("org.controlsfx:controlsfx", "org.controlsfx.controls") {
558558
patchRealModule()

jabgui/src/main/java/org/jabref/gui/theme/ThemeManager.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,24 @@ public ThemeManager(WorkspacePreferences workspacePreferences,
8585
addStylesheetToWatchlist(this.baseStyleSheet, this::baseCssLiveUpdate);
8686
baseCssLiveUpdate();
8787

88-
BindingsHelper.subscribeFuture(workspacePreferences.themeProperty(), _ -> updateThemeSettings());
89-
BindingsHelper.subscribeFuture(workspacePreferences.themeSyncOsProperty(), _ -> updateThemeSettings());
90-
BindingsHelper.subscribeFuture(workspacePreferences.shouldOverrideDefaultFontSizeProperty(), _ -> updateFontSettings());
91-
BindingsHelper.subscribeFuture(workspacePreferences.mainFontSizeProperty(), _ -> updateFontSettings());
92-
BindingsHelper.subscribeFuture(Platform.getPreferences().colorSchemeProperty(), _ -> updateThemeSettings());
93-
updateThemeSettings();
88+
if (Platform.isFxApplicationThread()) {
89+
BindingsHelper.subscribeFuture(workspacePreferences.themeProperty(), _ -> updateThemeSettings());
90+
BindingsHelper.subscribeFuture(workspacePreferences.themeSyncOsProperty(), _ -> updateThemeSettings());
91+
BindingsHelper.subscribeFuture(workspacePreferences.shouldOverrideDefaultFontSizeProperty(), _ -> updateFontSettings());
92+
BindingsHelper.subscribeFuture(workspacePreferences.mainFontSizeProperty(), _ -> updateFontSettings());
93+
BindingsHelper.subscribeFuture(Platform.getPreferences().colorSchemeProperty(), _ -> updateThemeSettings());
94+
updateThemeSettings();
95+
} else {
96+
// Normally ThemeManager is only instantiated by JabGui and therefore already on the FX Thread, but when it's called from a test (e.g. ThemeManagerTest) then it's not on the fx thread
97+
UiTaskExecutor.runInJavaFXThread(() -> {
98+
BindingsHelper.subscribeFuture(workspacePreferences.themeProperty(), _ -> updateThemeSettings());
99+
BindingsHelper.subscribeFuture(workspacePreferences.themeSyncOsProperty(), _ -> updateThemeSettings());
100+
BindingsHelper.subscribeFuture(workspacePreferences.shouldOverrideDefaultFontSizeProperty(), _ -> updateFontSettings());
101+
BindingsHelper.subscribeFuture(workspacePreferences.mainFontSizeProperty(), _ -> updateFontSettings());
102+
BindingsHelper.subscribeFuture(Platform.getPreferences().colorSchemeProperty(), _ -> updateThemeSettings());
103+
updateThemeSettings();
104+
});
105+
}
94106
}
95107

96108
/// Installs the base and additional css files as stylesheets in the given scene.

versions/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ javaPlatform {
66
allowDependencies()
77
}
88

9-
val javafx = "24.0.2"
9+
val javafx = "25"
1010
val lucene = "10.2.2"
1111
val pdfbox = "3.0.5"
1212

@@ -29,7 +29,7 @@ dependencies.constraints {
2929
api("org.openjfx:javafx-swing:$javafx")
3030
api("org.openjfx:javafx-web:$javafx")
3131
// from JavaFX25 onwards
32-
api("org.openjfx:jdk-jsobject:25-ea+21")
32+
api("org.openjfx:jdk-jsobject:$javafx")
3333

3434
api("com.ibm.icu:icu4j:72.0.1!!")
3535

@@ -107,7 +107,7 @@ dependencies.constraints {
107107
api("org.controlsfx:controlsfx:11.2.2")
108108
api("org.eclipse.jgit:org.eclipse.jgit:7.3.0.202506031305-r")
109109
api("org.fxmisc.flowless:flowless:0.7.4")
110-
api("org.fxmisc.richtext:richtextfx:0.11.5")
110+
api("org.fxmisc.richtext:richtextfx:0.11.6")
111111
api("org.glassfish.grizzly:grizzly-framework:4.0.2")
112112
api("org.glassfish.grizzly:grizzly-http-server:4.0.2")
113113
api("org.glassfish.hk2:hk2-api:3.1.1")

0 commit comments

Comments
 (0)