Package com.vaadin.ui

Examples of com.vaadin.ui.MenuBar$MenuItem


        // Clear initialization log messages
        log.clear();
    }

    private MenuBar createMainMenu() {
        menu = new MenuBar();
        menu.setId("menu");
        mainMenu = menu.addItem("Component", null);
        settingsMenu = menu.addItem("Settings", null);
        populateSettingsMenu(settingsMenu);
View Full Code Here


        options.add("2");
        options.add("3");
        ComboBox combo = new ComboBox(null, options);
        layout.addComponent(combo);

        MenuBar menubar = getMenubar();
        layout.addComponent(menubar);

        addComponent(layout);
    }
View Full Code Here

    protected Integer getTicketNumber() {
        return 14321;
    }

    private MenuBar getMenubar() {
        MenuBar menubar = new MenuBar();
        menubar.setAutoOpen(true);
        MenuItem item = menubar.addItem("auto-open", null);
        item.addItem("sub-item 1", new MenuBar.Command() {

            @Override
            public void menuSelected(MenuItem selectedItem) {
                Notification notification = new Notification("Test",
View Full Code Here

        getTooltipConfiguration().setOpenDelay(2000);

    }

    private Component buildMenu() {
        MenuBar menu = new MenuBar();
        MenuItem item = menu.addItem("Menu", null);

        item.addItem("Item 1", null).setDescription("TOOLTIP 1");
        item.addItem("Item 2", null).setDescription("TOOLTIP 2");
        item.addItem("Item 3", null).setDescription("TOOLTIP 3");
        item.addItem("Item 4", null).setDescription("TOOLTIP 4");
View Full Code Here

                getMainWindow().showNotification(selectedItem.getText());

            }
        };

        MenuBar root = new MenuBar();

        MenuItem submenu = root.addItem("Hello", null);
        submenu.addItem("World", c);

        root.addItem("World", c);
        addComponent(root);
    }
View Full Code Here

    private Log log;
    private MenuItem export;

    @Override
    protected void setup() {
        MenuBar mb = new MenuBar();
        file = mb.addItem("File", null);
        file.addItem("Open", this);
        file.addItem("Save", this);
        file.addItem("Save As..", this);
        file.addSeparator();
        export = file.addItem("Export..", null);
        export.addItem("As PDF...", this);
        file.addSeparator();
        file.addItem("Exit", this);
        edit = mb.addItem("Edit", null);
        edit.addItem("Copy", this);
        edit.addItem("Cut", this);
        edit.addItem("Paste", this);
        mb.addItem("Help", this);

        addComponent(mb);

        log = new Log(5);
        addComponent(log);
View Full Code Here

        LegacyWindow mainWindow = new LegacyWindow("MenuBar in SplitPanel",
                new HorizontalSplitPanel());
        VerticalLayout left = new VerticalLayout();
        mainWindow.addComponent(left);
        left.setSizeFull();
        MenuBar menu = new MenuBar();
        menu.setWidth("100%");
        menu.addItem("File", null);
        menu.addItem("Edit", null);
        menu.addItem("Help", null);
        left.addComponent(menu);
        Tree tree = new Tree();
        for (int i = 0; i < 10; i++) {
            tree.addItem("Node " + i);
        }
View Full Code Here

    }

    @Override
    protected void initializeComponents() {

        MenuBar m;
        m = createMenuBar("This is an undefined wide menubar with 3 items", 3);

        m.setWidth(null);
        addTestComponent(m);

        m = createMenuBar(
                "This is an undefined wide menubar with fixed 100px height (4 items)",
                4);
        m.setWidth(null);
        m.setHeight("100px");
        addTestComponent(m);

        m = createMenuBar("This is a 200px wide menubar with 10 items", 10);
        m.setWidth("200px");
        addTestComponent(m);

        m = createMenuBar("This is a 200px wide menubar with 2 items", 2);
        m.setWidth("200px");
        addTestComponent(m);

        m = createMenuBar("This is a 100% wide menubar with 3 items ", 3);
        m.setWidth("100%");
        addTestComponent(m);

        m = createMenuBar("This is a 100% wide menubar with 40 items ", 40);
        m.setWidth("100%");
        addTestComponent(m);

        m = createMenuBar(
                "This is a 100% wide menubar with fixed 65px height (5 items). ",
                5);
        m.setWidth("100%");
        m.setHeight("65px");

        addTestComponent(m);

    }
View Full Code Here

        addTestComponent(m);

    }

    private MenuBar createMenuBar(String text, int items) {
        MenuBar m = new MenuBar();
        m.setCaption(text);

        for (int i = 1; i <= items; i++) {
            MenuItem mi = m.addItem("Item " + i, null);
            for (int j = 1; j <= items; j++) {
                mi.addItem("Sub menu " + i + "/" + j, null);
            }
        }
View Full Code Here

public class HiddenAndDisabledMenus extends TestBase {

    @Override
    protected void setup() {
        MenuBar mb = new MenuBar();
        mb.addItem("Item 1", null);
        mb.addItem("Item 2 - hidden", null).setVisible(false);
        MenuItem submenu = mb.addItem("Item 3 - sub menu", null);
        mb.addItem("Item 4 - hidden", null).setVisible(false);
        submenu.addItem("Sub item 1 - disabled", null).setEnabled(false);
        submenu.addItem("Sub item 2 - enabled", null);
        submenu.addItem("Sub item 3 - visible", null);
        submenu.addItem("Sub item 4 - hidden", null).setVisible(false);
View Full Code Here

TOP

Related Classes of com.vaadin.ui.MenuBar$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.