Package com.vaadin.ui.MenuBar

Examples of com.vaadin.ui.MenuBar.MenuItem.addItem()


        StringGenerator sg = new StringGenerator();
        MenuItem settingsItem = settings.addItem(
                sg.nextString(true) + " " + sg.nextString(true)
                        + sg.nextString(false), new ThemeResource(
                        "../tests-valo/img/profile-pic-300px.jpg"), null);
        settingsItem.addItem("Edit Profile", null);
        settingsItem.addItem("Preferences", null);
        settingsItem.addSeparator();
        settingsItem.addItem("Sign Out", null);
        menu.addComponent(settings);
View Full Code Here


        MenuItem settingsItem = settings.addItem(
                sg.nextString(true) + " " + sg.nextString(true)
                        + sg.nextString(false), new ThemeResource(
                        "../tests-valo/img/profile-pic-300px.jpg"), null);
        settingsItem.addItem("Edit Profile", null);
        settingsItem.addItem("Preferences", null);
        settingsItem.addSeparator();
        settingsItem.addItem("Sign Out", null);
        menu.addComponent(settings);

        menuItemsLayout.setPrimaryStyleName("valo-menuitems");
View Full Code Here

                        + sg.nextString(false), new ThemeResource(
                        "../tests-valo/img/profile-pic-300px.jpg"), null);
        settingsItem.addItem("Edit Profile", null);
        settingsItem.addItem("Preferences", null);
        settingsItem.addSeparator();
        settingsItem.addItem("Sign Out", null);
        menu.addComponent(settings);

        menuItemsLayout.setPrimaryStyleName("valo-menuitems");
        menu.addComponent(menuItemsLayout);
View Full Code Here

        menu.setIcon(icon);
        menu.setCaption("MenuBar");
        MenuItem mi = menu.addItem("File", icon, null);
        MenuItem smi = mi.addItem("Item", icon, null);
        smi = mi.addItem("Item", icon, null);
        smi = smi.addItem("Item", icon, null);
        gl.addComponent(menu);

        // Tree, caption + item + subitem + action icons
        Tree tree = new Tree("Tree");
        tree.addItem("Root");
View Full Code Here

                    getTestComponents().get(0).getParent()
                            .setWidth(sizeOptions.get(name));
                    log("Parent layout width set to " + name);
                }
            });
            layoutHeight.addItem(name, new MenuBar.Command() {
                @Override
                public void menuSelected(MenuItem selectedItem) {
                    getTestComponents().get(0).getParent()
                            .setHeight(sizeOptions.get(name));
                    log("Parent layout height set to " + name);
View Full Code Here

    protected <DATATYPE> void createClickAction(String caption,
            String category, final Command<T, DATATYPE> command,
            DATATYPE value, Object data) {
        MenuItem categoryItem = getCategoryMenuItem(category);
        categoryItem.addItem(caption, menuClickCommand(command, value, data));
    }

    private MenuItem getCategoryMenuItem(String category) {
        if (category == null) {
            return getCategoryMenuItem("Misc");
View Full Code Here

        MenuItem mainItem = categoryItem.addItem(caption, null);

        for (String option : options.keySet()) {
            MenuBar.Command cmd = menuClickCommand(command,
                    options.get(option), data);
            mainItem.addItem(option, cmd);
        }
    }

    protected <TYPE> void createMultiToggleAction(
            String caption,
View Full Code Here

        }

        MenuItem first = itemList.get(0);

        for (int i = 0; i < 5; i++) {
            first.addItem(new String("Submenu item" + i), null, new Command() {

                @Override
                public void menuSelected(MenuItem selected) {
                    main.showNotification("Action " + selected.getText());
                }
View Full Code Here

        }

        MenuItem firstSubItem1 = first.getChildren().get(1);

        for (int i = 0; i < 3; i++) {
            firstSubItem1.addItem(new String("Subsubmenu item" + i), null,
                    new Command() {

                        @Override
                        public void menuSelected(MenuItem selected) {
                            main.showNotification("Action "
View Full Code Here

                    });
        }
        MenuItem firstSubItem2 = first.getChildren().get(3);

        for (int i = 0; i < 3; i++) {
            firstSubItem2.addItem(new String("Subsubmenu item" + i), null,
                    new Command() {

                        @Override
                        public void menuSelected(MenuItem selected) {
                            main.showNotification("Action "
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.