Package com.vaadin.ui

Examples of com.vaadin.ui.Button$ClickEvent


                        + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"
                        + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?");
        gl.addComponent(combo);
        gl.addComponent(labelLong);

        Button b = new Button("Add label text", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                labelLong.setValue(labelLong.getValue() + "-12345");
            }
View Full Code Here


        table.setColumnExpandRatio(TestUtils.iso3166_PROPERTY_NAME, 1);
        table.setColumnWidth(TestUtils.iso3166_PROPERTY_SHORT, 70);

        addComponent(sizeLabel);

        addComponent(new Button("Show size of the table", new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                table.markAsDirtyRecursive();
                updateSize();
            }

        }));

        addComponent(new Button("Select the second row", new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                table.select("AL");
                updateSize();
            }
View Full Code Here

        Label logo = new Label("Va");
        logo.setSizeUndefined();
        logo.setPrimaryStyleName("valo-menu-logo");
        menu.addComponent(logo);

        Button b = new Button(
                "Reference <span class=\"valo-menu-badge\">3</span>");
        b.setIcon(FontAwesome.TH_LIST);
        b.setPrimaryStyleName("valo-menu-item");
        b.addStyleName("selected");
        b.setHtmlContentAllowed(true);
        menu.addComponent(b);

        b = new Button("API");
        b.setIcon(FontAwesome.BOOK);
        b.setPrimaryStyleName("valo-menu-item");
        menu.addComponent(b);

        b = new Button("Examples <span class=\"valo-menu-badge\">12</span>");
        b.setIcon(FontAwesome.TABLE);
        b.setPrimaryStyleName("valo-menu-item");
        b.setHtmlContentAllowed(true);
        menu.addComponent(b);

        return menu;
    }
View Full Code Here

        Table t = new Table("Table with 1000 item");
        t.addGeneratedColumn("Actions", new Table.ColumnGenerator() {
            @Override
            public Component generateCell(final Table source,
                    final Object itemId, final Object columnId) {
                Button tripFolderLink = new Button("Button" + itemId);
                tripFolderLink.addClickListener(new Button.ClickListener() {
                    @Override
                    public void buttonClick(final ClickEvent event) {
                        log.log("Button " + event.getButton().getCaption()
                                + " clicked");
                    }
                });
                tripFolderLink.setStyleName(Reindeer.BUTTON_SMALL);
                return tripFolderLink;
            }
        });

        for (int i = 0; i < 1000; i++) {
View Full Code Here

        layout.addComponent(p);

        GridLayout gl = new GridLayout(1, 4);
        gl.setMargin(true);
        gl.setCaption("Horizontal");
        Button b;

        b = new Button("Wide button");
        b.setWidth("500px");
        gl.addComponent(b);

        addButtons(gl);

        p.setContent(gl);

        /* VERTICAL */

        gl = new GridLayout(4, 1);
        gl.setMargin(true);
        gl.setCaption("Vertical");

        addButtons(gl);

        b = new Button("High button");
        b.setHeight("200px");
        gl.addComponent(b);

        p.setContent(gl);

    }
View Full Code Here

        AbstractOrderedLayout ol = new VerticalLayout();
        ol.setMargin(true);
        ol.setCaption("Horizontal");
        // ol.setWidth("100%");

        Button b;

        b = new Button("Wide button");
        b.setWidth("500px");
        ol.addComponent(b);

        addButtons(ol);
        p.setContent(ol);

        /* VERTICAL */

        ol = new HorizontalLayout();
        ol.setMargin(true);
        ol.setCaption("Vertical");

        addButtons(ol);
        b = new Button("High button");
        b.setHeight("200px");
        ol.addComponent(b);

        p.setContent(ol);

    }
View Full Code Here

        top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
        top.addStyleName("valo-menu-title");
        menu.addComponent(top);
        menu.addComponent(createThemeSelect());

        Button showMenu = new Button("Menu", new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                if (menu.getStyleName().contains("valo-menu-visible")) {
                    menu.removeStyleName("valo-menu-visible");
                } else {
                    menu.addStyleName("valo-menu-visible");
                }
            }
        });
        showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
        showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
        showMenu.addStyleName("valo-menu-toggle");
        showMenu.setIcon(FontAwesome.LIST);
        menu.addComponent(showMenu);

        Label title = new Label("<h3>Vaadin <strong>Valo Theme</strong></h3>",
                ContentMode.HTML);
        title.setSizeUndefined();
        top.addComponent(title);
        top.setExpandRatio(title, 1);

        MenuBar settings = new MenuBar();
        settings.addStyleName("user-menu");
        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);

        menuItemsLayout.setPrimaryStyleName("valo-menuitems");
        menu.addComponent(menuItemsLayout);

        Label label = null;
        int count = -1;
        for (final Entry<String, String> item : menuItems.entrySet()) {
            if (item.getKey().equals("labels")) {
                label = new Label("Components", ContentMode.HTML);
                label.setPrimaryStyleName("valo-menu-subtitle");
                label.addStyleName("h4");
                label.setSizeUndefined();
                menuItemsLayout.addComponent(label);
            }
            if (item.getKey().equals("panels")) {
                label.setValue(label.getValue()
                        + " <span class=\"valo-menu-badge\">" + count
                        + "</span>");
                count = 0;
                label = new Label("Containers", ContentMode.HTML);
                label.setPrimaryStyleName("valo-menu-subtitle");
                label.addStyleName("h4");
                label.setSizeUndefined();
                menuItemsLayout.addComponent(label);
            }
            if (item.getKey().equals("calendar")) {
                label.setValue(label.getValue()
                        + " <span class=\"valo-menu-badge\">" + count
                        + "</span>");
                count = 0;
                label = new Label("Other", ContentMode.HTML);
                label.setPrimaryStyleName("valo-menu-subtitle");
                label.addStyleName("h4");
                label.setSizeUndefined();
                menuItemsLayout.addComponent(label);
            }
            Button b = new Button(item.getValue(), new ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    navigator.navigateTo(item.getKey());
                }
            });
            if (count == 2) {
                b.setCaption(b.getCaption()
                        + " <span class=\"valo-menu-badge\">123</span>");
            }
            b.setHtmlContentAllowed(true);
            b.setPrimaryStyleName("valo-menu-item");
            b.setIcon(testIcon.get());
            menuItemsLayout.addComponent(b);
            count++;
        }
        label.setValue(label.getValue() + " <span class=\"valo-menu-badge\">"
                + count + "</span>");
View Full Code Here

        ol.addComponent(getButton(ol, Alignment.BOTTOM_RIGHT));

    }

    private Button getButton(Layout l, Alignment align) {
        Button b = new Button("Narrow Button - "
                + align.getHorizontalAlignment() + " - "
                + align.getVerticalAlignment());
        b.setWidth("100px");
        ((AlignmentHandler) l).setComponentAlignment(b, align);

        return b;

    }
View Full Code Here

        t.focus();
        t.setMultiSelect(true);

        getLayout().addComponent(t);
        getLayout().addComponent(
                new Button("Change elements and selection",
                        new ClickListener() {

                            @Override
                            public void buttonClick(ClickEvent event) {
View Full Code Here

        fixedSubWindow.center();
        getMainWindow().addWindow(draggableSubWindow);
        getMainWindow().addWindow(fixedSubWindow);

        Button b = new Button("Swap", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                boolean b = draggableSubWindow.isDraggable();
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Button$ClickEvent

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.