Package com.vaadin.data.util

Examples of com.vaadin.data.util.PropertysetItem


    @Test
    public void passesFilter_beginsWithLikeQueryOnStringNotBeginningWithValue_shouldFail() {
        Like like = new Like("test", "foo%");

        Item item = new PropertysetItem();
        item.addItemProperty("test", new ObjectProperty<String>("barfoo"));

        Assert.assertFalse(like.passesFilter("id", item));
    }
View Full Code Here


    @Test
    public void passesFilter_endsWithLikeQueryOnStringEndingWithValue_shouldSucceed() {
        Like like = new Like("test", "%foo");

        Item item = new PropertysetItem();
        item.addItemProperty("test", new ObjectProperty<String>("barfoo"));

        Assert.assertTrue(like.passesFilter("id", item));
    }
View Full Code Here

    @Test
    public void passesFilter_endsWithLikeQueryOnStringNotEndingWithValue_shouldFail() {
        Like like = new Like("test", "%foo");

        Item item = new PropertysetItem();
        item.addItemProperty("test", new ObjectProperty<String>("foobar"));

        Assert.assertFalse(like.passesFilter("id", item));
    }
View Full Code Here

    @Test
    public void passesFilter_startsWithAndEndsWithOnMatchingValue_shouldSucceed() {
        Like like = new Like("test", "foo%bar");

        Item item = new PropertysetItem();
        item.addItemProperty("test", new ObjectProperty<String>("fooASDFbar"));

        Assert.assertTrue(like.passesFilter("id", item));
    }
View Full Code Here

public class FormNotGettingSmaller extends TestBase {

    @Override
    protected void setup() {
        Item item = new PropertysetItem();
        item.addItemProperty("name", new ObjectProperty<String>(
                "Charles Anthony"));
        item.addItemProperty("city", new ObjectProperty<String>("London"));
        item.addItemProperty("isTallPerson", new ObjectProperty<Boolean>(
                Boolean.FALSE));

        Label spacer = new Label();
        HorizontalLayout buttons = new HorizontalLayout();
        buttons.setSpacing(true);
View Full Code Here

        GridLayout gridLayout = new GridLayout();
        gridLayout.setSizeUndefined();
        gridLayout.setColumns(2);
        gridLayout.setSpacing(true);

        PropertysetItem item = new PropertysetItem();
        for (String propertyId : propertyIds) {
            item.addItemProperty(propertyId, new ObjectProperty<String>(
                    propertyId));
        }

        final Form form = new Form(gridLayout);
        form.setItemDataSource(item);
View Full Code Here

            copyItemValues(original, clone);
        }
    }

    private Item cloneItem(Item originalItem) {
        PropertysetItem newItem = new PropertysetItem();
        for (Object propertyId : originalItem.getItemPropertyIds()) {
            Property originalProperty = originalItem.getItemProperty(propertyId);
            newItem.addItemProperty(propertyId,
                    new ObjectProperty(
                            originalProperty.getValue(),
                            originalProperty.getType(),
                            originalProperty.isReadOnly()
                    ));
View Full Code Here

    public Item constructItem(int indexColumnValue, int reverseIndexColumnValue) {
        // since construct item needs to know what the current size is (including added items)
        // to populate Index and ReverseIndex we should provide it somehow here!
        // At the moment adding multiple items leads to strange behaviour.
        PropertysetItem item = new PropertysetItem();
        for (Object propertyId : this.definition.getPropertyIds()) {

            Object value = null;

            if ("Index".equals(propertyId)) {
                value = indexColumnValue;
            } else if ("ReverseIndex".equals(propertyId)) {
                value = reverseIndexColumnValue;
            } else {
                value = this.definition.getPropertyDefaultValue(propertyId);
            }

            item.addItemProperty(propertyId, new ObjectProperty(
                    value,
                    this.definition.getPropertyType(propertyId),
                    this.definition.isPropertyReadOnly(propertyId)
            ));
View Full Code Here

            copyItemValues(original, clone);
        }
    }

    private Item cloneItem(Item originalItem) {
        PropertysetItem newItem = new PropertysetItem();
        for (Object propertyId : originalItem.getItemPropertyIds()) {
            Property originalProperty = originalItem.getItemProperty(propertyId);
            newItem.addItemProperty(propertyId,
                    new ObjectProperty(
                            originalProperty.getValue(),
                            originalProperty.getType(),
                            originalProperty.isReadOnly()
                    ));
View Full Code Here

    public Item constructItem(int indexColumnValue, int reverseIndexColumnValue) {
        // since construct item needs to know what the current size is (including added items)
        // to populate Index and ReverseIndex we should provide it somehow here!
        // At the moment adding multiple items leads to strange behaviour.
        PropertysetItem item = new PropertysetItem();
        for (Object propertyId : this.definition.getPropertyIds()) {

            Object value = null;

            if ("Index".equals(propertyId)) {
                value = indexColumnValue;
            } else if ("ReverseIndex".equals(propertyId)) {
                value = reverseIndexColumnValue;
            } else {
                value = this.definition.getPropertyDefaultValue(propertyId);
            }

            item.addItemProperty(propertyId, new ObjectProperty(
                    value,
                    this.definition.getPropertyType(propertyId),
                    this.definition.isPropertyReadOnly(propertyId)
            ));
View Full Code Here

TOP

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

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.