Search in sources :

Example 1 with IMenuItem

use of com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem in project openmeetings by apache.

the class VideoInfo method newDownloadMenuList.

private List<IMenuItem> newDownloadMenuList() {
    List<IMenuItem> list = new ArrayList<>();
    // mp4
    list.add(new MenuItem(EXTENSION_MP4, JQueryIcon.ARROWTHICKSTOP_1_S) {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isEnabled() {
            BaseFileItem r = rm.getObject();
            return r != null && r.exists(EXTENSION_MP4) && !r.isReadOnly();
        }

        @Override
        public void onClick(AjaxRequestTarget target) {
            download.initiate(target);
        }
    });
    return list;
}
Also used : BaseFileItem(org.apache.openmeetings.db.entity.file.BaseFileItem) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) IMenuItem(com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem) ArrayList(java.util.ArrayList) IMenuItem(com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem) MenuItem(com.googlecode.wicket.jquery.ui.widget.menu.MenuItem)

Example 2 with IMenuItem

use of com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem 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)

Example 3 with IMenuItem

use of com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem in project openmeetings by apache.

the class MainPanel method getMainMenu.

private List<IMenuItem> getMainMenu() {
    List<IMenuItem> mmenu = new ArrayList<>();
    {
        // Dashboard Menu Points
        List<IMenuItem> l = new ArrayList<>();
        l.add(getSubItem("290", "1450", MenuActions.dashboardModuleStartScreen, null));
        l.add(getSubItem("291", "1451", MenuActions.dashboardModuleCalendar, null));
        mmenu.add(new OmMenuItem(getString("124"), l));
    }
    {
        // Conference Menu Points
        List<IMenuItem> l = new ArrayList<>();
        l.add(getSubItem("777", "1506", MenuActions.conferenceModuleRoomList, MenuParams.publicTabButton));
        l.add(getSubItem("779", "1507", MenuActions.conferenceModuleRoomList, MenuParams.privateTabButton));
        if (cfgDao.getBool(CONFIG_MYROOMS_ENABLED, true)) {
            l.add(getSubItem("781", "1508", MenuActions.conferenceModuleRoomList, MenuParams.myTabButton));
        }
        List<Room> recent = roomDao.getRecent(getUserId());
        if (!recent.isEmpty()) {
            l.add(new OmMenuItem(DELIMITER, (String) null));
        }
        for (Room r : recent) {
            final Long roomId = r.getId();
            l.add(new OmMenuItem(r.getName(), r.getName()) {

                private static final long serialVersionUID = 1L;

                @Override
                public void onClick(AjaxRequestTarget target) {
                    RoomEnterBehavior.roomEnter((MainPage) getPage(), target, roomId);
                }
            });
        }
        mmenu.add(new OmMenuItem(getString("792"), l));
    }
    {
        // Recording Menu Points
        List<IMenuItem> l = new ArrayList<>();
        l.add(getSubItem("395", "1452", MenuActions.recordModule, null));
        mmenu.add(new OmMenuItem(getString("395"), l));
    }
    Set<Right> r = WebSession.getRights();
    boolean isAdmin = hasAdminLevel(r);
    if (isAdmin || hasGroupAdminLevel(r)) {
        // Administration Menu Points
        List<IMenuItem> l = new ArrayList<>();
        l.add(getSubItem("125", "1454", MenuActions.adminModuleUser, null));
        if (isAdmin) {
            l.add(getSubItem("597", "1455", MenuActions.adminModuleConnections, null));
        }
        l.add(getSubItem("126", "1456", MenuActions.adminModuleOrg, null));
        l.add(getSubItem("186", "1457", MenuActions.adminModuleRoom, null));
        if (isAdmin) {
            l.add(getSubItem("263", "1458", MenuActions.adminModuleConfiguration, null));
            l.add(getSubItem("348", "1459", MenuActions.adminModuleLanguages, null));
            l.add(getSubItem("1103", "1454", MenuActions.adminModuleLDAP, null));
            l.add(getSubItem("1571", "1572", MenuActions.adminModuleOAuth, null));
            l.add(getSubItem("367", "1461", MenuActions.adminModuleBackup, null));
            l.add(getSubItem("main.menu.admin.email", "main.menu.admin.email.desc", MenuActions.adminModuleEmail, null));
        }
        mmenu.add(new OmMenuItem(getString("6"), l));
    }
    return mmenu;
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) OmMenuItem(org.apache.openmeetings.web.common.menu.OmMenuItem) IMenuItem(com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem) ArrayList(java.util.ArrayList) Right(org.apache.openmeetings.db.entity.user.User.Right) List(java.util.List) ArrayList(java.util.ArrayList) Room(org.apache.openmeetings.db.entity.room.Room)

Aggregations

IMenuItem (com.googlecode.wicket.jquery.ui.widget.menu.IMenuItem)3 ArrayList (java.util.ArrayList)3 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)3 MenuItem (com.googlecode.wicket.jquery.ui.widget.menu.MenuItem)1 List (java.util.List)1 BaseFileItem (org.apache.openmeetings.db.entity.file.BaseFileItem)1 Room (org.apache.openmeetings.db.entity.room.Room)1 Right (org.apache.openmeetings.db.entity.user.User.Right)1 OmMenuItem (org.apache.openmeetings.web.common.menu.OmMenuItem)1 RoomMenuItem (org.apache.openmeetings.web.common.menu.RoomMenuItem)1