Package com.vaadin.ui

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


                "<span style=\"color: red; font-weight: bold;\">HTML</span> button");
        b.setHtmlContentAllowed(true);
        addComponent(b);

        final Button swapButton = new Button("<i>Swap button<i>");
        swapButton.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                swapButton.setHtmlContentAllowed(!swapButton
                        .isHtmlContentAllowed());
View Full Code Here


            Button button1 = new Button("b1 (CTRL-C)");
            Button button2 = new Button("b2 (CTRL-V)");

            button1.addListener(this);
            button2.addListener(this);

            button1.setClickShortcut(KeyCode.C, ModifierKey.CTRL);
            button2.setClickShortcut(KeyCode.V, ModifierKey.CTRL);

            layout.addComponent(button1);
View Full Code Here

        addComponent(tf1);

        Button b = new Button(
                "Set BAR to underlaying property (should propagate to UI)");
        b.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                op.setValue("BAR");
            }
        });
View Full Code Here

        final Panel p = createMultilevelPanel(5, (Panel) null);

        Button b = new Button("Toggle parent level size");
        lo.addComponent(b);
        b.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                if (p.getWidth() > 0) {
                    p.setSizeUndefined();
                } else {
View Full Code Here

    @Override
    protected void setup() {
        Button openWindowButton = new Button("Open sub-window");
        openWindowButton.setId("opensub");
        openWindowButton.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                Window sub = createClosableSubWindow("Sub-window");
                getMainWindow().addWindow(sub);
            }
View Full Code Here

        final Window window = new Window(title, layout);
        window.setSizeUndefined();
        window.setClosable(true);

        Button closeButton = new Button("Close");
        closeButton.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                event.getButton().findAncestor(Window.class).close();
            }
        });
View Full Code Here

            }
        });
        layout.addComponent(closeButton);

        Button removeButton = new Button("Remove from parent");
        removeButton.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                window.close();
            }
        });
View Full Code Here

    }

    private Button createButton(final String filename) {
        Button b = new Button("Download " + filename);
        b.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                FileResource res = new FileResource(new File(VaadinService
                        .getCurrent().getBaseDirectory() + "/" + filename));
View Full Code Here

        final Form form = createForm(required, failValidator);
        form.setFooter(null);
        part.addComponent(form);

        Button validate = new Button("Validate fields");
        validate.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                try {
                    form.validate();
                } catch (InvalidValueException e) {
View Full Code Here

        // same as basic DateField
        // form.addField("Popup Date", new PopupDateField("Date"));
        Button setDateButton = new Button("Set date");
        form.getLayout().addComponent(setDateButton);
        // form.addField("Set Date", setDateButton);
        setDateButton.addListener(new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                form.getField("Date").setValue(new Date(0));
            }
        });
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.