Package com.vaadin.ui

Examples of com.vaadin.ui.OptionGroup


        l.addComponent(nbtn);

        CheckBox chkb = new CheckBox("CheckBox");
        l.addComponent(chkb);

        OptionGroup og = createOptionGroup("OptionGroup");
        og.setMultiSelect(false);
        l.addComponent(og);

        final OptionGroup ogm = createOptionGroup("OptionGroup (multiselect)");
        ogm.setMultiSelect(true);
        l.addComponent(ogm);

        btn.addListener(new ClickListener() {

            private int i;

            @Override
            public void buttonClick(ClickEvent event) {
                ogm.addItem("newItem" + i++);

            }
        });

        tf.addListener(focusListener);
        tf.addListener(blurListener);
        df.addListener(focusListener);
        df.addListener(blurListener);
        cb.addListener(focusListener);
        cb.addListener(blurListener);
        btn.addListener(focusListener);
        btn.addListener(blurListener);
        nbtn.addListener(focusListener);
        nbtn.addListener(blurListener);
        chkb.addListener(focusListener);
        chkb.addListener(blurListener);
        og.addListener(focusListener);
        og.addListener(blurListener);
        ogm.addListener(focusListener);
        ogm.addListener(blurListener);

        l.addComponent(messages);

    }
View Full Code Here


        l.addComponent(messages);

    }

    private OptionGroup createOptionGroup(String caption) {
        OptionGroup og = new OptionGroup(caption);
        og.addItem("Option 0");
        og.addItem("Option 1");
        og.addItem("Option 2");
        return og;
    }
View Full Code Here

        main.addComponent(createSelection());
        main.addComponent(setButton);
    }

    private Component createSelection() {
        options = new OptionGroup();
        options.addItem("Icon");
        options.addItem("Caption");
        options.addItem("Required");
        options.addItem("Error");
        options.setMultiSelect(true);
View Full Code Here

    private VerticalLayout content = new VerticalLayout();

    @Override
    protected void setup() {

        OptionGroup layouts = new OptionGroup("Layouts", Arrays.asList(
                "AbsoluteLayout", "OrderedLayout", "GridLayout"));
        layouts.select("AbsoluteLayout");
        layouts.setImmediate(true);
        layouts.addValueChangeListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                if (event.getProperty().getValue().equals("AbsoluteLayout")) {
                    testAbsoluteLayout();
                } else if (event.getProperty().getValue()
View Full Code Here

    @Override
    protected void setup(VaadinRequest request) {
        addComponent(new TextField(null, "TextField"));
        addComponent(new CheckBox("CheckBox"));
        addComponent(new OptionGroup(null,
                Arrays.asList("Option 1", "Option 2")));
        addComponent(new NativeButton("NativeButton"));
    }
View Full Code Here

        ComboBox comboBox = new ComboBox("Default ComboBox");
        comboBox.addItem("Item1");
        components.add(comboBox);

        OptionGroup radioGroup = new OptionGroup("Single Items");
        radioGroup.addItem("Single Item 1");
        radioGroup.addItem("Single Item 2");
        radioGroup.setMultiSelect(false);
        components.add(radioGroup);

        OptionGroup checkGroup = new OptionGroup("Multi Items");
        checkGroup.addItem("Multi Item 1");
        checkGroup.addItem("Multi Item 2");
        checkGroup.setMultiSelect(true);
        components.add(checkGroup);

        // Tree tree = new Tree();
        // tree.setCaption("tree");
        // tree.addItem("single item");
View Full Code Here

        TwinColSelect tws = new TwinColSelect();
        tws.setId("select" + debugIdCounter++);
        createDummyData(tws);
        addComponent(tws);

        OptionGroup og = new OptionGroup();
        og.setId("select" + debugIdCounter++);
        createDummyData(og, 4);
        addComponent(og);

        og = new OptionGroup();
        og.setId("select" + debugIdCounter++);
        createDummyData(og, 4);
        og.setItemEnabled("Foo2", false);
        og.setItemEnabled("Foo3", false);
        addComponent(og);

        NativeSelect ns = new NativeSelect();
        ns.setId("select" + debugIdCounter++);
        createDummyData(ns);
View Full Code Here

        TextField username = new TextField("Username");
        username.setValue(sg.nextString(false) + sg.nextString(false));
        username.setRequired(true);
        form.addComponent(username);

        OptionGroup sex = new OptionGroup("Sex");
        sex.addItem("Female");
        sex.addItem("Male");
        sex.select("Male");
        sex.addStyleName("horizontal");
        form.addComponent(sex);

        section = new Label("Contact Info");
        section.addStyleName("h3");
        section.addStyleName("colored");
View Full Code Here

        return c;
    }

    /** Create new OptionGroup and add it to current component container. */
    public OptionGroup optiongroup() {
        OptionGroup c = new OptionGroup();
        c.setImmediate(true);
        add(c);
        return c;
    }
View Full Code Here

    /**
     * Create new OptionGroup with given caption and add it to current component
     * container.
     */
    public OptionGroup optiongroup(String caption) {
        OptionGroup c = optiongroup();
        c.setCaption(caption);
        return c;
    }
View Full Code Here

TOP

Related Classes of com.vaadin.ui.OptionGroup

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.