Package com.vaadin.ui

Examples of com.vaadin.ui.Button$ClickListener


        table.setWidth("400px");

        table.addItem(new Object[] { "Cell 1", "Cell 2" }, new Object());

        addComponent(table);
        addComponent(new Button("Uncollapse col2", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                table.setColumnCollapsed("Col2", false);
            }
        }));
View Full Code Here


        // workaround for case #2
        // table.setWidth("300px");
        // table.setHeight("300px");

        Button refreshTable = new Button("Switch table container");
        refreshTable.addListener(new Button.ClickListener() {
            boolean full = true;

            @Override
            public void buttonClick(Button.ClickEvent e) {
                if (full) {
View Full Code Here

    @Override
    public void setup() {
        final Label label = new Label("Hello Vaadin user");
        addComponent(label);
        final Button openButton = new Button("open me");
        openButton.addClickListener(new ClickListener() {

            @Override
            public void buttonClick(final ClickEvent event) {
                final Window window = new Window("Simple Window");
                window.setModal(true);
                window.setHeight("200px");
                window.setWidth("200px");
                final Table table = new Table();
                window.setContent(table);
                UI.getCurrent().addWindow(window);
                window.addCloseListener(new CloseListener() {
                    @Override
                    public void windowClose(final CloseEvent e) {
                        window.setContent(new Label());
                        UI.getCurrent().removeWindow(window);
                    }
                });
            }
        });
        addComponent(openButton);

        final Button openButton2 = new Button("open me without Table");
        openButton2.addClickListener(new ClickListener() {
            @Override
            public void buttonClick(final ClickEvent event) {
                final Window window = new Window("Simple Window");
                window.setModal(true);
                window.setHeight("200px");
View Full Code Here

            };
            table.setContainerDataSource(container);
            addComponent(table);
            final Label label = new Label();
            addComponent(label);
            Button button = new Button("Click");
            button.addListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    try {
                        reduceData = !reduceData;
                        table.refreshRowCache();
                        label.setValue("Index: "
                                + table.getCurrentPageFirstItemIndex());
                    } catch (Exception e) {
                        label.setValue("Exception: "
                                + e.getClass().getSimpleName());
                    }
                }
            });
            addComponent(button);
            Button button2 = new Button("Filter");
            button2.addListener(new Button.ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    try {
                        if (filter != null) {
                            container.removeAllContainerFilters();
View Full Code Here

        // setTheme("tests-tickets");
        createUI((AbstractOrderedLayout) w.getContent());
    }

    private void createUI(AbstractOrderedLayout layout) {
        Button b = new Button("Change container datasource",
                new ClickListener() {

                    @Override
                    public void buttonClick(ClickEvent event) {
                        for (int i = 0; i < 5; i++) {
View Full Code Here

            itemB.getItemProperty(property2).setValue("value_prop2");
        }

        public TableTestComponent() {

            Button switchContainerButton = new Button("switch container");
            switchContainerButton.addListener(new ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    if (testTable.getContainerDataSource() == containerA) {
                        testTable.setContainerDataSource(containerB);
                    } else {
                        testTable.setContainerDataSource(containerA);
                    }
                }
            });
            this.addComponent(switchContainerButton);

            Button clearButton = new Button("clear (click twice)");
            clearButton.addListener(new ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    try {
                        me.removeComponent(testTable);
View Full Code Here

        fill(container1, 100);

        table.setContainerDataSource(container1);

        Button refreshTable = new Button("Change table container");
        refreshTable.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(Button.ClickEvent e) {
                table.setContainerDataSource(container2);
                table.setContainerDataSource(container1);
            }
View Full Code Here

        for (int i = 0; i < size; i++) {
            int randInt = i;
            Item item = container.addItem(new Integer(i));
            VerticalLayout layout = new VerticalLayout();
            layout.setId("lo" + i);
            layout.addComponent(new Button("Test " + randInt));
            item.getItemProperty("layout").setValue(layout);
        }
    }
View Full Code Here

        tbl.setImmediate(true);
        tbl.setColumnCollapsingAllowed(true);

        log = new Log(5);

        controls.addComponent(new Button("Fixed size (200x200)",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        tbl.setWidth("200px");
                        tbl.setHeight("200px");
                        log.log("Size 200x200 pixels");
                    }
                }));

        controls.addComponent(new Button("Fixed size (600x200)",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        tbl.setWidth("600px");
                        tbl.setHeight("200px");
                        log.log("Size 600x200 pixels");
                    }
                }));

        controls.addComponent(new Button("Undefined size",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        tbl.setSizeUndefined();
                        log.log("Size undefined");
View Full Code Here

    }

    private void fillAndAdd(Layout gl) {
        for (int i = 0; i < 4; i++) {
            Button b = new Button("B");
            b.setSizeFull();
            gl.addComponent(b);
        }
        String caption = gl.getClass().getSimpleName();
        caption += " style: " + gl.getStyleName() + ", spacingFromServer:"
                + ((SpacingHandler) gl).isSpacing();
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.