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 Object
static Object
static boolean
getBoolean
(Object key) If the value ofkey
is boolean, return the boolean value, otherwise return false.static boolean
getBoolean
(Object key, boolean defaultValue) If the value ofkey
is boolean, return the boolean value, otherwise return false.static boolean
getBoolean
(Object key, Locale l) If the value ofkey
for the givenLocale
is boolean, return the boolean value, otherwise return false.static Border
If the value ofkey
is aBorder
return it, otherwise returnnull
.static Border
If the value ofkey
for the givenLocale
is aBorder
return it, otherwise returnnull
.static Color
If the value ofkey
is aColor
return it, otherwise returnnull
.static Color
If the value ofkey
for the givenLocale
is aColor
return it, otherwise returnnull
.static Dimension
getDimension
(Object key) If the value ofkey
is aDimension
return it, otherwise returnnull
.static Dimension
getDimension
(Object key, Locale l) If the value ofkey
for the givenLocale
is aDimension
return it, otherwise returnnull
.static Font
If the value ofkey
is aFont
return it, otherwise returnnull
.static Font
If the value ofkey
for the givenLocale
is aFont
return it, otherwise returnnull
.static Icon
If the value ofkey
is anIcon
return it, otherwise returnnull
.static Icon
If the value ofkey
for the givenLocale
is anIcon
return it, otherwise returnnull
.static Insets
If the value ofkey
is anInsets
return it, otherwise returnnull
.static Insets
If the value ofkey
for the givenLocale
is anInsets
return it, otherwise returnnull
.static int
If the value ofkey
is anInteger
return its integer value, otherwise return 0.static int
If the value ofkey
for the givenLocale
is anInteger
return its integer value, otherwise return 0.static String
If the value ofkey
is aString
return it, otherwise returnnull
.static String
If the value ofkey
for the givenLocale
is aString
return it, otherwise returnnull
.static void
put
(UIDefaults table, String key, Object value) static void
setDebug
(boolean debug) Sets the debug mode.static void
setTrace
(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 ofkey
is aFont
return it, otherwise returnnull
.- Parameters:
key
- the desired key- Returns:
- if the value for
key
is aFont
, return theFont
object; otherwise returnnull
-
getFont
If the value ofkey
for the givenLocale
is aFont
return it, otherwise returnnull
.- Parameters:
key
- the desired keyl
- the desired locale- Returns:
- if the value for
key
andLocale
is aFont
, return theFont
object; otherwise returnnull
- Since:
- 1.9.5.04
-
getColor
If the value ofkey
is aColor
return it, otherwise returnnull
.- Parameters:
key
- the desired key- Returns:
- if the value for
key
is aColor
, return theColor
object; otherwise returnnull
-
getColor
If the value ofkey
for the givenLocale
is aColor
return it, otherwise returnnull
.- Parameters:
key
- the desired keyl
- the desired locale- Returns:
- if the value for
key
andLocale
is aColor
, return theColor
object; otherwise returnnull
- Since:
- 1.9.5.04
-
getIcon
If the value ofkey
is anIcon
return it, otherwise returnnull
.- Parameters:
key
- the desired key- Returns:
- if the value for
key
is anIcon
, return theIcon
object; otherwise returnnull
-
getIcon
If the value ofkey
for the givenLocale
is anIcon
return it, otherwise returnnull
.- Parameters:
key
- the desired keyl
- the desired locale- Returns:
- if the value for
key
andLocale
is anIcon
, return theIcon
object; otherwise returnnull
- Since:
- 1.9.5.04
-
getBorder
If the value ofkey
is aBorder
return it, otherwise returnnull
.- Parameters:
key
- the desired key- Returns:
- if the value for
key
is aBorder
, return theBorder
object; otherwise returnnull
-
getBorder
If the value ofkey
for the givenLocale
is aBorder
return it, otherwise returnnull
.- Parameters:
key
- the desired keyl
- the desired locale- Returns:
- if the value for
key
andLocale
is aBorder
, return theBorder
object; otherwise returnnull
- Since:
- 1.9.5.04
-
getString
If the value ofkey
is aString
return it, otherwise returnnull
.- Parameters:
key
- the desired key- Returns:
- if the value for
key
is aString
, return theString
object; otherwise returnnull
-
getString
If the value ofkey
for the givenLocale
is aString
return it, otherwise returnnull
.- Parameters:
key
- the desired keyl
- the desiredLocale
- Returns:
- if the value for
key
for the givenLocale
is aString
, return theString
object; otherwise returnnull
- Since:
- 1.9.5.04
-
getInt
If the value ofkey
is anInteger
return its integer value, otherwise return 0.- Parameters:
key
- the desired key- Returns:
- if the value for
key
is anInteger
, return its value, otherwise return 0
-
getInt
If the value ofkey
for the givenLocale
is anInteger
return its integer value, otherwise return 0.- Parameters:
key
- the desired keyl
- the desired locale- Returns:
- if the value for
key
andLocale
is anInteger
, return its value, otherwise return 0 - Since:
- 1.9.5.04
-
getBoolean
If the value ofkey
is boolean, return the boolean value, otherwise return false.- Parameters:
key
- anObject
specifying the key for the desired boolean value- Returns:
- if the value of
key
is boolean, return the boolean value, otherwise return false. - Since:
- 1.9.5.04
-
getBoolean
If the value ofkey
is boolean, return the boolean value, otherwise return false.- Parameters:
key
- anObject
specifying the key for the desired boolean valuedefaultValue
- the default value if the key is missing- Returns:
- if the value of
key
is boolean, return the boolean value, otherwise return false.
-
getBoolean
If the value ofkey
for the givenLocale
is boolean, return the boolean value, otherwise return false.- Parameters:
key
- anObject
specifying the key for the desired boolean valuel
- the desired locale- Returns:
- if the value for
key
andLocale
is boolean, return the boolean value, otherwise return false. - Since:
- 1.9.5.04
-
getInsets
If the value ofkey
is anInsets
return it, otherwise returnnull
.- Parameters:
key
- the desired key- Returns:
- if the value for
key
is anInsets
, return theInsets
object; otherwise returnnull
-
getInsets
If the value ofkey
for the givenLocale
is anInsets
return it, otherwise returnnull
.- Parameters:
key
- the desired keyl
- the desired locale- Returns:
- if the value for
key
andLocale
is anInsets
, return theInsets
object; otherwise returnnull
- Since:
- 1.9.5.04
-
getDimension
If the value ofkey
is aDimension
return it, otherwise returnnull
.- Parameters:
key
- the desired key- Returns:
- if the value for
key
is aDimension
, return theDimension
object; otherwise returnnull
-
getDimension
If the value ofkey
for the givenLocale
is aDimension
return it, otherwise returnnull
.- Parameters:
key
- the desired keyl
- the desired locale- Returns:
- if the value for
key
andLocale
is aDimension
, return theDimension
object; otherwise returnnull
- Since:
- 1.9.5.04
-