Class LazyActionMap

  • All Implemented Interfaces:
    java.io.Serializable, javax.swing.plaf.UIResource

    public class LazyActionMap
    extends javax.swing.plaf.ActionMapUIResource
    An ActionMap that populates its contents as necessary. The contents are populated by invoking the loadActionMap method on the passed in Object.
    Version:
    1.6, 11/17/05
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.Object _loader
      Object to invoke loadActionMap on.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private LazyActionMap​(java.lang.Class loader)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object[] allKeys()  
      void clear()  
      javax.swing.Action get​(java.lang.Object key)  
      (package private) static javax.swing.ActionMap getActionMap​(java.lang.Class loaderClass, java.lang.String defaultsKey)
      Returns an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.
      static void installLazyActionMap​(javax.swing.JComponent c, java.lang.Class loaderClass, java.lang.String defaultsKey)
      Installs an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.
      java.lang.Object[] keys()  
      private void loadIfNecessary()  
      void put​(java.lang.Object key, javax.swing.Action action)  
      void put​(javax.swing.Action action)  
      void remove​(java.lang.Object key)  
      void setParent​(javax.swing.ActionMap map)  
      int size()  
      • Methods inherited from class javax.swing.ActionMap

        getParent
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _loader

        private transient java.lang.Object _loader
        Object to invoke loadActionMap on. This may be a Class object.
    • Constructor Detail

      • LazyActionMap

        private LazyActionMap​(java.lang.Class loader)
    • Method Detail

      • installLazyActionMap

        public static void installLazyActionMap​(javax.swing.JComponent c,
                                                java.lang.Class loaderClass,
                                                java.lang.String defaultsKey)
        Installs an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.

        This should be used if the ActionMap can be shared.

        Parameters:
        c - JComponent to install the ActionMap on.
        loaderClass - Class object that gets loadActionMap invoked on.
        defaultsKey - Key to use to defaults table to check for existing map and what resulting Map will be registered on.
      • getActionMap

        static javax.swing.ActionMap getActionMap​(java.lang.Class loaderClass,
                                                  java.lang.String defaultsKey)
        Returns an ActionMap that will be populated by invoking the loadActionMap method on the specified Class when necessary.

        This should be used if the ActionMap can be shared.

        Parameters:
        c - JComponent to install the ActionMap on.
        loaderClass - Class object that gets loadActionMap invoked on.
        defaultsKey - Key to use to defaults table to check for existing map and what resulting Map will be registered on.
      • put

        public void put​(javax.swing.Action action)
      • put

        public void put​(java.lang.Object key,
                        javax.swing.Action action)
        Overrides:
        put in class javax.swing.ActionMap
      • get

        public javax.swing.Action get​(java.lang.Object key)
        Overrides:
        get in class javax.swing.ActionMap
      • remove

        public void remove​(java.lang.Object key)
        Overrides:
        remove in class javax.swing.ActionMap
      • clear

        public void clear()
        Overrides:
        clear in class javax.swing.ActionMap
      • keys

        public java.lang.Object[] keys()
        Overrides:
        keys in class javax.swing.ActionMap
      • size

        public int size()
        Overrides:
        size in class javax.swing.ActionMap
      • allKeys

        public java.lang.Object[] allKeys()
        Overrides:
        allKeys in class javax.swing.ActionMap
      • setParent

        public void setParent​(javax.swing.ActionMap map)
        Overrides:
        setParent in class javax.swing.ActionMap
      • loadIfNecessary

        private void loadIfNecessary()