src/share/classes/javax/swing/plaf/basic/LazyActionMap.java

Print this page

        

*** 54,64 **** * @param loaderClass Class object that gets loadActionMap invoked * on. * @param defaultsKey Key to use to defaults table to check for * existing map and what resulting Map will be registered on. */ ! static void installLazyActionMap(JComponent c, Class loaderClass, String defaultsKey) { ActionMap map = (ActionMap)UIManager.get(defaultsKey); if (map == null) { map = new LazyActionMap(loaderClass); UIManager.getLookAndFeelDefaults().put(defaultsKey, map); --- 54,64 ---- * @param loaderClass Class object that gets loadActionMap invoked * on. * @param defaultsKey Key to use to defaults table to check for * existing map and what resulting Map will be registered on. */ ! static void installLazyActionMap(JComponent c, Class<?> loaderClass, String defaultsKey) { ActionMap map = (ActionMap)UIManager.get(defaultsKey); if (map == null) { map = new LazyActionMap(loaderClass); UIManager.getLookAndFeelDefaults().put(defaultsKey, map);
*** 77,98 **** * @param loaderClass Class object that gets loadActionMap invoked * on. * @param defaultsKey Key to use to defaults table to check for * existing map and what resulting Map will be registered on. */ ! static ActionMap getActionMap(Class loaderClass, String defaultsKey) { ActionMap map = (ActionMap)UIManager.get(defaultsKey); if (map == null) { map = new LazyActionMap(loaderClass); UIManager.getLookAndFeelDefaults().put(defaultsKey, map); } return map; } ! private LazyActionMap(Class loader) { _loader = loader; } public void put(Action action) { put(action.getValue(Action.NAME), action); --- 77,98 ---- * @param loaderClass Class object that gets loadActionMap invoked * on. * @param defaultsKey Key to use to defaults table to check for * existing map and what resulting Map will be registered on. */ ! static ActionMap getActionMap(Class<?> loaderClass, String defaultsKey) { ActionMap map = (ActionMap)UIManager.get(defaultsKey); if (map == null) { map = new LazyActionMap(loaderClass); UIManager.getLookAndFeelDefaults().put(defaultsKey, map); } return map; } ! private LazyActionMap(Class<?> loader) { _loader = loader; } public void put(Action action) { put(action.getValue(Action.NAME), action);
*** 144,154 **** _loader = null; Class<?> klass = (Class<?>)loader; try { Method method = klass.getDeclaredMethod("loadActionMap", ! new Class[] { LazyActionMap.class }); method.invoke(klass, new Object[] { this }); } catch (NoSuchMethodException nsme) { assert false : "LazyActionMap unable to load actions " + klass; } catch (IllegalAccessException iae) { --- 144,154 ---- _loader = null; Class<?> klass = (Class<?>)loader; try { Method method = klass.getDeclaredMethod("loadActionMap", ! new Class<?>[] { LazyActionMap.class }); method.invoke(klass, new Object[] { this }); } catch (NoSuchMethodException nsme) { assert false : "LazyActionMap unable to load actions " + klass; } catch (IllegalAccessException iae) {