Interface LookAndFeelEnabler


public interface LookAndFeelEnabler
Provides and enables a LookAndFeel implementation.
  • Method Details

    • lookAndFeelInfo

      UIManager.LookAndFeelInfo lookAndFeelInfo()
      Returns:
      the look and feel info
    • enable

      void enable()
      Configures and enables the LookAndFeel represented by this enabler.
    • lookAndFeel

      LookAndFeel lookAndFeel()
      Returns:
      a new instance of the LookAndFeel represented by this enabler
      Throws:
      RuntimeException - in case the class is not found or if the LookAndFeel could not be instantiated
    • platform

      default boolean platform()
      Returns:
      true if the look and feel enabled by this enabler is a built-in platform Look and Feel
    • lookAndFeelEnabler

      static LookAndFeelEnabler lookAndFeelEnabler(UIManager.LookAndFeelInfo lookAndFeelInfo)
      Instantiates a new LookAndFeelEnabler, using UIManager.setLookAndFeel(String) to enable.
      Parameters:
      lookAndFeelInfo - the look and feel info
      Returns:
      a look and feel provider
    • lookAndFeelEnabler

      static LookAndFeelEnabler lookAndFeelEnabler(UIManager.LookAndFeelInfo lookAndFeelInfo, Consumer<UIManager.LookAndFeelInfo> enabler)
      Instantiates a new LookAndFeelEnabler.

      The enabler is responsible for configuring and enabling the look and feel as well as updating the component tree of all application windows, for example by calling Utilities.updateComponentTreeForAllWindows()

      Parameters:
      lookAndFeelInfo - the look and feel info
      enabler - configures and enables the look and feel as well as updates the component tree of all application windows
      Returns:
      a look and feel provider
    • enableLookAndFeel

      static void enableLookAndFeel(String userPreferencePropertyName)
      Enables the look and feel specified by the given user preference or the default system look and feel if no preference value is found.
      Parameters:
      userPreferencePropertyName - the name of the user preference look and feel property
    • enableLookAndFeel

      static void enableLookAndFeel(String userPreferencePropertyName, Class<? extends LookAndFeel> defaultLookAndFeel)
      Enables the look and feel specified by the given user preference or the default one if no preference value is found.
      Parameters:
      userPreferencePropertyName - the name of the user preference look and feel property
      defaultLookAndFeel - the default look and feel class to use if none is found in user preferences
    • enableLookAndFeel

      static void enableLookAndFeel(String userPreferencePropertyName, String defaultLookAndFeel)
      Enables the look and feel specified by the given user preference or the default one if no preference value is found.
      Parameters:
      userPreferencePropertyName - the name of the user preference look and feel property
      defaultLookAndFeel - the classname of the default look and feel to use if none is found in user preferences