Interface LookAndFeelProvider


  • public interface LookAndFeelProvider
    Provides a LookAndFeel implementation.
    • Method Detail

      • className

        String className()
        The name of the underlying LookAndFeel class
        Returns:
        the look and feel classname
      • name

        default String name()
        Returns:
        a unique name representing this look and feel, the classname by default
      • enable

        default void enable()
        Configures and enables this LookAndFeel. Calls UIManager.setLookAndFeel(String) by default, override to add any custom configuration.
      • lookAndFeelProvider

        static LookAndFeelProvider lookAndFeelProvider​(String classname,
                                                       Runnable enabler)
        Instantiates a new LookAndFeelProvider.
        Parameters:
        classname - the look and feel classname
        enabler - configures and enables this look and feel
        Returns:
        a look and feel provider
      • lookAndFeelProvider

        static LookAndFeelProvider lookAndFeelProvider​(String classname,
                                                       String name,
                                                       Runnable enabler)
        Instantiates a new LookAndFeelProvider.
        Parameters:
        classname - the look and feel classname
        name - a unique name
        enabler - configures and enables this look and feel
        Returns:
        a look and feel provider
      • addLookAndFeelProvider

        static void addLookAndFeelProvider​(LookAndFeelProvider lookAndFeelProvider)
        Adds the given look and feel provider. Note that this overrides any existing look and feel provider with the same name.
        Parameters:
        lookAndFeelProvider - the look and feel provider to add
      • getLookAndFeelProvider

        static Optional<LookAndFeelProvider> getLookAndFeelProvider​(String name)
        Returns a look and feel provider with the given name, if available
        Parameters:
        name - the look and feel name
        Returns:
        a look and feel provider, an empty Optional if not found
      • getDefaultLookAndFeelName

        static String getDefaultLookAndFeelName​(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
      • 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