Package com.vaadin.ui

Examples of com.vaadin.ui.Button$ClickListener


        tx.setImmediate(true);
        tx.setMaxLength(10);

        final Label l = new Label();

        Button b = new Button("Check value");
        b.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                l.setValue("Length: " + tx.getValue().toString().length()
                        + " Content: " + tx.getValue());
            }
        });

        mainWin.addComponent(tx);
        mainWin.addComponent(b);

        final TextArea tx2 = new TextArea(
                "Textfield with maxlenght 10, multirow ");
        mainWin.addComponent(tx2);
        tx2.setImmediate(true);
        tx2.setRows(5);
        tx2.setMaxLength(10);

        Button b2 = new Button("Check value");
        b2.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                l.setValue("Length: " + tx2.getValue().toString().length()
                        + " Content: " + tx2.getValue());
View Full Code Here


        table.setPageLength(10);

        VerticalLayout buttonLayout = new VerticalLayout();
        buttonLayout.setWidth(null);

        Button b = new Button("Set items to 2", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                table.setContainerDataSource(container2);
            }
        });
        buttonLayout.addComponent(b);

        b = new Button("Set items to 50", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                table.setContainerDataSource(container50);
            }
View Full Code Here

        String layoutName = "Ticket1775";
        final CustomLayout layout = new CustomLayout(layoutName);

        main.addComponent(layout);

        Button button2 = new Button("Populate content");
        main.addComponent(button2);

        final Button button = new Button("Change content");
        main.addComponent(button);

        button2.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Label mainComponent = new Label("Main");
                Label header = new Label("Header");
                final Label anotherComponent = new Label("another");
                layout.addComponent(mainComponent, "body");
                layout.addComponent(header, "loginUser");
                button.addListener(new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        layout.addComponent(anotherComponent, "body");
                        layout.removeComponent("loginUser");
                    }
View Full Code Here

        pageLengthLabel = new Label("");
        updatePageLengthLabel();
        addComponent(pageLengthLabel);

        Button updateButton = new Button("Update pageLength",
                new ClickListener() {

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

            }
        });

        addComponent(table);
        addComponent(selectionLabel);
        addComponent(new Button("Deselect item 2", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                table.unselect(Integer.valueOf(2));
            }
        }));
View Full Code Here

        String s = "<b>Blah</b><input type=\"text\" value='Lorem\" ipsum'/>";
        try {
            cl1 = new CustomLayout(new ByteArrayInputStream(s.getBytes()));
            layout.addComponent(cl1);

            layout.addComponent(new Button("Disable/Enable",
                    new ClickListener() {

                        @Override
                        public void buttonClick(ClickEvent event) {
                            boolean e = cl1.isEnabled();
View Full Code Here

            tf.setComponentError(new UserError("dsfjklsdf"));
            testContainer.addComponent(tf);

            testContainer.addComponent(new DateField("DateField" + i));

            testContainer.addComponent(new Button("Button" + i));

            TabSheet ts = new TabSheet();

            for (int j = 0; j < INITIAL_COMPONENTS; j++) {
                Label tab = new Label("Tab content " + i + " " + j);
View Full Code Here

                "Click the button to create a new inline window."));

        final CheckBox asModal = new CheckBox("As modal");
        main.addComponent(asModal);

        final Button create = new Button("Create a new window",
                new ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        VerticalLayout layout = new VerticalLayout();
View Full Code Here

        final Select se = new Select();
        se.setCaption("VALITSET TÄSTÄ");
        se.addItem("valinta1");
        se.addItem("Valinta 2");

        Button b = new Button("refresh view", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                createNewView();
            }
        });
        main.addComponent(b);

        b = new Button("reorder view", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                randomReorder();
            }
        });
        main.addComponent(b);

        b = new Button("remove randomly one component",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        removeRandomComponent();
                    }
View Full Code Here

    public PerformanceTestSubTreeCaching() {
        main = new VerticalLayout();
        setCompositionRoot(main);
        addInfo();

        Button b = new Button("start test", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                startTest();
            }
        });
        b.setDescription("Push this button to start test. A test label will be rendered above existing components.");
        main.addComponent(b);
        b = new Button("end test", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                endTest();
            }
        });
        b.setDescription("Push this button as soon as test componenet is rendered.");
        main.addComponent(b);

        result = new Label();
        main.addComponent(result);
View Full Code Here

TOP

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

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.