當前位置: 首頁>>代碼示例>>Java>>正文


Java PageRequest類代碼示例

本文整理匯總了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;
}
 
開發者ID:Teiid-Designer,項目名稱:teiid-webui,代碼行數:33,代碼來源:QueryResultPagedTableDisplayer.java

示例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);
    }
}
 
開發者ID:Teiid-Designer,項目名稱:teiid-webui,代碼行數:10,代碼來源:QueryRpcService.java

示例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);
    }
}
 
開發者ID:Teiid-Designer,項目名稱:teiid-webui,代碼行數:10,代碼來源:TeiidRpcService.java

示例4: getDataSources

import org.uberfire.paging.PageRequest; //導入依賴的package包/類
public PageResponse<DataSourcePageRow> getDataSources( final PageRequest pageRequest, final String filters) throws DataVirtUiException; 
開發者ID:Teiid-Designer,項目名稱:teiid-webui,代碼行數:2,代碼來源:ITeiidService.java

示例5: getQueryResults

import org.uberfire.paging.PageRequest; //導入依賴的package包/類
public PageResponse<QueryResultPageRow> getQueryResults( final PageRequest pageRequest, String dataSource, String sql ) throws DataVirtUiException; 
開發者ID:Teiid-Designer,項目名稱:teiid-webui,代碼行數:2,代碼來源:IQueryService.java


注:本文中的org.uberfire.paging.PageRequest類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。