public interface LookAndFeelEnabler
Provides and enables a
LookAndFeel implementation.-
Method Summary
Modifier and TypeMethodDescriptionvoidenable()Configures and enables theLookAndFeelrepresented by this enabler.static voidenableLookAndFeel(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 booleanenableLookAndFeel(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 booleanenableLookAndFeel(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.booleanstatic LookAndFeelEnablerlookAndFeelEnabler(UIManager.LookAndFeelInfo lookAndFeelInfo) Instantiates a newLookAndFeelEnabler, usingUIManager.setLookAndFeel(String)to enable.static LookAndFeelEnablerlookAndFeelEnabler(UIManager.LookAndFeelInfo lookAndFeelInfo, Consumer<UIManager.LookAndFeelInfo> enabler) Instantiates a newLookAndFeelEnabler.default UIDefaults
-
Method Details
-
lookAndFeelInfo
UIManager.LookAndFeelInfo lookAndFeelInfo()- Returns:
- the look and feel info
-
enable
void enable()Configures and enables theLookAndFeelrepresented by this enabler. -
lookAndFeel
LookAndFeel lookAndFeel()- Returns:
- a new instance of the
LookAndFeelrepresented by this enabler - Throws:
RuntimeException- in case the class is not found or if theLookAndFeelcould not be instantiated
-
installed
boolean installed()- Returns:
- true if the look and feel enabled by this enabler is an installed platform Look and Feel
-
uiDefaults
- Returns:
- the
UIDefaultsfor the look and feel this enabler represents
-
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
enableris 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 boolean 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- Returns:
- true if a look and feel was enabled, false if the neither the user preference nor default look and feels were available
-
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- Returns:
- true if a look and feel was enabled, false if the neither the user preference nor default look and feels were available
-