Package com.adito.core

Examples of com.adito.core.MenuItem


  }

  void initTableItemActions() throws Exception {
    MenuTree tree = NavigationManager.getMenuTree(TableItemActionMenuTree.MENU_TABLE_ITEM_ACTION_MENU_TREE);
    // Web Forwards
        tree.addMenuItem(null, new MenuItem("webForward", WebForwardPlugin.MESSAGE_RESOURCES_KEY, null, 100, false, SessionInfo.ALL_CONTEXTS));
        tree.addMenuItem("webForward", new AddToFavoritesAction(WebForwardPlugin.MESSAGE_RESOURCES_KEY));
        tree.addMenuItem("webForward", new RemoveFromFavoritesAction(WebForwardPlugin.MESSAGE_RESOURCES_KEY));
        tree.addMenuItem("webForward", new RemoveResourceAction(SessionInfo.ALL_CONTEXTS, WebForwardPlugin.MESSAGE_RESOURCES_KEY));
        tree.addMenuItem("webForward", new EditResourceAction(SessionInfo.ALL_CONTEXTS, WebForwardPlugin.MESSAGE_RESOURCES_KEY));
        tree.addMenuItem("webForward", new CloneResourceAction(SessionInfo.MANAGEMENT_CONSOLE_CONTEXT, WebForwardPlugin.MESSAGE_RESOURCES_KEY));
View Full Code Here


  }

  void initMainMenu() throws Exception {
    MenuTree tree = NavigationManager.getMenuTree(CoreMenuTree.MENU_ITEM_MENU_TREE);

    tree.addMenuItem("resources", new MenuItem("userWebForwards",
            "webForwards",
            "/showUserWebForwards.do",
            50,
            true,
            null,
            SessionInfo.USER_CONSOLE_CONTEXT,
                        WEBFORWARD_RESOURCE_TYPE,
                        new Permission[] { PolicyConstants.PERM_PERSONAL_CREATE_EDIT_AND_DELETE },
                        WEBFORWARD_RESOURCE_TYPE));

    tree.addMenuItem("globalResources", new MenuItem("managementWebForwards",
            "webForwards",
            "/showWebForwards.do",
            100,
            true,
            null,
View Full Code Here

    ContextHolder.getContext().setResourceAlias("/server/taglibs/webforwards", "/WEB-INF/webforwards.tld");
  }

  void initPageTasks() throws Exception {
    MenuTree tree = NavigationManager.getMenuTree(PageTaskMenuTree.PAGE_TASK_MENU_TREE);
    tree.addMenuItem(null, new MenuItem("showWebForwards", null, null, 100, false, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT));
        tree.addMenuItem("showWebForwards", new MenuItem("createWebForward",
                        WebForwardPlugin.MESSAGE_RESOURCES_KEY,
                        "/webForwardTypeSelection.do",
                        100,
                        true,
                        "_self",
                        SessionInfo.MANAGEMENT_CONSOLE_CONTEXT,
                        WEBFORWARD_RESOURCE_TYPE,
                        new Permission[] { PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN },
                        null));
        tree.addMenuItem("showWebForwards", new MenuItem("replacements",
                        WebForwardPlugin.MESSAGE_RESOURCES_KEY,
                        "/showReplacements.do",
                        600,
                        true,
                        null,
                        SessionInfo.MANAGEMENT_CONSOLE_CONTEXT,
                        PolicyConstants.REPLACEMENTS_RESOURCE_TYPE,
                        new Permission[] { PolicyConstants.PERM_CHANGE },
                        null));
       
        // userWebForwards
        tree.addMenuItem(null, new MenuItem("showUserWebForwards", null, null, 100, false, SessionInfo.USER_CONSOLE_CONTEXT));
        tree.addMenuItem("showUserWebForwards", new MenuItem("createPersonalWebForward",
                        WebForwardPlugin.MESSAGE_RESOURCES_KEY,
                        "/webForwardTypeSelection.do",
                        100,
                        true,
                        "_self",
View Full Code Here

            throw new PluginException("Failed to register resource type.", e);
        }

        // Add the new items to the main menu
        MenuTree tree = NavigationManager.getMenuTree(CoreMenuTree.MENU_ITEM_MENU_TREE);
        tree.addMenuItem("resources", new MenuItem("userSamples", "sample", "/showUserSamples.do", 50, true, null,
                        SessionInfo.USER_CONSOLE_CONTEXT, null, null, Sample.SAMPLE_RESOURCE_TYPE));
        tree.addMenuItem("globalResources", new MenuItem("managementSamples", "sample", "/showSamples.do", 50, true, null,
                        SessionInfo.MANAGEMENT_CONSOLE_CONTEXT, Sample.SAMPLE_RESOURCE_TYPE, new Permission[] {
                                        PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN, PolicyConstants.PERM_EDIT_AND_ASSIGN,
                                        PolicyConstants.PERM_DELETE }, Sample.SAMPLE_RESOURCE_TYPE));

        // Add the new page tasks
        MenuTree pageTasks = NavigationManager.getMenuTree(PageTaskMenuTree.PAGE_TASK_MENU_TREE);
        pageTasks.addMenuItem(null, new MenuItem("showSamples", null, null, 100, false, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT));
        pageTasks.addMenuItem("showSamples", new MenuItem("createSample", "sample", "/sampleDefaultDetails.do", 100, true, "_self",
                        SessionInfo.MANAGEMENT_CONSOLE_CONTEXT, Sample.SAMPLE_RESOURCE_TYPE,
                        new Permission[] { PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN }));

        // This demonstrates listening for events. In this case we will look for
        // 'sample created' events and display a message on the console
View Full Code Here

     *
     * @param parentId parent to add menu item to (or <code>null</code> for top level items)
     * @param menuItem menuItem object
     */
    public void addMenuItem(String parentId, MenuItem menuItem) {
        MenuItem parent = parentId == null ? null : (MenuItem) menuMap.get(parentId);
        if (parent != null) {
            menuItem.setParent(parent);
            parent.addChild(menuItem);
        } else {
            menus.add(menuItem);
        }
        menuMap.put(menuItem.getId(), menuItem);
    }
View Full Code Here

     *
     * @param parentId parent to remove menu item from (or <code>null</code> for top level items)
     * @param itemId menu item ID
     */
    public void removeMenuItem(String parentId, String itemId) {
        MenuItem parent = parentId == null ? null : (MenuItem) menuMap.get(parentId);
        MenuItem item = getMenuItem(itemId);
        if (parent != null) {
            parent.removeChild(parent.getChild(itemId));
        }
        else {
            if(item != null) {
View Full Code Here

     * @return available root menus
     */
    public List rebuildMenus(MenuItem menuItem, int checkNavigationContext, SessionInfo info, HttpServletRequest request, String referer) {
        List availableMenus = new ArrayList();
        for (Iterator i = menuItem == null ? menus.iterator() : menuItem.availableChildren(checkNavigationContext, info, request).iterator(); i.hasNext();) {
            MenuItem it = (MenuItem) i.next();
            if (it.isAvailable(checkNavigationContext, info, request)) {
                AvailableMenuItem nm = createAvailableMenuItem(it, null, request, referer, checkNavigationContext, info);
                if (it.isLeaf() || (!it.isLeaf() && !nm.isEmpty())) {
                    availableMenus.add(nm);
                }
            }
        }
        Collections.sort(availableMenus);
View Full Code Here

  void initTableItemActions() throws Exception {
    MenuTree tree = NavigationManager.getMenuTree(TableItemActionMenuTree.MENU_TABLE_ITEM_ACTION_MENU_TREE);
    tree.addMenuItem("favorites", new FavoriteOpenWebFolderAction());

    // Network Places
    tree.addMenuItem(null, new MenuItem("networkPlace",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            null,
            100,
            false,
            SessionInfo.ALL_CONTEXTS));
View Full Code Here

  }

  void initMainMenu() throws Exception {
    MenuTree tree = NavigationManager.getMenuTree(CoreMenuTree.MENU_ITEM_MENU_TREE);

    tree.addMenuItem("resources", new MenuItem("userNetworkPlaces",
                NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "/showUserNetworkPlaces.do",
            500,
            true,
            null,
            SessionInfo.USER_CONSOLE_CONTEXT,
                        NETWORK_PLACE_RESOURCE_TYPE,
                        new Permission[] { PolicyConstants.PERM_PERSONAL_CREATE_EDIT_AND_DELETE },
                        NETWORK_PLACE_RESOURCE_TYPE));
    tree.addMenuItem("globalResources", new MenuItem("networkPlaces",
                NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "/showNetworkPlaces.do",
            200,
            true,
            null,
View Full Code Here

  void initPageTasks() throws Exception {
    MenuTree tree = NavigationManager.getMenuTree(PageTaskMenuTree.PAGE_TASK_MENU_TREE);

    // Networking showNetworkPlaces
    tree.addMenuItem(null, new MenuItem("showNetworkPlaces", null, null, 100, false, SessionInfo.MANAGEMENT_CONSOLE_CONTEXT));
    tree.addMenuItem("showNetworkPlaces", new MenuItem("createNetworkPlace",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "/defaultNetworkPlaceDetails.do",
            100,
            true,
            "_self",
            SessionInfo.MANAGEMENT_CONSOLE_CONTEXT,
            NETWORK_PLACE_RESOURCE_TYPE,
            new Permission[] { PolicyConstants.PERM_CREATE_EDIT_AND_ASSIGN }));

        // Networking userNetworkPlaces
    tree.addMenuItem(null, new MenuItem("showUserNetworkPlaces", null, null, 100, false, SessionInfo.USER_CONSOLE_CONTEXT));
    tree.addMenuItem("showUserNetworkPlaces", new MenuItem("createPersonalNetworkPlace",
              NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
              "/defaultNetworkPlaceDetails.do",
              100,
              true,
              "_self",
              SessionInfo.USER_CONSOLE_CONTEXT,
              NETWORK_PLACE_RESOURCE_TYPE,
                  new Permission[] { PolicyConstants.PERM_PERSONAL_CREATE_EDIT_AND_DELETE }));

    // Networking fileSystem
    tree.addMenuItem(null, new MenuItem("fileSystem", null, null, 100, false, SessionInfo.ALL_CONTEXTS));
    tree.addMenuItem("fileSystem", new WriteRequiredFileSystemPageTask("createFolder",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "javascript: setActionTarget('showMkDir'); document.forms[0].submit();",
            100,
            true,
            "_self",
            SessionInfo.ALL_CONTEXTS));
    tree.addMenuItem("fileSystem", new DeleteRequiredFileSystemPageTask("deleteSelected",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "javascript: setActionTarget('deleteSelected'); document.forms[0].submit();",
            100,
            true,
            "_self",
            SessionInfo.ALL_CONTEXTS));
    tree.addMenuItem("fileSystem", new MenuItem("copySelected",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "javascript: setActionTarget('copy'); document.forms[0].submit();",
            100,
            true,
            "_self",
            SessionInfo.ALL_CONTEXTS));
    tree.addMenuItem("fileSystem", new DeleteRequiredFileSystemPageTask("cutSelected",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "javascript: setActionTarget('cut'); document.forms[0].submit();",
            100,
            true,
            "_self",
            SessionInfo.ALL_CONTEXTS));
    tree.addMenuItem("fileSystem", new WriteRequiredFileSystemPageTask("paste",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "javascript: setActionTarget('confirmPaste'); document.forms[0].submit();",
            100,
            true,
            "_self",
            SessionInfo.ALL_CONTEXTS));
    tree.addMenuItem("fileSystem", new MenuItem("zipSelected",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "javascript: setActionTarget('zip'); document.forms[0].submit();",
            100,
            true,
            "_self",
            SessionInfo.ALL_CONTEXTS));
    tree.addMenuItem("fileSystem", new MenuItem("home",
            NetworkPlacePlugin.MESSAGE_RESOURCES_KEY,
            "javascript: setActionTarget('home'); document.forms[0].submit();",
            100,
            true,
            "_self",
View Full Code Here

TOP

Related Classes of com.adito.core.MenuItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.