Examples of MenuItemSeparator


Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

            items.add(item);
        }

        if (!recentResourceIds.isEmpty() && !recentGroupIds.isEmpty()) {
            items.add(new MenuItemSeparator());
        }

        for (final Integer groupId : recentGroupIds) {
            ResourceGroupComposite groupComposite = favorites.getGroupComposite(groupId);
            if (null == groupComposite) {
View Full Code Here

Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

        // resource type name
        resourceContextMenu.addItem(new MenuItem(MSG.view_tree_common_contextMenu_type_name_label(resourceType
            .getName())));

        // separator
        resourceContextMenu.addItem(new MenuItemSeparator());

        // refresh node
        MenuItem refresh = new MenuItem(MSG.common_button_refresh());
        refresh.addClickHandler(new ClickHandler() {

            public void onClick(MenuItemClickEvent event) {
                contextMenuRefresh(treeGrid, node, false);
            }
        });
        resourceContextMenu.addItem(refresh);




        // separator
        resourceContextMenu.addItem(new MenuItemSeparator());

        // child resources
        MenuItem childResources = new MenuItem(MSG.view_tabs_common_child_resources());
        boolean childResourcesEnabled = resourceType.getChildResourceTypes() != null
            && !resourceType.getChildResourceTypes().isEmpty();
        childResources.setEnabled(childResourcesEnabled);
        if (childResourcesEnabled) {
            childResources.addClickHandler(new ClickHandler() {
                public void onClick(MenuItemClickEvent event) {
                    CoreGUI.goToView(LinkManager.getResourceTabLink(resource.getId(), "Inventory", "Children"));
                }
            });
        }
        resourceContextMenu.addItem(childResources);

        // plugin config
        MenuItem pluginConfiguration = new MenuItem(MSG.view_tabs_common_connectionSettings());
        boolean pluginConfigEnabled = resourceType.getPluginConfigurationDefinition() != null;
        pluginConfiguration.setEnabled(pluginConfigEnabled);
        if (pluginConfigEnabled) {
            pluginConfiguration.addClickHandler(new ClickHandler() {

                public void onClick(MenuItemClickEvent event) {
                    CoreGUI.goToView(LinkManager.getResourceTabLink(resource.getId(), "Inventory", "ConnectionSettings"));
                }
            });
        }
        resourceContextMenu.addItem(pluginConfiguration);

        // resource config
        MenuItem resourceConfiguration = new MenuItem(MSG.view_tree_common_contextMenu_resourceConfiguration());
        boolean resourceConfigEnabled = resourcePermission.isConfigureRead()
            && resourceType.getResourceConfigurationDefinition() != null;
        resourceConfiguration.setEnabled(resourceConfigEnabled);
        if (resourceConfigEnabled) {
            resourceConfiguration.addClickHandler(new ClickHandler() {

                public void onClick(MenuItemClickEvent event) {
                    CoreGUI.goToView(LinkManager.getResourceTabLink(resource.getId(), "Configuration", "Current"));
                }
            });
        }
        resourceContextMenu.addItem(resourceConfiguration);

        // separator
        resourceContextMenu.addItem(new MenuItemSeparator());

        // Operations Menu
        MenuItem operations = new MenuItem(MSG.common_title_operations());
        boolean operationsEnabled = (resourcePermission.isControl() && (resourceType.getOperationDefinitions() != null) && !resourceType
            .getOperationDefinitions().isEmpty());
        operations.setEnabled(operationsEnabled);
        if (operationsEnabled) {
            Menu opSubMenu = new Menu();

            //sort the display items alphabetically
            TreeSet<String> ordered = new TreeSet<String>();
            Map<String, OperationDefinition> definitionMap = new HashMap<String, OperationDefinition>();
            for (OperationDefinition o : resourceType.getOperationDefinitions()) {
                ordered.add(o.getDisplayName());
                definitionMap.put(o.getDisplayName(), o);
            }
            for (String displayName : ordered) {
                final OperationDefinition operationDefinition = definitionMap.get(displayName);

                MenuItem operationItem = new MenuItem(operationDefinition.getDisplayName());
                operationItem.addClickHandler(new ClickHandler() {

                    public void onClick(MenuItemClickEvent event) {
                        String viewPath = LinkManager.getResourceTabLink(resource.getId(),
                            ResourceDetailView.Tab.Operations.NAME, "Schedules") + "/0/" + operationDefinition.getId();
                        CoreGUI.goToView(viewPath);
                    }
                });
                opSubMenu.addItem(operationItem);
            }
            operations.setSubmenu(opSubMenu);
        }
        resourceContextMenu.addItem(operations);

        // this menu item will be the last one
        final OpenSupportCaseMenuItem openSupportCase = new OpenSupportCaseMenuItem(resourceComposite);

        // Create Child Menu and Manual Import Menu
        final Set<ResourceType> creatableChildTypes = getCreatableChildTypes(resourceType);
        final Set<ResourceType> importableChildTypes = getImportableChildTypes(resourceType);
        final boolean hasCreatableTypes = !creatableChildTypes.isEmpty();
        final boolean hasImportableTypes = !importableChildTypes.isEmpty();
        boolean canCreate = resourcePermission.isCreateChildResources();

        Integer[] singletonChildTypes = getSingletonChildTypes(resourceType);

        // To properly filter Create Child and Import menus we need existing singleton child resources. If the
        // user has created permission and the parent type has singleton child types and creatable or importable child
        // types, perform an async call to fetch the singleton children.
        if (canCreate && singletonChildTypes.length > 0 && (hasCreatableTypes || hasImportableTypes)) {

            ResourceCriteria criteria = new ResourceCriteria();
            criteria.addFilterParentResourceId(resource.getId());
            criteria.addFilterResourceTypeIds(singletonChildTypes);
            GWTServiceLookup.getResourceService().findResourcesByCriteria(criteria,
                new AsyncCallback<PageList<Resource>>() {

                    @Override
                    public void onSuccess(PageList<Resource> singletonChildren) {
                        if (hasCreatableTypes) {
                            Map<String, ResourceType> displayNameMap = getDisplayNames(creatableChildTypes);
                            addMenu(MSG.common_button_create_child(), true, singletonChildren, resource,
                                displayNameMap, true);
                        }

                        if (hasImportableTypes) {
                            Map<String, ResourceType> displayNameMap = getDisplayNames(importableChildTypes);
                            addMenu(MSG.common_button_import(), true, singletonChildren, resource, displayNameMap,
                                false);
                        }
                        if (openSupportCase.isToBeIncluded()) {
                            resourceContextMenu.addItem(new MenuItemSeparator());
                            resourceContextMenu.addItem(openSupportCase);
                        }
                        resourceContextMenu.showContextMenu();
                    }

                    @Override
                    public void onFailure(Throwable caught) {
                        Log.error("Error resources with parentId:" + resource.getId(), caught);
                        if (openSupportCase.isToBeIncluded()) {
                            resourceContextMenu.addItem(new MenuItemSeparator());
                            resourceContextMenu.addItem(openSupportCase);
                        }
                        resourceContextMenu.showContextMenu();
                    }
                });
        } else if (canCreate && singletonChildTypes.length == 0 && (hasCreatableTypes || hasImportableTypes)) {
            if (hasCreatableTypes) {
                Map<String, ResourceType> displayNameMap = getDisplayNames(creatableChildTypes);
                addMenu(MSG.common_button_create_child(), true, null, resource, displayNameMap, true);
            }

            if (hasImportableTypes) {
                Map<String, ResourceType> displayNameMap = getDisplayNames(importableChildTypes);
                addMenu(MSG.common_button_import(), true, null, resource, displayNameMap, false);
            }
            if (openSupportCase.isToBeIncluded()) {
                resourceContextMenu.addItem(new MenuItemSeparator());
                resourceContextMenu.addItem(openSupportCase);
            }
            resourceContextMenu.showContextMenu();

        } else {
            if (!canCreate && hasCreatableTypes) {
                addMenu(MSG.common_button_create_child(), false, null, null, null, true);
            }
            if (!canCreate && hasImportableTypes) {
                addMenu(MSG.common_button_import(), false, null, null, null, false);
            }
            if (openSupportCase.isToBeIncluded()) {
                resourceContextMenu.addItem(new MenuItemSeparator());
                resourceContextMenu.addItem(openSupportCase);
            }
            resourceContextMenu.showContextMenu();
        }
    }
View Full Code Here

Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

        ((QueryTabs) getTabSet()).removeAllTabs();
        view.getHistory().setHistoryCheckpoint();
      }
    });

    MenuItemSeparator separator = new MenuItemSeparator();
    menu.setItems(renameTab, copy, separator, closeTab, closeOtherTabs, closeAll);
    setContextMenu(menu);

  }
