Package com.jidesoft.plaf
Class UIDefaultsLookup
- java.lang.Object
-
- com.jidesoft.plaf.UIDefaultsLookup
-
public class UIDefaultsLookup extends java.lang.ObjectThis 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 usesetTrace(boolean)andsetDebug(boolean)to turn on the trace so that it will print out which UIDefaults we are trying to get.
-
-
Constructor Summary
Constructors Constructor Description UIDefaultsLookup()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Objectget(java.lang.Object key)static java.lang.Objectget(java.lang.Object key, java.util.Locale l)static booleangetBoolean(java.lang.Object key)If the value ofkeyis boolean, return the boolean value, otherwise return false.static booleangetBoolean(java.lang.Object key, boolean defaultValue)If the value ofkeyis boolean, return the boolean value, otherwise return false.static booleangetBoolean(java.lang.Object key, java.util.Locale l)If the value ofkeyfor the givenLocaleis boolean, return the boolean value, otherwise return false.static javax.swing.border.BordergetBorder(java.lang.Object key)If the value ofkeyis aBorderreturn it, otherwise returnnull.static javax.swing.border.BordergetBorder(java.lang.Object key, java.util.Locale l)If the value ofkeyfor the givenLocaleis aBorderreturn it, otherwise returnnull.static java.awt.ColorgetColor(java.lang.Object key)If the value ofkeyis aColorreturn it, otherwise returnnull.static java.awt.ColorgetColor(java.lang.Object key, java.util.Locale l)If the value ofkeyfor the givenLocaleis aColorreturn it, otherwise returnnull.static java.awt.DimensiongetDimension(java.lang.Object key)If the value ofkeyis aDimensionreturn it, otherwise returnnull.static java.awt.DimensiongetDimension(java.lang.Object key, java.util.Locale l)If the value ofkeyfor the givenLocaleis aDimensionreturn it, otherwise returnnull.static java.awt.FontgetFont(java.lang.Object key)If the value ofkeyis aFontreturn it, otherwise returnnull.static java.awt.FontgetFont(java.lang.Object key, java.util.Locale l)If the value ofkeyfor the givenLocaleis aFontreturn it, otherwise returnnull.static javax.swing.IcongetIcon(java.lang.Object key)If the value ofkeyis anIconreturn it, otherwise returnnull.static javax.swing.IcongetIcon(java.lang.Object key, java.util.Locale l)If the value ofkeyfor the givenLocaleis anIconreturn it, otherwise returnnull.static java.awt.InsetsgetInsets(java.lang.Object key)If the value ofkeyis anInsetsreturn it, otherwise returnnull.static java.awt.InsetsgetInsets(java.lang.Object key, java.util.Locale l)If the value ofkeyfor the givenLocaleis anInsetsreturn it, otherwise returnnull.static intgetInt(java.lang.Object key)If the value ofkeyis anIntegerreturn its integer value, otherwise return 0.static intgetInt(java.lang.Object key, java.util.Locale l)If the value ofkeyfor the givenLocaleis anIntegerreturn its integer value, otherwise return 0.static java.lang.StringgetString(java.lang.Object key)If the value ofkeyis aStringreturn it, otherwise returnnull.static java.lang.StringgetString(java.lang.Object key, java.util.Locale l)If the value ofkeyfor the givenLocaleis aStringreturn it, otherwise returnnull.static voidput(javax.swing.UIDefaults table, java.lang.String key, java.lang.Object value)static voidsetDebug(boolean debug)Sets the debug mode.static voidsetTrace(boolean trace)Sets the trace mode.
-
-
-
Method Detail
-
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
public static void put(javax.swing.UIDefaults table, java.lang.String key, java.lang.Object value)
-
get
public static java.lang.Object get(java.lang.Object key)
-
get
public static java.lang.Object get(java.lang.Object key, java.util.Locale l)
-
getFont
public static java.awt.Font getFont(java.lang.Object key)
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
public static java.awt.Font getFont(java.lang.Object key, java.util.Locale l)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
public static java.awt.Color getColor(java.lang.Object key)
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
public static java.awt.Color getColor(java.lang.Object key, java.util.Locale l)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
public static javax.swing.Icon getIcon(java.lang.Object key)
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
public static javax.swing.Icon getIcon(java.lang.Object key, java.util.Locale l)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
public static javax.swing.border.Border getBorder(java.lang.Object key)
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
public static javax.swing.border.Border getBorder(java.lang.Object key, java.util.Locale l)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
public static java.lang.String getString(java.lang.Object key)
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
public static java.lang.String getString(java.lang.Object key, java.util.Locale l)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
public static int getInt(java.lang.Object key)
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
public static int getInt(java.lang.Object key, java.util.Locale l)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
public static boolean getBoolean(java.lang.Object key)
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
public static boolean getBoolean(java.lang.Object key, boolean defaultValue)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
public static boolean getBoolean(java.lang.Object key, java.util.Locale l)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
public static java.awt.Insets getInsets(java.lang.Object key)
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
public static java.awt.Insets getInsets(java.lang.Object key, java.util.Locale l)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
public static java.awt.Dimension getDimension(java.lang.Object key)
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
public static java.awt.Dimension getDimension(java.lang.Object key, java.util.Locale l)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
-
-