Package com.vaadin.ui

Examples of com.vaadin.ui.CheckBox


        Label help = new Label("Example block-level help text here.");
        help.addStyleName("help-block");
        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);
View Full Code Here


        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

                    w.setCaption("Window " + w.getData() + " Maximized");
                    maximize.setCaption("Restore");
                }
            }
        });
        final CheckBox resizeable = new CheckBox("Resizeable");
        resizeable.setValue(w.isResizable());
        resizeable.addValueChangeListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                w.setResizable(resizeable.getValue());
            }
        });
        ((ComponentContainer) w.getContent()).addComponent(resizeable);
        final CheckBox closeable = new CheckBox("Closeable");
        closeable.setValue(w.isClosable());
        closeable.addValueChangeListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                w.setClosable(closeable.getValue());
            }
        });
        ((ComponentContainer) w.getContent()).addComponent(closeable);
        NativeButton contentFull = new NativeButton("Set Content Size Full",
                new Button.ClickListener() {
View Full Code Here

        return select;
    }

    protected <T extends Field> T createBooleanField(Class<T> fieldType) {
        if (fieldType.isAssignableFrom(CheckBox.class)) {
            CheckBox cb = new CheckBox(null);
            cb.setImmediate(true);
            return (T) cb;
        } else if (AbstractTextField.class.isAssignableFrom(fieldType)) {
            return (T) createAbstractTextField((Class<? extends AbstractTextField>) fieldType);
        }
View Full Code Here

        final String[] visibleProps = { "required", "invalidAllowed",
                "readOnly", "readThrough", "invalidCommitted",
                "validationVisible" };
        for (int i = 0; i < visibleProps.length; i++) {
            CheckBox b = new CheckBox(visibleProps[i],
                    new MethodProperty<Boolean>(tx, visibleProps[i]));
            b.setImmediate(true);
            mainWin.addComponent(b);
        }

        mainWin.addComponent(new Button("Validate integer",
                new Button.ClickListener() {
View Full Code Here

            }
        });
        addComponent(log);

        addComponent(table);
        final CheckBox multiselect = new CheckBox("Multiselect");
        multiselect.setImmediate(true);
        multiselect.setId("multiselect");
        multiselect.addValueChangeListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                Boolean value = multiselect.getValue();
                table.setMultiSelect(value == null ? false : value);
            }
        });
        addComponent(multiselect);
        Button addItemsButton = new Button("Add table items",
View Full Code Here

        HorizontalLayout row = new HorizontalLayout();
        row.addStyleName("wrapping");
        row.setSpacing(true);
        addComponent(row);

        CheckBox check = new CheckBox("Checked", true);
        row.addComponent(check);

        check = new CheckBox(
                "Checked, explicit width, so that the caption should wrap",
                true);
        row.addComponent(check);
        check.setWidth("150px");

        check = new CheckBox("Not checked");
        row.addComponent(check);

        check = new CheckBox(null, true);
        check.setDescription("No caption");
        row.addComponent(check);

        check = new CheckBox("Custom color", true);
        check.addStyleName("color1");
        row.addComponent(check);

        TestIcon testIcon = new TestIcon(30);
        check = new CheckBox("Custom color", true);
        check.addStyleName("color2");
        check.setIcon(testIcon.get());
        row.addComponent(check);

        check = new CheckBox("With Icon", true);
        check.setIcon(testIcon.get());
        row.addComponent(check);

        check = new CheckBox();
        check.setIcon(testIcon.get(true));
        row.addComponent(check);

        check = new CheckBox("Small", true);
        check.addStyleName("small");
        row.addComponent(check);

        check = new CheckBox("Large", true);
        check.addStyleName("large");
        row.addComponent(check);

        h1 = new Label("Option Groups");
        h1.addStyleName("h1");
        addComponent(h1);
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {
        final Table table = createTable();
        table.setId("table");
        componentDescription = new CheckBox("Tooltip on components");
        componentDescription.addValueChangeListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                table.setContainerDataSource(createContainer(componentDescription
                        .getValue()));
            }
        });
        componentDescription.setImmediate(true);
        componentDescription.setValue(true);
        tableCellItemDescription = new CheckBox("Tooltip on table cells");
        tableCellItemDescription
                .addValueChangeListener(new ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        table.refreshRowCache();
                    }
                });
        tableCellItemDescription.setImmediate(true);
        tableCellItemDescription.setValue(true);

        tableRowItemDescription = new CheckBox("Tooltip on table Rows");
        tableRowItemDescription
                .addValueChangeListener(new ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
View Full Code Here

        table.setSizeFull();
        table.setMultiSelect(true);
        table.setNullSelectionAllowed(true);
        table.setSelectable(true);

        CheckBox selectAllCheckbox = new CheckBox("Select All");
        selectAllCheckbox.addValueChangeListener(new ValueChangeListener() {
            @Override
            public void valueChange(
                    com.vaadin.data.Property.ValueChangeEvent event) {
                Object checked = event.getProperty().getValue();
                if (checked instanceof Boolean) {
View Full Code Here

                log.log("Page length: " + pageLength);
            }
        });
        controls.addComponent(pageLength);

        CheckBox cb = new CheckBox("Column 1");
        cb.setValue(true);
        cb.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                Boolean value = (Boolean) event.getProperty().getValue();
                tbl.setColumnCollapsed("Column 1", !value);
                if (value) {
                    log.log("Column 1 visible");
                } else {
                    log.log("Column 1 hidden");
                }
            }
        });
        cb.setImmediate(true);
        visibilities.addComponent(cb);

        cb = new CheckBox("Column 2");
        cb.setValue(true);
        cb.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                Boolean value = (Boolean) event.getProperty().getValue();
                tbl.setColumnCollapsed("Column 2", !value);

                if (value) {
                    log.log("Column 2 visible");
                } else {
                    log.log("Column 2 hidden");
                }
            }
        });
        cb.setImmediate(true);
        visibilities.addComponent(cb);

        cb = new CheckBox("Column 3");
        cb.setValue(true);
        cb.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                Boolean value = (Boolean) event.getProperty().getValue();

                tbl.setColumnCollapsed("Column 3", !value);

                if (value) {
                    log.log("Column 3 visible");
                } else {
                    log.log("Column 3 hidden");
                }
            }
        });
        cb.setImmediate(true);
        visibilities.addComponent(cb);

        addComponent(log);
        addComponent(tbl);
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.