本文整理汇总了Java中org.uberfire.paging.PageRequest类的典型用法代码示例。如果您正苦于以下问题:Java PageRequest类的具体用法?Java PageRequest怎么用?Java PageRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PageRequest类属于org.uberfire.paging包,在下文中一共展示了PageRequest类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDataProvider
import org.uberfire.paging.PageRequest; //导入依赖的package包/类
/**
* Create DataProvider for the DataSources table
* @return the data provider
*/
private AsyncDataProvider<QueryResultPageRow> createDataProvider(final String source, final String sql) {
AsyncDataProvider<QueryResultPageRow> dataProvider = new AsyncDataProvider<QueryResultPageRow>() {
protected void onRangeChanged( HasData<QueryResultPageRow> display ) {
final Range range = display.getVisibleRange();
PageRequest request = new PageRequest( range.getStart(), range.getLength() );
queryService.getQueryResults(request, source, sql, new IRpcServiceInvocationHandler<PageResponse<QueryResultPageRow>>() {
@Override
public void onReturn(final PageResponse<QueryResultPageRow> response) {
updateRowCount( response.getTotalRowSize(), response.isTotalRowSizeExact() );
updateRowData( response.getStartRowIndex(), response.getPageRowList() );
if(response.getTotalRowSize()==0) {
refreshCompleteEvent.fire(new UiEvent(UiEventType.QUERY_RESULT_DISPLAYER_REFRESHED_NOROWS));
} else {
refreshCompleteEvent.fire(new UiEvent(UiEventType.QUERY_RESULT_DISPLAYER_REFRESHED_OK));
}
}
@Override
public void onError(Throwable error) {
errorMessage = error.getMessage();
refreshCompleteEvent.fire(new UiEvent(UiEventType.QUERY_RESULT_DISPLAYER_REFRESHED_ERROR));
}
});
}
};
return dataProvider;
}
示例2: getQueryResults
import org.uberfire.paging.PageRequest; //导入依赖的package包/类
public void getQueryResults(final PageRequest request, final String dataSource, final String sql, final IRpcServiceInvocationHandler<PageResponse<QueryResultPageRow>> handler) {
RemoteCallback<PageResponse<QueryResultPageRow>> successCallback = new DelegatingRemoteCallback<PageResponse<QueryResultPageRow>>(handler);
ErrorCallback<?> errorCallback = new DelegatingErrorCallback(handler);
try {
remoteQueryService.call(successCallback, errorCallback).getQueryResults(request,dataSource,sql);
} catch (DataVirtUiException e) {
errorCallback.error(null, e);
}
}
示例3: getDataSources
import org.uberfire.paging.PageRequest; //导入依赖的package包/类
public void getDataSources(final PageRequest request, final String filter, final IRpcServiceInvocationHandler<PageResponse<DataSourcePageRow>> handler) {
RemoteCallback<PageResponse<DataSourcePageRow>> successCallback = new DelegatingRemoteCallback<PageResponse<DataSourcePageRow>>(handler);
ErrorCallback<?> errorCallback = new DelegatingErrorCallback(handler);
try {
remoteTeiidService.call(successCallback, errorCallback).getDataSources(request,filter);
} catch (DataVirtUiException e) {
errorCallback.error(null, e);
}
}
示例4: getDataSources
import org.uberfire.paging.PageRequest; //导入依赖的package包/类
public PageResponse<DataSourcePageRow> getDataSources( final PageRequest pageRequest, final String filters) throws DataVirtUiException;
示例5: getQueryResults
import org.uberfire.paging.PageRequest; //导入依赖的package包/类
public PageResponse<QueryResultPageRow> getQueryResults( final PageRequest pageRequest, String dataSource, String sql ) throws DataVirtUiException;