public interface LookAndFeelEnabler
Provides and enables a
LookAndFeel
implementation.-
Method Summary
Modifier and TypeMethodDescriptionvoid
enable()
Configures and enables theLookAndFeel
represented by this enabler.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.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.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.static LookAndFeelEnabler
lookAndFeelEnabler
(UIManager.LookAndFeelInfo lookAndFeelInfo) Instantiates a newLookAndFeelEnabler
, usingUIManager.setLookAndFeel(String)
to enable.static LookAndFeelEnabler
lookAndFeelEnabler
(UIManager.LookAndFeelInfo lookAndFeelInfo, Consumer<UIManager.LookAndFeelInfo> enabler) Instantiates a newLookAndFeelEnabler
.default boolean
platform()
-
Method Details
-
lookAndFeelInfo
UIManager.LookAndFeelInfo lookAndFeelInfo()- Returns:
- the look and feel info
-
enable
void enable()Configures and enables theLookAndFeel
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 theLookAndFeel
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
Instantiates a newLookAndFeelEnabler
, usingUIManager.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 newLookAndFeelEnabler
.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 callingUtilities.updateComponentTreeForAllWindows()
- Parameters:
lookAndFeelInfo
- the look and feel infoenabler
- 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
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 propertydefaultLookAndFeel
- the default look and feel class to use if none is found in user preferences
-
enableLookAndFeel
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 propertydefaultLookAndFeel
- the classname of the default look and feel to use if none is found in user preferences
-