Package com.vaadin.ui

Examples of com.vaadin.ui.Button.addListener()


        l.setSizeFull();
        w.setContent(l);

        Button b = new Button("Button 1");
        b.setSizeFull();
        b.addListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                w.setHeight("200px");
            }
View Full Code Here


        VerticalLayout layout = new VerticalLayout();

        layout.addComponent(new Label("Please click the button"));

        final Button button = new Button("Click me");
        button.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                Object value = getValue();
                boolean newValue = true;
                if ((value instanceof Boolean) && ((Boolean) value)) {
View Full Code Here

        table.setMultiSelect(true);
        table.setImmediate(true);
        addComponent(table);

        Button showButton = new Button("Show selection");
        showButton.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(Button.ClickEvent clickEvent) {
                Collection<?> selection = (Collection<?>) table.getValue();
                log.log("Selection: " + selection);
            }
View Full Code Here

            }
        });
        addComponent(showButton);

        Button removeButton = new Button("Remove selection");
        removeButton.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(Button.ClickEvent clickEvent) {
                Collection<?> selection = (Collection<?>) table.getValue();
                for (Object selected : selection) {
                    container.removeItem(selected);
View Full Code Here

        final Label valueLabel = new Label("");

        final Button button = new Button("Validate");
        addComponent(button);
        button.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                checkbox.setComponentError(null);
                requiredCheckbox.setComponentError(null);
                try {
View Full Code Here

        imageResource.setCacheTime(0);
        embedded.setSource(imageResource);

        // The button requests repainting the embedded.
        Button button = new Button("refr");
        button.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                embedded.markAsDirty();
            }
        });
View Full Code Here

                embedded.markAsDirty();
            }
        });
        addComponent(button);
        button = new Button("refr name");
        button.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                ((StreamResource) embedded.getSource()).setFilename(new Date()
                        .getTime() + ".png");
                embedded.markAsDirty();
View Full Code Here

                embedded.markAsDirty();
            }
        });
        addComponent(button);
        button = new Button("200x200");
        button.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                embedded.setWidth("200px");
                embedded.setHeight("200px");
            }
View Full Code Here

                embedded.setHeight("200px");
            }
        });
        addComponent(button);
        button = new Button("undef");
        button.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                embedded.setSizeUndefined();
            }
        });
View Full Code Here

        timeField.setReadOnly(true);

        addComponent(timeField);

        Button b = new Button("Switch read-only");
        b.addListener(new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                timeField.setReadOnly(!timeField.isReadOnly());
            }
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.