public class UIManager extends Object
Modifier and Type | Method and Description |
---|---|
void |
addThemeProps(Hashtable themeProps)
Adds the given theme properties on top of the existing properties without
clearing the existing theme first
|
void |
addThemeRefreshListener(ActionListener l)
Adds a Theme refresh listener.
|
Style |
getComponentCustomStyle(String id,
String type)
Returns a custom style for the component with the given id, this method always returns a
new instance.
|
Style |
getComponentSelectedStyle(String id)
Returns the selected style of the component with the given id or a new instance of the default
style.
|
Style |
getComponentStyle(String id)
Returns the style of the component with the given id or a new instance of the default
style.
|
static UIManager |
getInstance()
Singleton instance method
|
LookAndFeel |
getLookAndFeel()
Returns the currently installed look and feel
|
Hashtable |
getResourceBundle()
The resource bundle allows us to implicitly localize the UI on the fly, once its
installed all internal application strings query the resource bundle and extract
their values from this table if applicable.
|
String |
getThemeName() |
String |
localize(String key,
String defaultValue)
Localizes the given string from the resource bundle if such a String exists in the
resource bundle.
|
void |
removeThemeRefreshListener(ActionListener l)
Removes a Theme refresh listener.
|
void |
setComponentSelectedStyle(String id,
Style style)
Allows a developer to programmatically install a style into the UI manager
|
void |
setComponentStyle(String id,
Style style)
Allows a developer to programmatically install a style into the UI manager
|
void |
setLookAndFeel(LookAndFeel plaf)
Sets the currently installed look and feel
|
void |
setResourceBundle(Hashtable resourceBundle)
The resource bundle allows us to implicitly localize the UI on the fly, once its
installed all internal application strings query the resource bundle and extract
their values from this table if applicable.
|
void |
setThemeProps(Hashtable themeProps)
Allows manual theme loading from a hashtable of key/value pairs
|
public static UIManager getInstance()
public LookAndFeel getLookAndFeel()
public void setLookAndFeel(LookAndFeel plaf)
plaf
- the look and feel for the applicationpublic void setComponentStyle(String id, Style style)
id
- the component id matching the given stylestyle
- the style object to installpublic void setComponentSelectedStyle(String id, Style style)
id
- the component id matching the given stylestyle
- the style object to installpublic Style getComponentStyle(String id)
id
- the component id whose style we wantpublic Style getComponentSelectedStyle(String id)
id
- the component id whose selected style we wantpublic Style getComponentCustomStyle(String id, String type)
id
- the component id whose custom style we wanttype
- the style typepublic String getThemeName()
public void setThemeProps(Hashtable themeProps)
themeProps
- the properties of the given themepublic void addThemeProps(Hashtable themeProps)
themeProps
- the properties of the given themepublic Hashtable getResourceBundle()
public void setResourceBundle(Hashtable resourceBundle)
resourceBundle
- the localization bundlepublic String localize(String key, String defaultValue)
key
- The key used to lookup in the resource bundledefaultValue
- the value returned if no such key existspublic void addThemeRefreshListener(ActionListener l)
l
- an ActionListener to be addedpublic void removeThemeRefreshListener(ActionListener l)
l
- an ActionListener to be removed