Package com.vaadin.tests.util

Examples of com.vaadin.tests.util.Person


    private static List<Person> createData() {
        int count = 500;
        List<Person> data = new ArrayList<Person>(count);
        for (int i = 0; i < count; i++) {
            data.add(new Person("Person", "" + i, "Email", "Phone", "Street",
                    12345, "City"));
        }
        return data;
    }
View Full Code Here


        addComponent(form);
        form.setItemDataSource(createPersonItem());
    }

    protected BeanItem<Person> createPersonItem() {
        Person person = new Person("First", "Last", "foo@vaadin.com",
                "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");

        BeanItem<Person> item = new BeanItem<Person>(person);
        // add nested properties from address
        item.expandProperty("address");
View Full Code Here

        addComponent(form);
        form.setItemDataSource(createPersonItem());
    }

    protected BeanItem<Person> createPersonItem() {
        Person person = new Person("First", "Last", "foo@vaadin.com",
                "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");

        BeanItem<Person> item = new BeanItem<Person>(person);
        // add nested properties from address
        item.expandProperty("address");
View Full Code Here

        PersonContainer testData = PersonContainer.createWithTestData();

        for (int i = 0; i < 10; i++) {
            Item addItem = table.addItem("Item" + i);
            Person p = testData.getIdByIndex(i);
            addItem.getItemProperty("Name").setValue(
                    p.getFirstName() + " " + p.getLastName());
            addItem.getItemProperty("Weight").setValue(50 + r.nextInt(60));
        }

    }
View Full Code Here

        PersonContainer testData = PersonContainer.createWithTestData();

        for (int i = 0; i < 40; i++) {
            Item addItem = table.addItem("Item" + i);
            Person p = testData.getIdByIndex(i);
            addItem.getItemProperty("Name").setValue(
                    p.getFirstName() + " " + p.getLastName());
            addItem.getItemProperty("Weight").setValue(50 + r.nextInt(60));
        }

    }
View Full Code Here

        return new BeanItem<Product>(new Product("Computer Monitor", 399.99f,
                "A monitor that can display both color and black and white."));
    }

    private BeanItem<Person> createPersonItem() {
        Person person = new Person("First", "Last", "foo@vaadin.com",
                "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");

        BeanItem<Person> personItem = new BeanItem<Person>(person);
        // add nested properties from address
        personItem.expandProperty("address");
View Full Code Here

    private Log log = new Log(5);

    @Override
    protected void setup() {
        List<Person> list = new ArrayList<Person>();
        Person p1 = new Person();
        p1.setFirstName("John");
        p1.setLastName("Doe");
        list.add(p1);

        Person p2 = new Person();
        p2.setFirstName("Jane");
        p2.setLastName("Doe");
        list.add(p2);

        BeanItemContainer<Person> container = new BeanItemContainer<Person>(
                Person.class);
        container.addAll(list);

        ComboBox box = new ComboBox("Duplicate captions test Box");
        box.setId("ComboBox");
        box.setImmediate(true);
        box.addValueChangeListener(new ValueChangeListener() {

            @Override
            public void valueChange(
                    com.vaadin.data.Property.ValueChangeEvent event) {
                Person p = (Person) event.getProperty().getValue();
                log.log("Person = " + p.getFirstName() + " " + p.getLastName());
            }
        });
        box.setContainerDataSource(container);
        box.setItemCaptionMode(ItemCaptionMode.PROPERTY);
        box.setItemCaptionPropertyId("lastName");
View Full Code Here

        table.setSelectable(true);
        table.setImmediate(true);
        table.setNullSelectionAllowed(true);
        table.addContainerProperty("Name", String.class, null);
        table.addListener(getTableValueChangeListener());
        Person person = new Person("Teppo", "Testaaja",
                "teppo.testaaja@example.com", "", "Ruukinkatu 2–4", 20540,
                "Turku");
        Person person2 = new Person("Taina", "Testaaja",
                "taina.testaaja@example.com", "", "Ruukinkatu 2–4", 20540,
                "Turku");
        Item item = table.addItem(person);
        item.getItemProperty("Name").setValue(
                person.getFirstName() + " " + person.getLastName());
        item = table.addItem(person2);
        item.getItemProperty("Name").setValue(
                person2.getFirstName() + " " + person2.getLastName());
        return table;
    }
View Full Code Here

        PersonContainer testData = PersonContainer.createWithTestData();

        for (int i = 0; i < 10; i++) {
            Item addItem = table.addItem("Item" + i);
            Person p = testData.getIdByIndex(i);
            addItem.getItemProperty("Name").setValue(
                    p.getFirstName() + " " + p.getLastName());
            addItem.getItemProperty("Weight").setValue(50 + r.nextInt(60));
        }

    }
View Full Code Here

        setSpacing(true);
        setWidth("100%");

        VerticalLayout vl = new VerticalLayout();
        FieldGroup fg = new BeanFieldGroup<Person>(Person.class);
        fg.setItemDataSource(new BeanItem<Person>(new Person()));
        for (Object propId : fg.getUnboundPropertyIds()) {
            if (!"address".equals(propId)) {
                vl.addComponent(fg.buildAndBind(propId));
            }
        }
View Full Code Here

TOP

Related Classes of com.vaadin.tests.util.Person

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.