This is an automated email from the ASF dual-hosted git repository.

hansva pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/hop.git


The following commit(s) were added to refs/heads/main by this push:
     new 4e026e55e0 fix: Fix NoSuchMethodError in Hop Web when changing GUI 
options (#6546)
4e026e55e0 is described below

commit 4e026e55e0e871e497aabd5d53acd45bb2ce9878
Author: chenlexiang <[email protected]>
AuthorDate: Wed Feb 11 21:22:02 2026 +0800

    fix: Fix NoSuchMethodError in Hop Web when changing GUI options (#6546)
    
    Display.isSystemDarkTheme() method is not available in Eclipse RAP (Web 
environment).
    Calling this method causes java.lang.NoSuchMethodError exception when users
    try to change locale or other GUI options in Hop Web.
    
    Changes:
    - Add EnvironmentUtils.getInstance().isWeb() check in 
ConfigGuiOptionsTab.java
    - In reloadValues(): use stored dark mode preference in Web environment
    - In saveValues(): use checkbox selection value in Web environment
    
    This fix allows Hop Web users to change locale and GUI settings without 
errors.
---
 .../configuration/tabs/ConfigGuiOptionsTab.java       | 19 ++++++++++++++-----
 1 file changed, 14 insertions(+), 5 deletions(-)

diff --git 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/configuration/tabs/ConfigGuiOptionsTab.java
 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/configuration/tabs/ConfigGuiOptionsTab.java
index aff9210472..b3d69cbac5 100644
--- 
a/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/configuration/tabs/ConfigGuiOptionsTab.java
+++ 
b/ui/src/main/java/org/apache/hop/ui/hopgui/perspective/configuration/tabs/ConfigGuiOptionsTab.java
@@ -32,6 +32,7 @@ import org.apache.hop.ui.core.dialog.ErrorDialog;
 import org.apache.hop.ui.core.gui.GuiResource;
 import org.apache.hop.ui.hopgui.HopGui;
 import 
org.apache.hop.ui.hopgui.perspective.configuration.ConfigurationPerspective;
+import org.apache.hop.ui.util.EnvironmentUtils;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.custom.CTabFolder;
 import org.eclipse.swt.custom.CTabItem;
@@ -165,9 +166,12 @@ public class ConfigGuiOptionsTab {
       wHideMenuBar.setSelection(props.isHidingMenuBar());
       wShowTableViewToolbar.setSelection(props.isShowTableViewToolbar());
       // On macOS (and other non-Windows), dark mode follows system; sync from 
system so UI and
-      // props match
-      boolean darkMode = Const.isWindows() ? props.isDarkMode() : 
Display.isSystemDarkTheme();
-      if (!Const.isWindows()) {
+      // props match. In Web environment, isSystemDarkTheme() is not available.
+      boolean darkMode;
+      if (EnvironmentUtils.getInstance().isWeb() || Const.isWindows()) {
+        darkMode = props.isDarkMode();
+      } else {
+        darkMode = Display.isSystemDarkTheme();
         props.setDarkMode(darkMode);
       }
       wDarkMode.setSelection(darkMode);
@@ -941,8 +945,13 @@ public class ConfigGuiOptionsTab {
     props.setInfiniteCanvasMoveEnabled(wEnableInfiniteMove.getSelection());
     props.setZoomScrollingDisabled(wDisableZoomScrolling.getSelection());
     // On macOS (and other non-Windows), dark mode follows system; persist 
system theme, not
-    // checkbox
-    boolean darkMode = Const.isWindows() ? wDarkMode.getSelection() : 
Display.isSystemDarkTheme();
+    // checkbox. In Web environment, isSystemDarkTheme() is not available.
+    boolean darkMode;
+    if (EnvironmentUtils.getInstance().isWeb() || Const.isWindows()) {
+      darkMode = wDarkMode.getSelection();
+    } else {
+      darkMode = Display.isSystemDarkTheme();
+    }
     props.setDarkMode(darkMode);
     props.setHidingMenuBar(wHideMenuBar.getSelection());
     props.setShowTableViewToolbar(wShowTableViewToolbar.getSelection());

Reply via email to