/** * Create a new instance of ExtensionController. This is a singleton class. Access the only * existing instance by using {@link #getInstance()}. */ private ExtensionController() { map = new HashMap<Class<AbstractExtension<?>>, AbstractExtensionWrapper>(); list = new ArrayList<AbstractExtensionWrapper>(); JDController.getInstance() .addControlListener( new ControlListener() { public void controlEvent(ControlEvent event) { if (event.getEventID() == ControlEvent.CONTROL_INIT_COMPLETE) { JDController.getInstance().removeControlListener(this); for (AbstractExtensionWrapper plg : list) { if (plg._getExtension() != null && plg._getExtension().getGUI() != null) { plg._getExtension().getGUI().restore(); } } } } }); cacheFile = Application.getResource("tmp/extensioncache/cache.json"); cache = JSonStorage.restoreFrom( cacheFile, true, null, new TypeRef<HashMap<String, AbstractExtensionWrapper>>() {}, new HashMap<String, AbstractExtensionWrapper>()); }
@Override public void execute() { JDController.getInstance() .addControlListener( new ControlListener() { public void controlEvent(ControlEvent event) { if (event.getID() == 34 && event.getParameter() instanceof Property) ((Property) event.getParameter()).setProperty("value", "2009"); } }); }