Package com.vaadin.data.util

Examples of com.vaadin.data.util.ObjectProperty


            // Should just return null, without formatting
            Object value = formatter.getValue();

            // test with property which value is null
            formatter.setPropertyDataSource(new ObjectProperty(null,
                    expectedClass));
            formatter.getValue(); // calls format

            // test with a value
            formatter.setPropertyDataSource(new ObjectProperty(testValues[i++],
                    expectedClass));
            formatter.getValue(); // calls format
        }

    }
View Full Code Here


    /**
     * Creates an a new ProgressIndicator.
     */
    public ProgressIndicator() {
        setPropertyDataSource(new ObjectProperty(new Float(0), Float.class));
    }
View Full Code Here

     * Creates a new instance of ProgressIndicator with given state.
     *
     * @param value
     */
    public ProgressIndicator(Float value) {
        setPropertyDataSource(new ObjectProperty(value, Float.class));
    }
View Full Code Here

     *
     * @param content
     * @param contentMode
     */
    public Label(String content, int contentMode) {
        this(new ObjectProperty(content, String.class), contentMode);
    }
View Full Code Here

    @Test
    public void stringToEnumWithField() {
        TextField tf = new TextField();
        tf.setConverter(new ReverseConverter(converter));
        tf.setPropertyDataSource(new ObjectProperty(AnotherTestEnum.TWO));
        Assert.assertEquals(AnotherTestEnum.TWO.toString(), tf.getValue());
        tf.setValue(AnotherTestEnum.ONE.toString());
        Assert.assertEquals(AnotherTestEnum.ONE.toString(), tf.getValue());
        Assert.assertEquals(AnotherTestEnum.ONE, tf.getConvertedValue());
        Assert.assertEquals(AnotherTestEnum.ONE, tf.getPropertyDataSource()
                .getValue());

        tf.setPropertyDataSource(new ObjectProperty(TestEnum.TWO));
        Assert.assertEquals(TestEnum.TWO.toString(), tf.getValue());
        tf.setValue(TestEnum.ONE.toString());
        Assert.assertEquals(TestEnum.ONE.toString(), tf.getValue());
        Assert.assertEquals(TestEnum.ONE, tf.getConvertedValue());
        Assert.assertEquals(TestEnum.ONE, tf.getPropertyDataSource().getValue());
View Full Code Here

    @Test
    public void stringToEnumWithField() {
        TextField tf = new TextField();
        tf.setConverter(new ReverseConverter(anotherTestEnumConverter));
        tf.setPropertyDataSource(new ObjectProperty(AnotherTestEnum.TWO));
        Assert.assertEquals(AnotherTestEnum.TWO.toString(), tf.getValue());
        tf.setValue(AnotherTestEnum.ONE.toString());
        Assert.assertEquals(AnotherTestEnum.ONE.toString(), tf.getValue());
        Assert.assertEquals(AnotherTestEnum.ONE, tf.getConvertedValue());
        Assert.assertEquals(AnotherTestEnum.ONE, tf.getPropertyDataSource()
View Full Code Here

        // the select contains strings
        TwinColSelect select = new TwinColSelect(null, cityNameContainer);
        final FieldWrapper<Set> field = new CityStringSelect(select,
                Set.class);

        final ObjectProperty objectProperty = new ObjectProperty(
                new HashSet<City>());
        field.setPropertyDataSource(objectProperty);

        field.setImmediate(true);
        layout.addComponent(field);
View Full Code Here

     *
     * @param content
     * @param contentMode
     */
    public Label(String content, int contentMode) {
        this(new ObjectProperty(content, String.class), contentMode);
    }
View Full Code Here

    /**
     * Creates an a new ProgressIndicator.
     */
    public ProgressIndicator() {
        setPropertyDataSource(new ObjectProperty(new Float(0), Float.class));
    }
View Full Code Here

     * Creates a new instance of ProgressIndicator with given state.
     *
     * @param value
     */
    public ProgressIndicator(Float value) {
        setPropertyDataSource(new ObjectProperty(value, Float.class));
    }
View Full Code Here

TOP

Related Classes of com.vaadin.data.util.ObjectProperty

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.