Package com.vaadin.ui

Examples of com.vaadin.ui.CheckBox


                    }
                    return null;
                }

            });
            CheckBox b = new CheckBox("editmode", new MethodProperty<Boolean>(
                    table, "editable"));
            b.setImmediate(true);
            addComponent(b);
        }
View Full Code Here


            Object id = container.addItem();
            Item item = container.getItem(id);
            item.getItemProperty(STRING).setValue(s);
            item.getItemProperty(BUTTON).setValue(new Button(s));
            item.getItemProperty(CHECKBOX).setValue(
                    new CheckBox("", s.equals("true")));
        }

    }
View Full Code Here

                selectedLabel.setValue("Selected: "
                        + event.getProperty().getValue());
            }
        });

        final CheckBox editMode = new CheckBox("Edit mode");
        editMode.addValueChangeListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                table.setEditable(editMode.getValue());
            }
        });
        addComponent(editMode);
    }
View Full Code Here

    @Override
    protected void initializeComponents() {

        setTheme("tests-tickets");
        CheckBox cb;

        cb = createCheckBox("CheckBox with normal text");
        addTestComponent(cb);

        cb = createCheckBox("CheckBox with large text");
        cb.setStyleName("large");
        addTestComponent(cb);

        cb = createCheckBox("CheckBox with normal text and small icon",
                SMALL_ICON);
        addTestComponent(cb);
        cb = createCheckBox("CheckBox with large text and small icon",
                SMALL_ICON);
        cb.setStyleName("large");
        addTestComponent(cb);

        cb = createCheckBox("CheckBox with normal text and large icon",
                LARGE_ICON);
        addTestComponent(cb);
        cb = createCheckBox("CheckBox with large text and large icon",
                LARGE_ICON_NOCACHE);
        cb.setStyleName("large");
        addTestComponent(cb);

    }
View Full Code Here

        addTestComponent(cb);

    }

    private CheckBox createCheckBox(String caption, Resource icon) {
        CheckBox cb = createCheckBox(caption);
        cb.setIcon(icon);

        return cb;
    }
View Full Code Here

        return cb;
    }

    private CheckBox createCheckBox(String caption) {
        return new CheckBox(caption);
    }
View Full Code Here

@PreserveOnRefresh
public class CheckBoxRevertValueChange extends AbstractTestUIWithLog {

    @Override
    protected void setup(VaadinRequest request) {
        final CheckBox alwaysUnchecked = new CheckBox("You may not check me");
        alwaysUnchecked
                .addValueChangeListener(new Property.ValueChangeListener() {
                    @Override
                    public void valueChange(Property.ValueChangeEvent event) {
                        if (alwaysUnchecked.getValue()) {
                            log("I said no checking!");
                            alwaysUnchecked.setValue(false);
                        }
                    }
                });
        final CheckBox alwaysChecked = new CheckBox("You may not uncheck me");
        alwaysChecked.setValue(true);
        alwaysChecked
                .addValueChangeListener(new Property.ValueChangeListener() {
                    @Override
                    public void valueChange(Property.ValueChangeEvent event) {
                        if (!alwaysChecked.getValue()) {
                            log("I said no unchecking!");
                            alwaysChecked.setValue(true);
                        }
                    }
                });

        addComponent(alwaysUnchecked);
View Full Code Here

        inner4.addComponent(new Label("Test2"));
        outer.addComponent(inner4);

        addComponent(outer);

        final CheckBox spacingCheckBox = new CheckBox("Spacings", false);
        spacingCheckBox.setId("spacings");
        spacingCheckBox.setImmediate(true);
        spacingCheckBox.addValueChangeListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                setLayoutSpacing(spacingCheckBox.getValue());
            }
        });
        addComponent(spacingCheckBox);

        final CheckBox marginCheckBox = new CheckBox("Margins", false);
        marginCheckBox.setId("margins");
        marginCheckBox.setImmediate(true);
        marginCheckBox.addValueChangeListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                setLayoutMargin(marginCheckBox.getValue());
            }
        });
        addComponent(marginCheckBox);

        setLayoutSpacing(false);
View Full Code Here

    private Table table;
    private boolean actionHandlerHasActions = false;

    @Override
    public void setup() {
        CheckBox cb = new CheckBox("Item click listener");
        cb.setImmediate(true);
        cb.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                if (((Boolean) event.getProperty().getValue())) {
                    table.addListener(TableAndBrowserContextMenu.this);
                } else {
                    table.removeListener(TableAndBrowserContextMenu.this);
                }

            }
        });
        addComponent(cb);

        CheckBox cbActionHandler = new CheckBox("Action handler");
        cbActionHandler.setImmediate(true);
        cbActionHandler.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                if (((Boolean) event.getProperty().getValue())) {
                    table.addActionHandler(TableAndBrowserContextMenu.this);
                } else {
                    table.removeActionHandler(TableAndBrowserContextMenu.this);
                }

            }
        });
        addComponent(cbActionHandler);

        CheckBox cbActionHasActions = new CheckBox("Action handler has actions");
        cbActionHasActions.setImmediate(true);
        cbActionHasActions.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                actionHandlerHasActions = ((Boolean) event.getProperty()
                        .getValue());
View Full Code Here

        layout.addComponent(area2);
        layout.setSpacing(true);

        addComponent(layout);

        CheckBox onoff = new CheckBox("Wrap state for the right field");
        onoff.setValue(false);
        onoff.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                boolean wrap = (Boolean) event.getProperty().getValue();
                area2.setWordwrap(wrap);
                if (wrap) {
                    area2.setCaption("Wrapping");
                } else {
                    area2.setCaption("Nonwrapping");
                }

            }
        });
        onoff.setImmediate(true);

        addComponent(onoff);
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.CheckBox

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.