Class UIDefaultsLookup

java.lang.Object
com.jidesoft.plaf.UIDefaultsLookup

public class UIDefaultsLookup extends Object
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 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

      public static void put(UIDefaults table, String key, Object value)
    • get

      public static Object get(Object key)
    • get

      public static Object get(Object key, Locale l)
    • getFont

      public static Font getFont(Object key)
      If the value of key is a Font return it, otherwise return null.
      Parameters:
      key - the desired key
      Returns:
      if the value for key is a Font, return the Font object; otherwise return null
    • getFont

      public static Font getFont(Object key, Locale l)
      If the value of key for the given Locale is a Font return it, otherwise return null.
      Parameters:
      key - the desired key
      l - the desired locale
      Returns:
      if the value for key and Locale is a Font, return the Font object; otherwise return null
      Since:
      1.9.5.04
    • getColor

      public static Color getColor(Object key)
      If the value of key is a Color return it, otherwise return null.
      Parameters:
      key - the desired key
      Returns:
      if the value for key is a Color, return the Color object; otherwise return null
    • getColor

      public static Color getColor(Object key, Locale l)
      If the value of key for the given Locale is a Color return it, otherwise return null.
      Parameters:
      key - the desired key
      l - the desired locale
      Returns:
      if the value for key and Locale is a Color, return the Color object; otherwise return null
      Since:
      1.9.5.04
    • getIcon

      public static Icon getIcon(Object key)
      If the value of key is an Icon return it, otherwise return null.
      Parameters:
      key - the desired key
      Returns:
      if the value for key is an Icon, return the Icon object; otherwise return null
    • getIcon

      public static Icon getIcon(Object key, Locale l)
      If the value of key for the given Locale is an Icon return it, otherwise return null.
      Parameters:
      key - the desired key
      l - the desired locale
      Returns:
      if the value for key and Locale is an Icon, return the Icon object; otherwise return null
      Since:
      1.9.5.04
    • getBorder

      public static Border getBorder(Object key)
      If the value of key is a Border return it, otherwise return null.
      Parameters:
      key - the desired key
      Returns:
      if the value for key is a Border, return the Border object; otherwise return null
    • getBorder

      public static Border getBorder(Object key, Locale l)
      If the value of key for the given Locale is a Border return it, otherwise return null.
      Parameters:
      key - the desired key
      l - the desired locale
      Returns:
      if the value for key and Locale is a Border, return the Border object; otherwise return null
      Since:
      1.9.5.04
    • getString

      public static String getString(Object key)
      If the value of key is a String return it, otherwise return null.
      Parameters:
      key - the desired key
      Returns:
      if the value for key is a String, return the String object; otherwise return null
    • getString

      public static String getString(Object key, Locale l)
      If the value of key for the given Locale is a String return it, otherwise return null.
      Parameters:
      key - the desired key
      l - the desired Locale
      Returns:
      if the value for key for the given Locale is a String, return the String object; otherwise return null
      Since:
      1.9.5.04
    • getInt

      public static int getInt(Object key)
      If the value of key is an Integer return its integer value, otherwise return 0.
      Parameters:
      key - the desired key
      Returns:
      if the value for key is an Integer, return its value, otherwise return 0
    • getInt

      public static int getInt(Object key, Locale l)
      If the value of key for the given Locale is an Integer return its integer value, otherwise return 0.
      Parameters:
      key - the desired key
      l - the desired locale
      Returns:
      if the value for key and Locale is an Integer, return its value, otherwise return 0
      Since:
      1.9.5.04
    • getBoolean

      public static boolean getBoolean(Object key)
      If the value of key is boolean, return the boolean value, otherwise return false.
      Parameters:
      key - an Object 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

      public static boolean getBoolean(Object key, boolean defaultValue)
      If the value of key is boolean, return the boolean value, otherwise return false.
      Parameters:
      key - an Object specifying the key for the desired boolean value
      defaultValue - the default value if the key is missing
      Returns:
      if the value of key is boolean, return the boolean value, otherwise return false.
    • getBoolean

      public static boolean getBoolean(Object key, Locale l)
      If the value of key for the given Locale is boolean, return the boolean value, otherwise return false.
      Parameters:
      key - an Object specifying the key for the desired boolean value
      l - the desired locale
      Returns:
      if the value for key and Locale is boolean, return the boolean value, otherwise return false.
      Since:
      1.9.5.04
    • getInsets

      public static Insets getInsets(Object key)
      If the value of key is an Insets return it, otherwise return null.
      Parameters:
      key - the desired key
      Returns:
      if the value for key is an Insets, return the Insets object; otherwise return null
    • getInsets

      public static Insets getInsets(Object key, Locale l)
      If the value of key for the given Locale is an Insets return it, otherwise return null.
      Parameters:
      key - the desired key
      l - the desired locale
      Returns:
      if the value for key and Locale is an Insets, return the Insets object; otherwise return null
      Since:
      1.9.5.04
    • getDimension

      public static Dimension getDimension(Object key)
      If the value of key is a Dimension return it, otherwise return null.
      Parameters:
      key - the desired key
      Returns:
      if the value for key is a Dimension, return the Dimension object; otherwise return null
    • getDimension

      public static Dimension getDimension(Object key, Locale l)
      If the value of key for the given Locale is a Dimension return it, otherwise return null.
      Parameters:
      key - the desired key
      l - the desired locale
      Returns:
      if the value for key and Locale is a Dimension, return the Dimension object; otherwise return null
      Since:
      1.9.5.04