Example usage for com.vaadin.client.widget.grid.datasources ListDataSource ListDataSource

List of usage examples for com.vaadin.client.widget.grid.datasources ListDataSource ListDataSource

Introduction

In this page you can find the example usage for com.vaadin.client.widget.grid.datasources ListDataSource ListDataSource.

Prototype

public ListDataSource(T... rows) 

Source Link

Document

Constructs a data source with a set of rows.

Usage

From source file:lh.api.showcase.client.BasicAbstractFormResultView.java

License:Apache License

@SuppressWarnings("unchecked")
@Override/*from  w ww  .ja  v a  2s  .co  m*/
public void setJson(String json, JsonParser<?> parser) {
    textArea.setText(json);
    if (parser != null) {
        try {
            grid.setDataSource(new ListDataSource<T>((List<T>) parser.parse(json)));
        } catch (NullPointerException /*| com.google.gwt.core.client.JavaScriptException*/ e) {
            logger.log(Level.SEVERE, "Error occurred while parsing the json string", e);
        }
    }
}