Package com.vaadin.ui

Examples of com.vaadin.ui.Button$ClickEvent


            documentLayout.addComponent(e);
        }
        components.add(documentLayout);

        final VerticalLayout buttonLayout = new VerticalLayout();
        final Button button = new Button("Button");
        button.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                Notification.show("Button clicked");
            }
        });
View Full Code Here


                    new MethodProperty<Boolean>(tx, visibleProps[i]));
            b.setImmediate(true);
            mainWin.addComponent(b);
        }

        mainWin.addComponent(new Button("Validate integer",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(
                            com.vaadin.ui.Button.ClickEvent event) {
                        mainWin.showNotification("The field is "
View Full Code Here

        w.setContent(l);

        l.setHeight("504px");

        for (int i = 1; i <= 5; i++) {
            Button b = new Button("Button " + i
                    + " should be 100px or 101px high");
            b.setHeight("100%");
            l.addComponent(b);
        }
    }
View Full Code Here

                Boolean value = multiselect.getValue();
                table.setMultiSelect(value == null ? false : value);
            }
        });
        addComponent(multiselect);
        Button addItemsButton = new Button("Add table items",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        if (!table.getItemIds().isEmpty()) {
                            Notification
                                    .show("Only possible when the table is empty");
                            return;
                        } else {
                            for (int i = 0; i < 5; i++) {
                                table.addItem(
                                        new Object[] { Integer.valueOf(i) },
                                        Integer.valueOf(i));
                            }
                        }
                    }
                });
        addItemsButton.setId("addItemsButton");
        addComponent(addItemsButton);

        Button showValueButton = new Button("Show value",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        log.log("Table selection: " + table.getValue());
                    }
                });
        showValueButton.setId("showValueButton");
        addComponent(showValueButton);

        Button removeItemsFromTableButton = new Button(
                "Remove items from table", new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        table.removeAllItems();
                    }
                });
        removeItemsFromTableButton.setId("removeItemsFromTableButton");
        addComponent(removeItemsFromTableButton);

        Button removeItemsFromContainerButton = new Button(
                "Remove items from container", new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        table.getContainerDataSource().removeAllItems();
                    }
                });
        removeItemsFromContainerButton.setId("removeItemsFromContainerButton");
        addComponent(removeItemsFromContainerButton);
        Button removeItemsFromContainerAndSanitizeButton = new Button(
                "Remove items from container and sanitize",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        table.getContainerDataSource().removeAllItems();
                        table.sanitizeSelection();
                    }
                });
        removeItemsFromContainerAndSanitizeButton
                .setId("removeItemsFromContainerAndSanitizeButton");
        addComponent(removeItemsFromContainerAndSanitizeButton);
        Button removeSelectedFromTableButton = new Button(
                "Remove selected item from table", new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        Object selection = table.getValue();
                        if (selection == null) {
                            Notification.show("There is no selection");
                            return;
                        } else {
                            table.removeItem(selection);
                        }
                    }
                });
        removeSelectedFromTableButton.setId("removeSelectedFromTableButton");
        addComponent(removeSelectedFromTableButton);
        Button removeSelectedFromContainer = new Button(
                "Remove selected item from container",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        Object selection = table.getValue();
                        if (selection == null) {
                            Notification.show("There is no selection");
                            return;
                        } else {
                            table.getContainerDataSource()
                                    .removeItem(selection);
                        }
                    }
                });
        removeSelectedFromContainer.setId("removeSelectedFromContainer");
        addComponent(removeSelectedFromContainer);
    }
View Full Code Here

                null);

        for (int i = 0; i < 5; i++) {
            Item item = container.addItem("item " + i);
            item.getItemProperty(TEXT_PROPERTY_ID).setValue("Text " + i);
            Button b = new Button("Button " + i);
            if (description) {
                b.setDescription("Button " + i + " description");
            }
            item.getItemProperty(WIDGET_PROPERTY_ID).setValue(b);
        }

        return container;
View Full Code Here

        Panel p = new Panel("Test wrapper for gridlayout margin/spacing", pl);

        gl = new GridLayout(3, 3);
        gl.setMargin(true);
        for (int i = 0; i < 3 * 3; i++) {
            gl.addComponent(new Button("test"));
        }
        pl.addComponent(gl);
        pl.addComponent(new Label("| next component"));

        Button b = new Button("next margin state");
        b.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                nextMarginState();
            }

        });

        state = new Label();
        state.setCaption("Current margin state:");
        main.addComponent(state);
        main.addComponent(b);

        Button b2 = new Button("next spacing state");
        b2.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                nextSpacingState();
            }

View Full Code Here

    private Button button;
    private WrappedConnectorTracker wrappedTracker = null;

    @Override
    protected void setup(VaadinRequest request) {
        button = new Button("Blink a table", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                blinkTable();
            }
        });
View Full Code Here

        Item i = t.addItem("1");
        i.getItemProperty(P1).setValue(new TextField("abc"));
        i.getItemProperty(P2).setValue(new Label("label"));
        Item i2 = t.addItem("2");
        i2.getItemProperty(P1).setValue(new Button("def"));
        i2.getItemProperty(P2).setValue(new DateField());

        layout.addComponent(t);
    }
View Full Code Here

        gl.addComponent(new Label("After form"));

        w.addComponent(form);

        w.addComponent(new Button("new item", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));

            }

        }));
        w.addComponent(new Button("new bigger item",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        form.setItemDataSource(new BeanItem<MyBean>(
                                new MyBiggerBean()));

                    }

                }));
        w.addComponent(new Button("new grid layout",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        form.setLayout(new GridLayout());

                    }

                }));
        w.addComponent(new Button("new form layout",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        form.setLayout(new FormLayout());
View Full Code Here

        table.setWidth("200px");
        table.setColumnWidth(COL1, 100);

        addComponent(table);
        addComponent(new Button("Increase width", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                table.setColumnWidth(COL1, table.getColumnWidth(COL1) + 20);
                table.markAsDirty();
            }
        }));
        addComponent(new Button("Decrease width", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                table.setColumnWidth(COL1, table.getColumnWidth(COL1) - 40);
                table.markAsDirty();
            }
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.