Search in sources :

Example 1 with RoomMenuItem

use of org.apache.openmeetings.web.common.menu.RoomMenuItem 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)

Example 2 with RoomMenuItem

use of org.apache.openmeetings.web.common.menu.RoomMenuItem in project openmeetings by apache.

the class ActionsSubMenu method init.

public void init() {
    actionsMenu = new RoomMenuItem(mp.getString("635"), null, false);
    inviteMenuItem = new RoomMenuItem(mp.getString("213"), mp.getString("1489"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            invite.updateModel(target);
            invite.open(target);
        }
    };
    shareMenuItem = new RoomMenuItem(mp.getString("239"), mp.getString("1480"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            shareBtn.onClick(target);
        }
    };
    applyModerMenuItem = new RoomMenuItem(mp.getString("784"), mp.getString("1481"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            room.requestRight(Room.Right.moderator, target);
        }
    };
    applyWbMenuItem = new RoomMenuItem(mp.getString("785"), mp.getString("1492"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            room.requestRight(Room.Right.whiteBoard, target);
        }
    };
    applyAvMenuItem = new RoomMenuItem(mp.getString("786"), mp.getString("1482"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            room.requestRight(Room.Right.video, target);
        }
    };
    sipDialerMenuItem = new RoomMenuItem(mp.getString("1447"), mp.getString("1488"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            sipDialer.open(target);
        }
    };
    downloadPngMenuItem = new RoomMenuItem(mp.getString("download.png"), mp.getString("download.png")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            download(target, EXTENSION_PNG);
        }
    };
    downloadJpgMenuItem = new RoomMenuItem(mp.getString("download.jpg"), mp.getString("download.jpg")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            download(target, EXTENSION_JPG);
        }
    };
    downloadPdfMenuItem = new RoomMenuItem(mp.getString("download.pdf"), mp.getString("download.pdf")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            download(target, EXTENSION_PDF);
        }
    };
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) RoomMenuItem(org.apache.openmeetings.web.common.menu.RoomMenuItem)

Example 3 with RoomMenuItem

use of org.apache.openmeetings.web.common.menu.RoomMenuItem in project openmeetings by apache.

the class PollsSubMenu method init.

public void init() {
    pollsMenu = new RoomMenuItem(mp.getString("menu.polls"), null, false);
    pollQuickMenuItem = new RoomMenuItem(mp.getString("menu.polls.quick.title"), mp.getString("menu.polls.quick.descr"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            qpollManager.start(room.getClient());
        }
    };
    pollCreateMenuItem = new RoomMenuItem(mp.getString("24"), mp.getString("1483"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            createPoll.updateModel(target);
            createPoll.open(target);
        }
    };
    pollVoteMenuItem = new RoomMenuItem(mp.getString("32"), mp.getString("1485"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            RoomPoll rp = pollDao.getByRoom(room.getRoom().getId());
            if (rp != null) {
                vote.updateModel(target, rp);
                vote.open(target);
            }
        }
    };
    pollResultMenuItem = new RoomMenuItem(mp.getString("37"), mp.getString("1484"), false) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            pollResults.updateModel(target, room.getClient().hasRight(Room.Right.moderator));
            pollResults.open(target);
        }
    };
    mp.add(quickPollAction);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) RoomMenuItem(org.apache.openmeetings.web.common.menu.RoomMenuItem) RoomPoll(org.apache.openmeetings.db.entity.room.RoomPoll)

Example 4 with RoomMenuItem

use of org.apache.openmeetings.web.common.menu.RoomMenuItem in project openmeetings by apache.

the class RoomMenuPanel method getMenu.

private List<IMenuItem> getMenu() {
    List<IMenuItem> menu = new ArrayList<>();
    exitMenuItem.setEnabled(false);
    menu.add(exitMenuItem.setTop(true));
    filesMenu.getItems().add(new RoomMenuItem(getString("15"), getString("1479")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onClick(AjaxRequestTarget target) {
            room.getSidebar().showUpload(target);
        }
    });
    menu.add(filesMenu.setTop(true));
    if (actionsSubMenu.isVisible()) {
        menu.add(actionsSubMenu.getMenu());
    }
    if (pollsSubMenu.isVisible()) {
        menu.add(pollsSubMenu.getMenu());
    }
    return menu;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IMenuItem(com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem) ArrayList(java.util.ArrayList) RoomMenuItem(org.apache.openmeetings.web.common.menu.RoomMenuItem)

Aggregations

RoomMenuItem (org.apache.openmeetings.web.common.menu.RoomMenuItem)4 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)4 IMenuItem (com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem)1 ArrayList (java.util.ArrayList)1 Room (org.apache.openmeetings.db.entity.room.Room)1 RoomPoll (org.apache.openmeetings.db.entity.room.RoomPoll)1 MenuPanel (org.apache.openmeetings.web.common.menu.MenuPanel)1 OmRedirectTimerBehavior (org.apache.openmeetings.web.room.OmRedirectTimerBehavior)1 Label (org.apache.wicket.markup.html.basic.Label)1