javax.swing

Interface UIDefaults.LazyValue

  • All Known Implementing Classes:
    UIDefaults.LazyInputMap, UIDefaults.ProxyLazyValue
    Enclosing class:
    UIDefaults

    public static interface UIDefaults.LazyValue
    This class enables one to store an entry in the defaults table that isn't constructed until the first time it's looked up with one of the getXXX(key) methods. Lazy values are useful for defaults that are expensive to construct or are seldom retrieved. The first time a LazyValue is retrieved its "real value" is computed by calling LazyValue.createValue() and the real value is used to replace the LazyValue in the UIDefaults table. Subsequent lookups for the same key return the real value. Here's an example of a LazyValue that constructs a Border:
      Object borderLazyValue = new UIDefaults.LazyValue() {
          public Object createValue(UIDefaults table) {
              return new BorderFactory.createLoweredBevelBorder();
          }
      };
    
      uiDefaultsTable.put("MyBorder", borderLazyValue);
     
    See Also:
    UIDefaults.get(java.lang.Object)
    • Method Detail

      • createValue

        Object createValue(UIDefaults table)
        Creates the actual value retrieved from the UIDefaults table. When an object that implements this interface is retrieved from the table, this method is used to create the real value, which is then stored in the table and returned to the calling method.
        Parameters:
        table - a UIDefaults table
        Returns:
        the created Object

Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/swing/uidefaults.lazyvalue.html

The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.

References

  1. View the html document Language of the document:fr Manuel PHP : https://docs.oracle.com

These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.

Contents Haut