Package com.vaadin.ui

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


    @Override
    protected void setup() {
        final MenuBar mainMenu = new MenuBar();
        mainMenu.setPrimaryStyleName("my-menu-bar");

        MenuItem submenu1 = mainMenu.addItem("Submenu1", null);
        submenu1.setStyleName("normal icon-white icon-headphones");

        MenuItem item1 = submenu1.addItem("Item1", null);
        item1.setCheckable(true);
        item1.setStyleName("my-menu-item");
View Full Code Here


        MenuItem item1 = submenu1.addItem("Item1", null);
        item1.setCheckable(true);
        item1.setStyleName("my-menu-item");
        submenu1.addItem("Item2", null);

        MenuItem submenu2 = mainMenu.addItem("Submenu2", null);
        MenuItem menu1 = submenu2.addItem("Menu1", null);
        menu1.addItem("Item11", null);

        addComponent(mainMenu);
View Full Code Here

    }

    @Override
    protected void initializeComponents() {
        MenuBar m = new MenuBar();
        MenuItem submenu = m.addItem("Item <u>1</u>", getIcon(), null);
        MenuItem subsubmenu = submenu.addItem("<b>Bold</b> item", null);
        subsubmenu.addItem("<i><u>I</u>talic</i> item", getIcon(), null);
        submenu.addItem(
                "<span style='font-size: 30px'>Big</span> <span style='font-size: 8px'>disabled</span> item",
                null).setEnabled(false);
View Full Code Here

        subsubmenu.addItem("<i><u>I</u>talic</i> item", getIcon(), null);
        submenu.addItem(
                "<span style='font-size: 30px'>Big</span> <span style='font-size: 8px'>disabled</span> item",
                null).setEnabled(false);

        m.addItem("<span style='font-size: 30px'>Big</span> item", null);

        addTestComponent(m);
    }

    private Resource getIcon() {
View Full Code Here

    /*
     * Returns a menu bar with three levels of nesting but no icons.
     */
    private MenuBar createFirstMenuBar() {
        MenuBar menuBar = new MenuBar();
        MenuItem file = menuBar.addItem("File", null);
        file.addItem("Open", selectionCommand);
        file.addItem("Save", selectionCommand);
        file.addItem("Save As..", selectionCommand);
        file.addSeparator();
        MenuItem export = file.addItem("Export..", null);
View Full Code Here

        export.addItem("As PDF...", selectionCommand);
        export.addItem("As Doc...", selectionCommand);
        file.addSeparator();
        file.addItem("Exit", selectionCommand);

        MenuItem edit = menuBar.addItem("Edit", null);
        edit.addItem("Copy", selectionCommand);
        edit.addItem("Cut", selectionCommand);
        edit.addItem("Paste", selectionCommand);

        menuBar.addItem("Help", selectionCommand);
View Full Code Here

        MenuItem edit = menuBar.addItem("Edit", null);
        edit.addItem("Copy", selectionCommand);
        edit.addItem("Cut", selectionCommand);
        edit.addItem("Paste", selectionCommand);

        menuBar.addItem("Help", selectionCommand);
        return menuBar;
    }

    /*
     * Returns a menu bar containing items with icons. The last menu item is
View Full Code Here

     */
    private MenuBar createSecondMenuBar() {
        MenuBar menuBar = new MenuBar();
        int n = itemNames.length;
        for (int i = 0; i < n - 1; i++) {
            menuBar.addItem(itemNames[i], itemIcons[i], selectionCommand);
        }
        MenuItem last = menuBar.addItem(itemNames[n - 1], itemIcons[n - 1],
                null);
        for (int i = 0; i < nestedItemnames.length; i++) {
            last.addItem(nestedItemnames[i], nestedItemIcons[i],
View Full Code Here

        MenuBar menuBar = new MenuBar();
        int n = itemNames.length;
        for (int i = 0; i < n - 1; i++) {
            menuBar.addItem(itemNames[i], itemIcons[i], selectionCommand);
        }
        MenuItem last = menuBar.addItem(itemNames[n - 1], itemIcons[n - 1],
                null);
        for (int i = 0; i < nestedItemnames.length; i++) {
            last.addItem(nestedItemnames[i], nestedItemIcons[i],
                    selectionCommand);
        }
View Full Code Here

        main.setSizeFull();
        setMainWindow(main);
        main.getContent().setSizeFull();

        MenuBar menuBar = new MenuBar();
        menuBar.addItem("Test", new ThemeResource("icons/16/calendar.png"),
                null);
        menuBar.addItem("ABC", new ThemeResource("icons/16/document.png"), null);
        menuBar.addItem("123", new ThemeResource("icons/16/help.png"), null);

        main.addComponent(menuBar);
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.