UiUtil (install4j API)
Description: declaration: package: com.install4j.api, class: UiUtil

Package com.install4j.api

# 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 Summary

  Constructors
  Constructor
  Description
  `UiUtil()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static LookAndFeelEnhancer`
  `getLookAndFeelEnhancer()`
  Returns the currently active look and feel info.
  `static Window`
  `getParentWindow()`
  Get the topmost window in the current JVM.
  `static Window`
  `getWizardWindow()`
  Get the current install4j wizard window.
  `static boolean`
  `isDarkDesktop()`
  Returns if the desktop environment is in dark mode or not.
  `static boolean`
  `isDarkUi()`
  Returns if the installer application is running in dark mode or not.
  `static void`
  `setDarkUi(boolean dark)`
  Switch between dark and light mode and update all windows with the new mode.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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:
      - `LookAndFeelEnhancer.isDark()`

  - ### 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 topmost window in the current JVM.
    Returns:
      the window or `null` if the installer application is running in console or unattended mode.

  - ### getWizardWindow

    public static Window getWizardWindow()
    Get the current install4j wizard window.
    Returns:
      the window or `null` if the installer application is running in console or unattended mode.