![JAR search and dependency download from the Maven repository](/logo.png)
com.extjs.gxt.ui.client.data.JsonPagingLoadResultReader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gxt Show documentation
Show all versions of gxt Show documentation
Rich Internet Application Framework for GWT
/*
* Sencha GXT 2.3.0 - Sencha for GWT
* Copyright(c) 2007-2013, Sencha, Inc.
* [email protected]
*
* http://www.sencha.com/products/gxt/license/
*/
package com.extjs.gxt.ui.client.data;
import java.util.List;
/**
* A JsonReader
implementation that reads JSON data using a
* ModelType
definition and returns a paging list load result.
*
* @param the ListLoadResult
type being returned by the reader
*/
public class JsonPagingLoadResultReader extends JsonLoadResultReader {
/**
* Creates a new reader.
*
* @param modelType the model type definition
*/
public JsonPagingLoadResultReader(ModelType modelType) {
super(modelType);
}
@Override
protected Object createReturnData(Object loadConfig, List records, int totalCount) {
ListLoadResult> result = (ListLoadResult>) super.createReturnData(loadConfig, records, totalCount);
if (result instanceof PagingLoadResult) {
PagingLoadResult> r = (PagingLoadResult>) result;
r.setTotalLength(totalCount);
if (loadConfig instanceof PagingLoadConfig) {
PagingLoadConfig config = (PagingLoadConfig) loadConfig;
r.setOffset(config.getOffset());
}
}
return result;
}
@Override
protected BasePagingLoadResult newLoadResult(Object loadConfig, List models) {
return new BasePagingLoadResult(models);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy