|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.lwuit.plaf.UIManager
public class UIManager
Central point singleton managing the look of the application, this class allows us to customize the styles (themes) as well as the look instance.
Method Summary | |
---|---|
void |
addThemeProps(java.util.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(java.lang.String id,
java.lang.String type)
Returns a custom style for the component with the given id, this method always returns a new instance. |
Style |
getComponentSelectedStyle(java.lang.String id)
Returns the selected style of the component with the given id or a new instance of the default style. |
Style |
getComponentStyle(java.lang.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 |
java.util.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. |
int |
getThemeConstant(java.lang.String constantName,
int def)
Returns a theme constant defined in the resource editor |
java.lang.String |
getThemeConstant(java.lang.String constantName,
java.lang.String def)
Returns a theme constant defined in the resource editor |
Image |
getThemeImageConstant(java.lang.String constantName)
Returns a theme constant defined in the resource editor |
java.lang.String |
getThemeName()
|
java.lang.Boolean |
isThemeConstant(java.lang.String constantName)
Returns a theme constant defined in the resource editor as a boolean value or null if the constant isn't defined |
boolean |
isThemeConstant(java.lang.String constantName,
boolean def)
Returns a theme constant defined in the resource editor as a boolean value |
java.lang.String |
localize(java.lang.String key,
java.lang.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(java.lang.String id,
Style style)
Allows a developer to programmatically install a style into the UI manager |
void |
setComponentStyle(java.lang.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(java.util.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(java.util.Hashtable themeProps)
Allows manual theme loading from a hashtable of key/value pairs |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static UIManager getInstance()
public LookAndFeel getLookAndFeel()
public void setLookAndFeel(LookAndFeel plaf)
plaf
- the look and feel for the applicationpublic void setComponentStyle(java.lang.String id, Style style)
id
- the component id matching the given stylestyle
- the style object to installpublic void setComponentSelectedStyle(java.lang.String id, Style style)
id
- the component id matching the given stylestyle
- the style object to installpublic Style getComponentStyle(java.lang.String id)
id
- the component id whose style we want
public Style getComponentSelectedStyle(java.lang.String id)
id
- the component id whose selected style we want
public Style getComponentCustomStyle(java.lang.String id, java.lang.String type)
id
- the component id whose custom style we wanttype
- the style type
public java.lang.String getThemeName()
public void setThemeProps(java.util.Hashtable themeProps)
themeProps
- the properties of the given themepublic void addThemeProps(java.util.Hashtable themeProps)
themeProps
- the properties of the given themepublic int getThemeConstant(java.lang.String constantName, int def)
constantName
- the name of the constantdef
- default value
public java.lang.String getThemeConstant(java.lang.String constantName, java.lang.String def)
constantName
- the name of the constantdef
- default value
public boolean isThemeConstant(java.lang.String constantName, boolean def)
constantName
- the name of the constantdef
- default value
public java.lang.Boolean isThemeConstant(java.lang.String constantName)
constantName
- the name of the constant
public Image getThemeImageConstant(java.lang.String constantName)
constantName
- the name of the constant
public java.util.Hashtable getResourceBundle()
public void setResourceBundle(java.util.Hashtable resourceBundle)
resourceBundle
- the localization bundlepublic java.lang.String localize(java.lang.String key, java.lang.String defaultValue)
key
- The key used to lookup in the resource bundledefaultValue
- the value returned if no such key exists
public void addThemeRefreshListener(ActionListener l)
l
- an ActionListener to be addedpublic void removeThemeRefreshListener(ActionListener l)
l
- an ActionListener to be removed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |