Package com.jidesoft.plaf
Class UIDefaultsLookup
java.lang.Object
com.jidesoft.plaf.UIDefaultsLookup
This class simply uses UIManager's get method to lookup the UIDefaults. We used this everywhere in our code so that
we have one central place to find out which UIDefaults we are using. Another good thing is you can use
setTrace(boolean) and setDebug(boolean) to turn on the trace so that it will print out which UIDefaults we
are trying to get.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Objectstatic Objectstatic booleangetBoolean(Object key) If the value ofkeyis boolean, return the boolean value, otherwise return false.static booleangetBoolean(Object key, boolean defaultValue) If the value ofkeyis boolean, return the boolean value, otherwise return false.static booleangetBoolean(Object key, Locale l) If the value ofkeyfor the givenLocaleis boolean, return the boolean value, otherwise return false.static BorderIf the value ofkeyis aBorderreturn it, otherwise returnnull.static BorderIf the value ofkeyfor the givenLocaleis aBorderreturn it, otherwise returnnull.static ColorIf the value ofkeyis aColorreturn it, otherwise returnnull.static ColorIf the value ofkeyfor the givenLocaleis aColorreturn it, otherwise returnnull.static DimensiongetDimension(Object key) If the value ofkeyis aDimensionreturn it, otherwise returnnull.static DimensiongetDimension(Object key, Locale l) If the value ofkeyfor the givenLocaleis aDimensionreturn it, otherwise returnnull.static FontIf the value ofkeyis aFontreturn it, otherwise returnnull.static FontIf the value ofkeyfor the givenLocaleis aFontreturn it, otherwise returnnull.static IconIf the value ofkeyis anIconreturn it, otherwise returnnull.static IconIf the value ofkeyfor the givenLocaleis anIconreturn it, otherwise returnnull.static InsetsIf the value ofkeyis anInsetsreturn it, otherwise returnnull.static InsetsIf the value ofkeyfor the givenLocaleis anInsetsreturn it, otherwise returnnull.static intIf the value ofkeyis anIntegerreturn its integer value, otherwise return 0.static intIf the value ofkeyfor the givenLocaleis anIntegerreturn its integer value, otherwise return 0.static StringIf the value ofkeyis aStringreturn it, otherwise returnnull.static StringIf the value ofkeyfor the givenLocaleis aStringreturn it, otherwise returnnull.static voidput(UIDefaults table, String key, Object value) static voidsetDebug(boolean debug) Sets the debug mode.static voidsetTrace(boolean trace) Sets the trace mode.
-
Constructor Details
-
UIDefaultsLookup
public UIDefaultsLookup()
-
-
Method Details
-
setDebug
public static void setDebug(boolean debug) Sets the debug mode. If debug mode is on, we will print out any UIDefaults that the value is null.- Parameters:
debug- true or false.
-
setTrace
public static void setTrace(boolean trace) Sets the trace mode. If trace mode is on, we will print out any UIDefaults we are trying to get and its current value.- Parameters:
trace- true or false.
-
put
-
get
-
get
-
getFont
If the value ofkeyis aFontreturn it, otherwise returnnull.- Parameters:
key- the desired key- Returns:
- if the value for
keyis aFont, return theFontobject; otherwise returnnull
-
getFont
If the value ofkeyfor the givenLocaleis aFontreturn it, otherwise returnnull.- Parameters:
key- the desired keyl- the desired locale- Returns:
- if the value for
keyandLocaleis aFont, return theFontobject; otherwise returnnull - Since:
- 1.9.5.04
-
getColor
If the value ofkeyis aColorreturn it, otherwise returnnull.- Parameters:
key- the desired key- Returns:
- if the value for
keyis aColor, return theColorobject; otherwise returnnull
-
getColor
If the value ofkeyfor the givenLocaleis aColorreturn it, otherwise returnnull.- Parameters:
key- the desired keyl- the desired locale- Returns:
- if the value for
keyandLocaleis aColor, return theColorobject; otherwise returnnull - Since:
- 1.9.5.04
-
getIcon
If the value ofkeyis anIconreturn it, otherwise returnnull.- Parameters:
key- the desired key- Returns:
- if the value for
keyis anIcon, return theIconobject; otherwise returnnull
-
getIcon
If the value ofkeyfor the givenLocaleis anIconreturn it, otherwise returnnull.- Parameters:
key- the desired keyl- the desired locale- Returns:
- if the value for
keyandLocaleis anIcon, return theIconobject; otherwise returnnull - Since:
- 1.9.5.04
-
getBorder
If the value ofkeyis aBorderreturn it, otherwise returnnull.- Parameters:
key- the desired key- Returns:
- if the value for
keyis aBorder, return theBorderobject; otherwise returnnull
-
getBorder
If the value ofkeyfor the givenLocaleis aBorderreturn it, otherwise returnnull.- Parameters:
key- the desired keyl- the desired locale- Returns:
- if the value for
keyandLocaleis aBorder, return theBorderobject; otherwise returnnull - Since:
- 1.9.5.04
-
getString
If the value ofkeyis aStringreturn it, otherwise returnnull.- Parameters:
key- the desired key- Returns:
- if the value for
keyis aString, return theStringobject; otherwise returnnull
-
getString
If the value ofkeyfor the givenLocaleis aStringreturn it, otherwise returnnull.- Parameters:
key- the desired keyl- the desiredLocale- Returns:
- if the value for
keyfor the givenLocaleis aString, return theStringobject; otherwise returnnull - Since:
- 1.9.5.04
-
getInt
If the value ofkeyis anIntegerreturn its integer value, otherwise return 0.- Parameters:
key- the desired key- Returns:
- if the value for
keyis anInteger, return its value, otherwise return 0
-
getInt
If the value ofkeyfor the givenLocaleis anIntegerreturn its integer value, otherwise return 0.- Parameters:
key- the desired keyl- the desired locale- Returns:
- if the value for
keyandLocaleis anInteger, return its value, otherwise return 0 - Since:
- 1.9.5.04
-
getBoolean
If the value ofkeyis boolean, return the boolean value, otherwise return false.- Parameters:
key- anObjectspecifying the key for the desired boolean value- Returns:
- if the value of
keyis boolean, return the boolean value, otherwise return false. - Since:
- 1.9.5.04
-
getBoolean
If the value ofkeyis boolean, return the boolean value, otherwise return false.- Parameters:
key- anObjectspecifying the key for the desired boolean valuedefaultValue- the default value if the key is missing- Returns:
- if the value of
keyis boolean, return the boolean value, otherwise return false.
-
getBoolean
If the value ofkeyfor the givenLocaleis boolean, return the boolean value, otherwise return false.- Parameters:
key- anObjectspecifying the key for the desired boolean valuel- the desired locale- Returns:
- if the value for
keyandLocaleis boolean, return the boolean value, otherwise return false. - Since:
- 1.9.5.04
-
getInsets
If the value ofkeyis anInsetsreturn it, otherwise returnnull.- Parameters:
key- the desired key- Returns:
- if the value for
keyis anInsets, return theInsetsobject; otherwise returnnull
-
getInsets
If the value ofkeyfor the givenLocaleis anInsetsreturn it, otherwise returnnull.- Parameters:
key- the desired keyl- the desired locale- Returns:
- if the value for
keyandLocaleis anInsets, return theInsetsobject; otherwise returnnull - Since:
- 1.9.5.04
-
getDimension
If the value ofkeyis aDimensionreturn it, otherwise returnnull.- Parameters:
key- the desired key- Returns:
- if the value for
keyis aDimension, return theDimensionobject; otherwise returnnull
-
getDimension
If the value ofkeyfor the givenLocaleis aDimensionreturn it, otherwise returnnull.- Parameters:
key- the desired keyl- the desired locale- Returns:
- if the value for
keyandLocaleis aDimension, return theDimensionobject; otherwise returnnull - Since:
- 1.9.5.04
-