Package com.vaadin.ui

Examples of com.vaadin.ui.Button$ClickListener


        form.addComponent(help);

        CheckBox check = new CheckBox("Check me out");
        form.addComponent(check);

        Button submit = new Button("Submit");
        submit.addStyleName(Bootstrap.Buttons.DEFAULT.styleName());
        form.addComponent(submit);

        container.addComponent(form);
    }
View Full Code Here


        HorizontalLayout buttons = new HorizontalLayout();
        buttons.setSpacing(true);
        buttons.setMargin(true);
        container.addComponent(buttons);

        Button normal = new Button("Default");
        normal.addStyleName(Bootstrap.Buttons.DEFAULT.styleName());

        Button primary = new Button("Primary");
        primary.addStyleName(Bootstrap.Buttons.PRIMARY.styleName());

        Button success = new Button("Success");
        success.addStyleName(Bootstrap.Buttons.SUCCESS.styleName());

        Button info = new Button("Info");
        info.addStyleName(Bootstrap.Buttons.INFO.styleName());

        Button warning = new Button("Warning");
        warning.addStyleName(Bootstrap.Buttons.WARNING.styleName());

        Button danger = new Button("Danger");
        danger.addStyleName(Bootstrap.Buttons.DANGER.styleName());

        Button link = new Button("Link");
        link.addStyleName(Bootstrap.Buttons.LINK.styleName());

        buttons.addComponents(normal, primary, info, success, warning, danger,
                link);
    }
View Full Code Here

        setSizeFull();
        setMargin(true);
        setSpacing(true);

        final HorizontalLayout toolbar = new HorizontalLayout(
                new Button("Go to the Home view", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        getUI().getNavigator().navigateTo(HomeView.VIEW_NAME);
                    }
                }),
                new Button("Go to User view", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        getUI().getNavigator().navigateTo(UserView.VIEW_NAME);
                    }
                }),
                new Button("Go to Admin view", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        getUI().getNavigator().navigateTo(AdminView.VIEW_NAME);
                    }
                }),
                new Button("Logout", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        security.logout();
                        getUI().getPage().reload();
                    }
View Full Code Here

    protected void init(VaadinRequest request) {
        setPollInterval(300);
        eventBus.subscribe(this);

        layout = new VerticalLayout(
                new Button("Publish UI Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        eventBus.publish(EventsUI.this, "Hello World from UI");
                    }
                }),
                new Button("Publish Session Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        eventBus.publish(EventScope.SESSION, EventsUI.this, "Hello World from Session");
                    }
                }),
                new Button("Publish Application Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        eventBus.publish(EventScope.APPLICATION, EventsUI.this, "Hello World from Application");
                    }
                }),
                new Button("Publish Application Context Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        applicationContext.publishEvent(new ApplicationEvent("Hello World from ApplicationContext") {
                            @Override
                            public Object getSource() {
View Full Code Here

  protected Layout buildUserArea(String username) {
    HorizontalLayout userArea = new HorizontalLayout();
    String id = env.getProperty("app.security.scheme", Scheme.BASIC.id());
    if (id.equals(Scheme.FORM.id())) {
      Button signOut = new Button("Sign Out");
      signOut.addClickListener(logoutListener);
      userArea.addComponent(signOut);
    }
    Label loggedInUser = new Label();
    loggedInUser.setValue(username);
    loggedInUser.setSizeUndefined();
View Full Code Here

    @Override
    protected void init(VaadinRequest request) {
        eventBus.subscribe(this);

        layout = new VerticalLayout(
                new Button("Publish UI Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        eventBus.publish(EventBusUI.this, "Hello World from UI");
                    }
                }),
                new Button("Publish Session Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        eventBus.publish(EventScope.SESSION, EventBusUI.this, "Hello World from Session");
                    }
                }),
                new Button("Publish Application Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        eventBus.publish(EventScope.APPLICATION, EventBusUI.this, "Hello World from Application");
                    }
                }),
                new Button("Publish Application Context Event", new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        applicationContext.publishEvent(new ApplicationEvent("Hello World from ApplicationContext") {
                            @Override
                            public Object getSource() {
View Full Code Here

        row.setDefaultComponentAlignment(Alignment.BOTTOM_CENTER);
        row.setWidth("100%");
        // row.setHeight("248px");
        row.setSizeFull();

        Button button = new Button("Boo");
        button.setWidth("100%");
        Button button2 = new Button("Abc");
        button2.setWidth("100%");
        row.addComponents(button, new InlineDateField(), new CheckBox("Far"));

        p.setContent(row);

        p = new Panel();
        // layout.addComponent(p);
        p.setHeight("400px");

        VerticalLayout col = new VerticalLayout();
        col.setSizeFull();
        col.setSpacing(true);
        // row.setMargin(true);
        col.setDefaultComponentAlignment(Alignment.BOTTOM_CENTER);

        col.addComponents(new Button("Boo"), new InlineDateField(),
                new CheckBox("Far"), new Button("Abc"));

        p.setContent(col);

        TreeTable table = new TreeTable();
        table.setWidth("100%");
View Full Code Here

        GridLayout layout = new GridLayout(3, 3);
        layout.setWidth("1000px");
        layout.setHeight("1000px");
        addComponent(layout);

        Button b = new Button("Open", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Window centered = new Window("A window", new Label(
                        "Centered window"));
                centered.center();
                getMainWindow().addWindow(centered);
            }
        });
        layout.addComponent(b, 0, 0);

        b = new Button("Open", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Window centered = new Window("A window", new Label(
                        "Centered window"));
                centered.center();
                getMainWindow().addWindow(centered);
            }
        });
        layout.addComponent(b, 1, 1);

        b = new Button("Open", new Button.ClickListener() {

            @Override
            public void buttonClick(ClickEvent event) {
                Window centered = new Window("A window", new Label(
                        "Centered window"));
View Full Code Here

        for (int i = 0; i < 10; i++) {

            VerticalLayout vl = new VerticalLayout();
            // vl.setWidth(null);
            Button b = new Button("String 1 2 3");
            b.setStyleName(BaseTheme.BUTTON_LINK);
            vl.addComponent(b);
            t.addItem(new Object[] { vl, "String 2", "String 3", "String 4",

            new Button("String 5") }, new Integer(new Random().nextInt()));

        }

        hl.addComponent(t);
View Full Code Here

        }
    };

    @Override
    protected void setup(VaadinRequest request) {
        Button addButton = new Button("Add new Window");
        addButton.addListener(addListener);
        addComponent(addButton);

        addWindowAgain = new ComboBox("Add Window Again");
        addWindowAgain.setBuffered(false);
        addWindowAgain.setImmediate(true);
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.