LookAndFeelHandler (install4j API)
Description: declaration: package: com.install4j.api.laf, interface: LookAndFeelHandler

# Interface LookAndFeelHandler

All Superinterfaces:
  `LookAndFeelEnhancer`

public interface LookAndFeelHandler extends LookAndFeelEnhancer
A look and feel handler can apply a look and feel. An implementation of this interface together with its dependencies can be added on the "Installer->Custom Code & Resources" step and can then be configured on the "Installer->Look & Feel" step.

The super-interface `LookAndFeelEnhancer` contains a number of methods with default implementations that can be overridden in order to customize certain aspects of creating the UI.

- ## Field Summary

  ### Fields inherited from interface LookAndFeelEnhancer

  `DEFAULT_LIGHT_TITLE_COLOR`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `applyLookAndFeel(boolean darkDesktop)`
  Called when the installer application is ready to apply the look and feel.
  `default void`
  `setDark(boolean dark)`
  Switch between dark and light mode.

  ### Methods inherited from interface LookAndFeelEnhancer

  `computeFontScaleFactor, createTriStateCheckBox, disableExtraSelectionPainting, getAlertFont, getCustomScaleFactor, getFileChooserLowerAccessoryInset, getTitleColor, isDark, isDarkModeSwitchingSupported, isPreventTransparency, isWideTreeSelection, prepareWindow`

- ## Method Details

  - ### applyLookAndFeel

    void applyLookAndFeel(boolean darkDesktop) throws Exception
    Called when the installer application is ready to apply the look and feel.
    Parameters:
      `darkDesktop` - if the desktop is detected to be in dark mode. This auto-detection is implemented for Windows 10 and macOS.
    Throws:
      `Exception`

  - ### setDark

    default void setDark(boolean dark)
    Switch between dark and light mode. This method will be called when user code invokes `UiUtil.setDarkUi(boolean)`, that method will also update the component hierarchy in all windows.

    By default, this method throws an `UnsupportedOperationException`. If it is implemented, `LookAndFeelEnhancer.isDarkModeSwitchingSupported()` must be overridden to return `true`.

    Parameters:
      `dark` - `true` for dark mode
    See Also:
      - `UiUtil.setDarkUi(boolean)`