Examples of MenuBar


Examples of com.vaadin.ui.MenuBar

        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

Examples of com.vaadin.ui.MenuBar

    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

Examples of com.vaadin.ui.MenuBar

        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

Examples of com.vaadin.ui.MenuBar

                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

Examples of com.vaadin.ui.MenuBar

    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

Examples of com.vaadin.ui.MenuBar

        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

Examples of com.vaadin.ui.MenuBar

    }

    @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

Examples of com.vaadin.ui.MenuBar

        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

Examples of com.vaadin.ui.MenuBar

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

Examples of com.vaadin.ui.MenuBar

public class MenuBarPrimaryStylenames extends TestBase {

    @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");
        submenu1.addItem("Item2", null);

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

        addComponent(mainMenu);

        addComponent(new Button("Change primary stylename",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        mainMenu.setPrimaryStyleName("my-other-menu");
                    }
                }));

    }
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.