Package com.vaadin.ui

Examples of com.vaadin.ui.Button$ClickListener


        t.setRequired(true);
        t.setValue("This one bugs");
        l.addComponent(t);
        w.addComponent(l);

        w.addComponent(new Button("show me the bug",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        l.setWidth(null);
                    }
View Full Code Here


        layout.setSizeUndefined();
        centered.center();

        Label l = new Label("This window is centered");
        l.setSizeUndefined();
        Button b = new Button(
                "Clicking here should not produce a layout click event");
        b.addListener(new Button.ClickListener() {

            @Override
            public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
                log.log("Click on button");
            }
View Full Code Here

    protected void setup() {

        HorizontalLayout buttonLayout = new HorizontalLayout();
        addComponent(buttonLayout);

        Button page1 = new Button("Hello World");
        buttonLayout.addComponent(page1);

        Button page2 = new Button("Lorem ipsum");
        buttonLayout.addComponent(page2);

        Button page3 = new Button("null");
        buttonLayout.addComponent(page3);

        final BrowserFrame browser = new BrowserFrame();
        browser.setId("browser");
        browser.setWidth("600px");
        browser.setHeight("300px");
        browser.setAlternateText("Browser alternative text");
        final TextSource textSource = new TextSource("initial");
        final StreamResource textResource = new StreamResource(textSource,
                "initial.txt");
        textResource.setMIMEType("text/plain");
        browser.setSource(textResource);
        addComponent(browser);

        page1.addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                TextSource helloSource = new TextSource("Hello World");
                StreamResource helloResource = new StreamResource(helloSource,
                        "helloworld.txt");
                helloResource.setMIMEType("text/plain");
                browser.setSource(helloResource);
            }
        });

        page2.addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                TextSource helloSource = new TextSource("Lorem Ipsum");
                StreamResource helloResource = new StreamResource(helloSource,
                        "loremipsum.txt");
                helloResource.setMIMEType("text/plain");
                browser.setSource(helloResource);
            }
        });

        page3.addClickListener(new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                browser.setSource(null);
            }
View Full Code Here

        row.addComponent(group);

        final DateField date2 = new DateField();
        group.addComponent(date2);

        Button today = new Button("Today", new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                date2.setValue(new Date());
            }
        });
View Full Code Here

    @Override
    public void init() {
        final LegacyWindow main = new LegacyWindow();
        setMainWindow(main);

        final Button remover = new Button("Remove PopupView");
        final PopupView pv = new PopupView(new PopupView.Content() {
            @Override
            public String getMinimizedValueAsHTML() {
                return "PopupView";
            }

            @Override
            public Component getPopupComponent() {
                return remover;
            }
        });

        remover.addListener(new Button.ClickListener() {
            @Override
            public void buttonClick(Button.ClickEvent event) {
                main.removeComponent(pv);
            }
        });
View Full Code Here

        mainWindow = new LegacyWindow("Tabsheet should cause scrollbars");
        setMainWindow(mainWindow);
        // mainWindow.getLayout().setSizeFull();
        tabSheet = new TabSheet();
        // tabSheet.setWidth("100%");
        Button button = new Button("Blah");
        button.setWidth("100%");
        Label label1 = new Label("Lorem ipsum");
        Label label2 = new Label("Lorem");
        Label label3 = new Label(
                "Lorema jsdfhak sjdfh kajsdh fkajhd kfjah dkfjah ksfdjh kajsfh kj 1 2 3 4 5 6 7 8 9 10");
View Full Code Here

        t.setSelectable(true);
        t.setSizeFull();

        for (int i = 0; i < 10; i++) {
            t.addItem(new Object[] { i, new Label("test " + i),
                    new Button("Button " + i) }, i);
        }

        return t;

    }
View Full Code Here

        actions.setCaption("Test actions");

        ts.addTab(actions);

        Button b;

        b = new Button(
                "change introduction caption (should add * to tab name)",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        testContent.setCaption(testContent.getCaption() + "*");
                    }
                });
        actions.addComponent(b);

        b = new Button("change tab caption (should add * to tab name)",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        actions.setCaption(actions.getCaption() + "*");
                    }
                });

        actions.addComponent(b);

        final UserError e = new UserError("Test error");

        b = new Button("Toggle error", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                if (testContent.getComponentError() == null) {
                    testContent.setComponentError(e);
                } else {
                    testContent.setComponentError(null);
                }
            }
        });
        actions.addComponent(b);

        b = new Button("Change table caption", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                t.setCaption(t.getCaption() + "*");
            }
        });
        actions.addComponent(b);

        b = new Button("Toggle Table error", new Button.ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                if (t.getComponentError() == null) {
                    t.setComponentError(e);
                } else {
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {
        final Table table = new Table("Test table", buildContainer());
        table.setSizeFull();
        addComponent(table);
        Button sortButton = new Button("Sort", new ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                table.sort(new Object[] { "val1" }, new boolean[] { false });
            }
View Full Code Here

    @Override
    public void init() {

        final LegacyWindow main = new LegacyWindow("Main window for #2007");
        setMainWindow(main);
        main.addComponent(new Button("Open another (non-main) window",
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(ClickEvent event) {
                        LegacyWindow c = new LegacyWindow(
                                "Non-main browser window " + (++childs));
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.