Package com.vaadin.ui

Examples of com.vaadin.ui.CheckBox


        return null;
    }

    @Override
    protected void setup() {
        CheckBox checkbox = new CheckBox("A checkbox");
        checkbox.setIcon(new ThemeResource("../runo/icons/32/calendar.png"));
        checkbox.setDescription("Tooltip for checkbox");

        addComponent(checkbox);
    }
View Full Code Here


    @Override
    protected void setup() {
        setTheme("tests-tickets");
        VerticalLayout mainLayout = new VerticalLayout();
        CheckBox cb = new CheckBox(
                "Checkbox with some Incididunt ut labore et dolore magna aliqua.");
        cb.setStyleName("wrap");
        cb.setWidth("100%");
        mainLayout.setStyleName("borders");
        mainLayout.setWidth("300px");
        mainLayout.addComponent(cb);
        mainLayout.addComponent(new Label(
                "Lorem ipsum dolor sit amet, consectetur adipisicing"
View Full Code Here

            public void valueChange(ValueChangeEvent event) {
                log("Value changed: " + event.getProperty().getValue());
            }
        };

        final CheckBox checkBox = new CheckBox("Toggle listener");
        checkBox.addValueChangeListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                if (checkBox.getValue()) {
                    textField.addValueChangeListener(listener);
                } else {
                    textField.removeValueChangeListener(listener);
                }
            }
        });
        checkBox.setId(LISTENER_TOGGLE);

        Button b = new Button(
                "setImmediate(false), sets explicitly false and causes server roundtrip",
                new ClickListener() {
View Full Code Here

            public void headerClick(HeaderClickEvent event) {
                columnField.setValue(String.valueOf(event.getPropertyId()));
            }
        });

        CheckBox immediateCheckbox = new CheckBox("Immediate");
        immediateCheckbox.setImmediate(true);
        immediateCheckbox.setValue(table.isImmediate());
        immediateCheckbox.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                table.setImmediate((Boolean) event.getProperty().getValue());
            }
        });

        CheckBox sortEnabledCheckbox = new CheckBox("Sortable");
        sortEnabledCheckbox.setImmediate(true);
        sortEnabledCheckbox.setValue(table.isSortEnabled());
        sortEnabledCheckbox.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                table.setSortDisabled(!(Boolean) event.getProperty().getValue());
            }
        });

        CheckBox columnReorderingCheckbox = new CheckBox(
                "Column reordering allowed");
        columnReorderingCheckbox.setImmediate(true);
        columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
        columnReorderingCheckbox
                .addListener(new Property.ValueChangeListener() {

                    @Override
                    public void valueChange(ValueChangeEvent event) {
                        table.setColumnReorderingAllowed((Boolean) event
View Full Code Here

        addComponent(field2);

        final TextField field0 = new TextField("Field2 (tabindex 0)");
        addComponent(field0);

        final CheckBox readonly = new CheckBox("Readonly");
        readonly.setImmediate(true);
        readonly.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                boolean readonly = Boolean.valueOf(event.getProperty()
                        .getValue().toString());
                field1.setReadOnly(readonly);
View Full Code Here

        audio.setAltText("Can't <b>play</b> media");
        audio.setAutoplay(true);

        addComponent(audio);

        CheckBox checkBox = new CheckBox("Show controls",
                new MethodProperty<Boolean>(audio, "showControls"));
        addComponent(checkBox);
        checkBox = new CheckBox("HtmlContentAllowed",
                new MethodProperty<Boolean>(audio, "htmlContentAllowed"));
        addComponent(checkBox);
        checkBox = new CheckBox("muted", new MethodProperty<Boolean>(audio,
                "muted"));
        addComponent(checkBox);
        checkBox = new CheckBox("autoplay", new MethodProperty<Boolean>(audio,
                "autoplay"));
        addComponent(checkBox);

        Button b = new Button("Change", new Button.ClickListener() {
View Full Code Here

        t.addContainerProperty("Col1", String.class, "");
        t.addContainerProperty("Col2", String.class, "");

        t.setPageLength(5);

        t.addItem(new Object[] { new CheckBox(), "Foo", "Bar" }, "1");
        t.addItem(new Object[] { new CheckBox(), "Foo", "Bar" }, "2");

        main.addComponent(t);
    }
View Full Code Here

    }

    @Override
    protected void initializeComponents() {

        CheckBox cb = new CheckBox("Switch Selects ReadOnly", false);
        cb.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                for (Iterator<Component> it = layout.getComponentIterator(); it
                        .hasNext();) {
                    Component c = it.next();
                    if (c instanceof AbstractSelect) {
                        c.setReadOnly(!c.isReadOnly());
                    }
                }
            }
        });
        CheckBox cb2 = new CheckBox("Switch Selects Enabled", true);
        cb2.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                for (Iterator<Component> it = layout.getComponentIterator(); it
                        .hasNext();) {
View Full Code Here

                        + getMainWindow().getBrowserWindowWidth() + " x "
                        + getMainWindow().getBrowserWindowHeight());
            }
        });

        CheckBox subwindow = new CheckBox("show subwindow");
        subwindow.setImmediate(true);
        subwindow.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                if ((Boolean) event.getProperty().getValue()) {
                    getMainWindow().addWindow(subwin);
                } else {
                    getMainWindow().removeWindow(subwin);
                }
            }
        });
        getLayout().addComponent(subwindow);

        CheckBox immediate = new CheckBox("immediate");
        immediate.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                boolean booleanValue = (Boolean) event.getProperty().getValue();
                getMainWindow().setImmediate(booleanValue);
                subwin.setImmediate(booleanValue);
            }
        });
        immediate.setImmediate(true);
        immediate.setValue(true);
        getMainWindow().setImmediate(true);
        subwin.setImmediate(true);
        getLayout().addComponent(immediate);

        getLayout().addComponent(new Button("Sync"));
View Full Code Here

    private Table rightTable;

    @Override
    protected void setup() {
        CheckBox cb = new CheckBox("Set first column width");
        cb.setValue(false);
        cb.setImmediate(true);
        cb.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                if ((Boolean) event.getProperty().getValue()) {
                    rightTable.setColumnWidth("name", 150);
                } else {
                    rightTable.setColumnWidth("name", -1);
                }

            }
        });
        addComponent(cb);

        cb = new CheckBox("Set second column width");
        cb.setValue(true);
        cb.setImmediate(true);
        cb.addListener(new ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                if ((Boolean) event.getProperty().getValue()) {
                    rightTable.setColumnWidth("info", 20);
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.