Class UiUtil

java.lang.Object
com.install4j.api.UiUtil

public class UiUtil extends Object
This class contains methods that deal with global properties of the installer application GUI.

When running in console or unattended mode, these methods can still be called, although they may not have any effect or return any helpful information.

  • Constructor Details

    • UiUtil

      public UiUtil()
  • Method Details

    • isDarkDesktop

      public static boolean isDarkDesktop()
      Returns if the desktop environment is in dark mode or not.

      To check whether the installer application is running with a dark look and feel, you should call isDarkUi() instead. If you have selected the FlatLaf look and feel for installer applications with dark mode auto-detection enabled, both methods will return the same value.

    • isDarkUi

      public static boolean isDarkUi()
      Returns if the installer application is running in dark mode or not.

      This is a convenience method for calling

      
        LookAndFeelEnhancer.getInstance().isDark()
      
      See Also:
    • setDarkUi

      public static void setDarkUi(boolean dark)
      Switch between dark and light mode and update all windows with the new mode.

      This will only have an effect if LookAndFeelEnhancer.isDarkModeSwitchingSupported() returns true and if the installer application is running in GUI mode.

      Parameters:
      dark - true for dark mode
    • getLookAndFeelEnhancer

      @NotNull public static LookAndFeelEnhancer getLookAndFeelEnhancer()
      Returns the currently active look and feel info.
    • getParentWindow

      public static Window getParentWindow()
      Get the window of the installer application.
      Returns:
      the window or null if the installer application is running in console or unattended mode.