View Full Code Here

Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

                    managePerson(idItemSelected, SHOW);                   
                }
            };
            detailsItem.addClickHandler(aux_details);

            MenuItemSeparator separator = new MenuItemSeparator();
            //create an item for deleting a person selected
            MenuItem deleteItem = new MenuItem(constants.delete(), "cancel.png");
            com.smartgwt.client.widgets.menu.events.ClickHandler aux_delete_theme = new com.smartgwt.client.widgets.menu.events.ClickHandler() {
                @Override
                public void onClick(MenuItemClickEvent event) {
View Full Code Here

Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

                    //new ReleasesListPanel(idItemSelected, canvasPrincipal);
                }
            };
            releasesItem.addClickHandler(aux_releases);

            MenuItemSeparator separator = new MenuItemSeparator();
            //create an item for deleting a product selected
            MenuItem deleteItem = new MenuItem(constants.delete(), "cancel.png");
            com.smartgwt.client.widgets.menu.events.ClickHandler aux_delete_theme = new com.smartgwt.client.widgets.menu.events.ClickHandler() {
                @Override
                public void onClick(MenuItemClickEvent event) {
View Full Code Here

Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

                 createFormStory();
            }
        };
        saveAsItem.addClickHandler(auxStory);
         */
        MenuItemSeparator separator = new MenuItemSeparator();
        /*
        //item to copy the subtree selected
        MenuItem copyItem = new MenuItem(constants.copy(), "copiar.jpg");
        ClickHandler auxCopyTheme = new ClickHandler() {
            @Override
View Full Code Here

Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

                so.manageStory(idItemSelected, SHOW);
            }
        };
        viewItem.addClickHandler(auxView);

        MenuItemSeparator separator = new MenuItemSeparator();

        //item to modify the story selected
        MenuItem modifyItem = new MenuItem(constants.modify(), "configure.png");
        ClickHandler auxHandler = new ClickHandler() {
            @Override
View Full Code Here

Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

                tko.manageTask(idItemSelected, SHOW);
            }
        };
        saveItem.addClickHandler(auxview);

        MenuItemSeparator separator = new MenuItemSeparator();

        //create an item to modify a task
        MenuItem modifyItem = new MenuItem(constants.modify(), "configure.png");
        ClickHandler auxhandler = new ClickHandler() {
            @Override
View Full Code Here

Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

    this.markMenuButton.setBorder( "0px" );
    this.markMenuButton.setHeight( 20 );
    Menu markMenu = new Menu();
    markMenu.addItem( UIFactory.createMenuItem( ActionRegistry.MARK_AS_READ ) );
    markMenu.addItem( UIFactory.createMenuItem( ActionRegistry.MARK_AS_UNREAD ) );
    markMenu.addItem( new MenuItemSeparator() );
    markMenu.addItem( UIFactory.createMenuItem( ActionRegistry.MARK_AS_DELETED ) );
    markMenu.addItem( UIFactory.createMenuItem( ActionRegistry.MARK_AS_UNDELETED ) );
    this.markMenuButton.setMenu( markMenu );
    addMember( this.markMenuButton );
View Full Code Here

Examples of com.smartgwt.client.widgets.menu.MenuItemSeparator

                    po.manageProducts(idItemSelected, SHOW);
                }
            };
            detailsItem.addClickHandler(aux_details);

            MenuItemSeparator separator = new MenuItemSeparator();
            //create an item for deleting a product selected
            MenuItem deleteItem = new MenuItem(constants.delete(), "cancel.png");
            com.smartgwt.client.widgets.menu.events.ClickHandler aux_delete_theme = new com.smartgwt.client.widgets.menu.events.ClickHandler() {
                @Override
                public void onClick(MenuItemClickEvent event) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.