diff options
author | Teemu Suo-Anttila <teemusa@vaadin.com> | 2016-02-11 10:15:15 +0100 |
---|---|---|
committer | Vaadin Code Review <review@vaadin.com> | 2016-03-14 09:07:39 +0000 |
commit | 888fec0669c3a34ffaedb883029b37b10b00399a (patch) | |
tree | d9ad6aebdb696e47414bf9494ce08b0900b64014 /uitest/src/com | |
parent | acab3d3c0c8eda303a8aa331ba5b17d38164542a (diff) | |
download | vaadin-framework-888fec0669c3a34ffaedb883029b37b10b00399a.tar.gz vaadin-framework-888fec0669c3a34ffaedb883029b37b10b00399a.zip |
Initial import of TypedGrid component
This patch introduces a generics version of Grid.
Change-Id: I0777a0468ccb5f38e266aa0f33ceb8d0324d72dd
Diffstat (limited to 'uitest/src/com')
-rw-r--r-- | uitest/src/com/vaadin/tests/proto/TypedGridUI.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/proto/TypedGridUI.java b/uitest/src/com/vaadin/tests/proto/TypedGridUI.java new file mode 100644 index 0000000000..41eaa6c71e --- /dev/null +++ b/uitest/src/com/vaadin/tests/proto/TypedGridUI.java @@ -0,0 +1,45 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.proto; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Random; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.fieldgroup.ComplexPerson; +import com.vaadin.ui.proto.TypedGrid; + +public class TypedGridUI extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + addComponent(new TypedGrid<ComplexPerson>(ComplexPerson.class, + createPersons(100))); + } + + private static Collection<ComplexPerson> createPersons(int count) { + Random r = new Random(1337); + List<ComplexPerson> list = new ArrayList<ComplexPerson>(); + for (int i = 0; i < count; ++i) { + list.add(ComplexPerson.create(r)); + } + return list; + } + +} |