List of usage examples for com.google.gwt.view.client ListDataProvider ListDataProvider
public ListDataProvider(List<T> listToWrap, ProvidesKey<T> keyProvider)
From source file:org.mindinformatics.gwt.domeo.plugins.annotation.persistence.ui.existingsets.AnnotationSetTreeViewModel.java
License:Apache License
@Override public <T> NodeInfo<?> getNodeInfo(T value) { if (value == null) { // Return top level categories. return new DefaultNodeInfo<Category>(categoryDataProvider, new CategoryCell()); } else if (value instanceof Category) { // Return the first letters of each first name. Category category = (Category) value; List<AnnotationSetInfo> contacts = parent.queryContactsByCategory(category); ListDataProvider<AnnotationSetInfo> dataProvider = new ListDataProvider<AnnotationSetInfo>(contacts, AnnotationSetInfo.KEY_PROVIDER); return new DefaultNodeInfo<AnnotationSetInfo>(dataProvider, contactCell, selectionModel, selectionManager, null); }/*from w ww .java 2 s. co m*/ // Unhandled type. String type = value.getClass().getName(); throw new IllegalArgumentException("Unsupported object type: " + type); }