Interface LookAndFeelProvider


public interface LookAndFeelProvider
Provides a LookAndFeel implementation.
  • Field Details

    • CROSS_PLATFORM

      static final PropertyValue<Boolean> CROSS_PLATFORM
      Specifies whether the cross platform Look and Feel should be available for selection.
      • Value type: Boolean
      • Default value: true
    • SYSTEM

      static final PropertyValue<Boolean> SYSTEM
      Specifies whether the cross platform Look and Feel should be available for selection.
      • Value type: Boolean
      • Default value: true
  • Method Details

    • lookAndFeelInfo

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

      void enable()
      Configures and enables this LookAndFeel.
    • lookAndFeel

      LookAndFeel lookAndFeel() throws Exception
      Returns:
      the LookAndFeel instance represented by this provider
      Throws:
      Exception - in case an instance could not be created
    • lookAndFeelProvider

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

      static LookAndFeelProvider lookAndFeelProvider(UIManager.LookAndFeelInfo lookAndFeelInfo, Consumer<UIManager.LookAndFeelInfo> enabler)
      Instantiates a new LookAndFeelProvider.
      Parameters:
      lookAndFeelInfo - the look and feel info
      enabler - configures and enables this look and feel
      Returns:
      a look and feel provider
    • addLookAndFeel

      static void addLookAndFeel(UIManager.LookAndFeelInfo lookAndFeelInfo)
      Adds a new look and feel provider.
      Parameters:
      lookAndFeelInfo - the look and feel info
    • addLookAndFeel

      static void addLookAndFeel(UIManager.LookAndFeelInfo lookAndFeelInfo, Consumer<UIManager.LookAndFeelInfo> enabler)
      Adds a new look and feel provider.
      Parameters:
      lookAndFeelInfo - the look and feel info
      enabler - configures and enables this look and feel
    • addLookAndFeel

      static void addLookAndFeel(LookAndFeelProvider lookAndFeelProvider)
      Adds the given look and feel provider. Note that this replaces any existing look and feel provider based on the same classname.
      Parameters:
      lookAndFeelProvider - the look and feel provider to add
    • lookAndFeelProviders

      static Map<String,LookAndFeelProvider> lookAndFeelProviders()
      Returns:
      the available LookAndFeelProviders
      See Also:
    • findLookAndFeelProvider

      static Optional<LookAndFeelProvider> findLookAndFeelProvider(String className)
      Returns a look and feel provider with the given classname, if available
      Parameters:
      className - the look and feel classname
      Returns:
      a look and feel provider, an empty Optional if not found
    • defaultLookAndFeelName

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

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

      static void enableLookAndFeel(LookAndFeelProvider lookAndFeelProvider)
      Enables the given look and feel and updates all window component trees.
      Parameters:
      lookAndFeelProvider - the look and feel provider to enable