Package com.vaadin.ui

Examples of com.vaadin.ui.NativeSelect.addListener()


        NativeSelect pageLength = new NativeSelect("PageLength", Arrays.asList(
                0, 1, 2, 4, 8, 10));
        pageLength.setImmediate(true);
        pageLength.setNullSelectionAllowed(false);
        pageLength.addListener(new Property.ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                int pageLength = Integer.valueOf(event.getProperty().getValue()
                        .toString());
                tbl.setPageLength(pageLength);
View Full Code Here


        addLocale(Locale.CHINESE, s);
        addLocale(Locale.US, s);
        addLocale(Locale.UK, s);
        addLocale(new Locale("fi", "FI"), s);

        s.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                setDateFieldLocale((Locale) s.getValue());
            }
View Full Code Here

        final NativeSelect select = new NativeSelect(caption);
        select.addContainerProperty(CAPTION, String.class, "");
        select.addContainerProperty(VALUE, Object.class, "");
        select.setItemCaptionPropertyId(CAPTION);
        select.setNullSelectionAllowed(false);
        select.addListener(new Property.ValueChangeListener() {

            @Override
            public void valueChange(ValueChangeEvent event) {
                Object itemId = event.getProperty().getValue();
                Item item = select.getItem(itemId);
View Full Code Here

            };

            hAlign.setValue(new Integer(Bits.ALIGNMENT_LEFT));
            vAlign.addListener(alignmentChangeListener);
            hAlign.addListener(alignmentChangeListener);
            vAlign.setValue(new Integer(Bits.ALIGNMENT_TOP));

            controls.addComponent(new Label("layout alignment"));
            final NativeSelect lAlign = new NativeSelect();
            controls.addComponent(lAlign);
View Full Code Here

            lAlign.setItemCaption(
                    new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
            lAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
            lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right");

            lAlign.addListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(ValueChangeEvent event) {
                    testPanelLayout.setComponentAlignment(
                            testedLayout,
                            new Alignment(((Integer) lAlign.getValue())
View Full Code Here

                    }
                    select.setContainerDataSource(container);
                    select.setItemCaptionPropertyId("caption");
                    select.setImmediate(true);

                    select.addListener(new ValueChangeListener() {
                        @Override
                        public void valueChange(ValueChangeEvent event) {
                            editcomponent((Component) event.getProperty()
                                    .getValue());
                            getMainWindow().removeWindow(chooser);
View Full Code Here

                        }
                    }
                    select.setContainerDataSource(container);
                    select.setImmediate(true);

                    select.addListener(new ValueChangeListener() {
                        @Override
                        public void valueChange(ValueChangeEvent event) {
                            Class<?> c = (Class<?>) event.getProperty()
                                    .getValue();
View Full Code Here

        ArrayList<String> sizes = new ArrayList<String>();
        sizes.addAll(Arrays.asList("100px", "30em", "100%"));

        final NativeSelect width = new NativeSelect(null, sizes);
        width.setImmediate(true);
        width.addListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                if (width.getValue() != null) {
                    l.setWidth(width.getValue().toString());
                } else {
View Full Code Here

        });
        layout.addComponent(width);
        layout.addComponent(new Label("&times;", ContentMode.HTML));
        final NativeSelect height = new NativeSelect(null, sizes);
        height.setImmediate(true);
        height.addListener(new ValueChangeListener() {
            @Override
            public void valueChange(ValueChangeEvent event) {
                if (height.getValue() != null) {
                    l.setHeight(height.getValue().toString());
                } else {
View Full Code Here

            ValueChangeListener listener, List<String> values,
            String defaultValue) {
        NativeSelect selector = new NativeSelect(caption, values);
        selector.setNullSelectionAllowed(false);
        selector.setImmediate(true);
        selector.addListener(listener);
        selector.setValue(defaultValue);
        return selector;
    }

    @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.