Search in sources :

Example 1 with OmRedirectTimerBehavior

use of org.apache.openmeetings.web.room.OmRedirectTimerBehavior in project openmeetings by apache.

the class RoomMenuPanel method onInitialize.

@Override
protected void onInitialize() {
    exitMenuItem = new RoomMenuItem(getString("308"), getString("309"), "room menu exit") {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            exit(target);
        }
    };
    filesMenu = new RoomMenuItem(getString("245"), null, false);
    actionsSubMenu.init();
    pollsSubMenu.init();
    add((menuPanel = new MenuPanel("menu", getMenu())).setVisible(isVisible()));
    add(askBtn.add(AttributeModifier.replace(ATTR_TITLE, getString("84"))));
    Label demo = new Label("demo", Model.of(""));
    Room r = room.getRoom();
    add(demo.setVisible(r.isDemoRoom() && r.getDemoTime() != null && room.getRoom().getDemoTime().intValue() > 0));
    if (demo.isVisible()) {
        demo.add(new OmRedirectTimerBehavior(room.getRoom().getDemoTime().intValue(), "637") {

            private static final long serialVersionUID = 1L;

            @Override
            protected void onTimer(int remain) {
                getComponent().add(AttributeModifier.replace(ATTR_TITLE, getText("639", remain)));
            }

            @Override
            protected void onFinish(AjaxRequestTarget target) {
                exit(target);
            }
        });
    }
    super.onInitialize();
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) MenuPanel(org.apache.openmeetings.web.common.menu.MenuPanel) OmRedirectTimerBehavior(org.apache.openmeetings.web.room.OmRedirectTimerBehavior) Label(org.apache.wicket.markup.html.basic.Label) RoomMenuItem(org.apache.openmeetings.web.common.menu.RoomMenuItem) Room(org.apache.openmeetings.db.entity.room.Room)

Aggregations

Room (org.apache.openmeetings.db.entity.room.Room)1 MenuPanel (org.apache.openmeetings.web.common.menu.MenuPanel)1 RoomMenuItem (org.apache.openmeetings.web.common.menu.RoomMenuItem)1 OmRedirectTimerBehavior (org.apache.openmeetings.web.room.OmRedirectTimerBehavior)1 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)1 Label (org.apache.wicket.markup.html.basic.Label)1