public void onModuleLoad() { Resources.getInstance().initTitle = Lib.getTitle(); Resources.getInstance().conf = new Config(); Resources.getInstance().db = new DataBaseImpl( new CustomEventListener() { @Override public void customEventOccurred(CustomEvent evt) { Resources.getInstance().userInfo = ((DBObject) evt.getSource()).getDBObject("userinfo"); Resources.getInstance().userData = ((DBObject) evt.getSource()).getDBObject("userdata"); Resources.getInstance().dwidgets = new Dwidgets(); Resources.getInstance().historyWatcher = new HistoryWatcher(); Resources.getInstance().loader = new Loader(); Resources.getInstance().tmpls = new TmplsDB(); // this must be init after DataBaseImpl registerDwidgets(); Resources.getInstance().loader.load(); // Resources.getInstance().init(); } }); }
private void registerDwidgets() { Loader l = Resources.getInstance().loader; l.getDwidgetFactory() .register( "hmenu", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new HMenu(p); } }); l.getDwidgetFactory() .register( "content_hash", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new ContentHash(p); } }); l.getDwidgetFactory() .register( "content_hash_db", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new ContentHashDB(p); } }); l.getDwidgetFactory() .register( "article", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new Article(p); } }); l.getDwidgetFactory() .register( "auth", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new AuthLogPass(p); } }); l.getDwidgetFactory() .register( "hiddenauth", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new HiddenAuth(p); } }); l.getDwidgetFactory() .register( "vkauth", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new VkAuth(p); } }); l.getDwidgetFactory() .register( "authcombo", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new AuthCombo(p); } }); l.getDwidgetFactory() .register( "table_menu", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new TableMenu(p); } }); l.getDwidgetFactory() .register( "logout_on_hash", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new LogoutOnHash(p); } }); l.getDwidgetFactory() .register( "user_name", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new UserName(p); } }); l.getDwidgetFactory() .register( "change_password", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new ChangePassword(p); } }); l.getDwidgetFactory() .register( "hider", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new Hider(p); } }); l.getDwidgetFactory() .register( "profilesmall", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new ProfileSmall(p); } }); l.getDwidgetFactory() .register( "buttonhash", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new ButtonHash(p); } }); l.getDwidgetFactory() .register( "toptoolbar", new DwidgetCreator() { @Override public Dwidget getDwidget(SubPanel p) { return new TopToolbar(p); } }); /* * registering custom dwidgets */ if (dwidgets != null) { Iterator<String> i = dwidgets.keySet().iterator(); while (i.hasNext()) { String name = i.next(); l.getDwidgetFactory().register(name, dwidgets.get(name)); } } }