本文整理汇总了Java中org.uberfire.paging.PageResponse类的典型用法代码示例。如果您正苦于以下问题:Java PageResponse类的具体用法?Java PageResponse怎么用?Java PageResponse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PageResponse类属于org.uberfire.paging包,在下文中一共展示了PageResponse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onRangeChanged
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Override
protected void onRangeChanged(HasData<JarListPageRow> display) {
final Range range = display.getVisibleRange();
JarListPageRequest request = new JarListPageRequest(range.getStart(),
range.getLength(),
filter,
fileFormats,
getSortColumnDataStoreName(),
isSortColumnAscending());
m2RepoService.call(new RemoteCallback<PageResponse<JarListPageRow>>() {
@Override
public void callback(final PageResponse<JarListPageRow> response) {
updateRowCount(response.getTotalRowSize(),
response.isTotalRowSizeExact());
updateRowData(response.getStartRowIndex(),
response.getPageRowList());
}
}).listArtifacts(request);
}
示例2: testListFilesWithSortOnNameAscending
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithSortOnNameAscending() throws Exception {
deployArtifact(gavBackend1);
deployArtifact(gavBackend2);
//Sort by Name ascending
final PageResponse<JarListPageRow> response = assertFilesCount(null,
null,
JarListPageRequest.COLUMN_NAME,
true,
4);
final List<JarListPageRow> files = response.getPageRowList();
final String fileName0 = files.get(0).getName();
final String fileName2 = files.get(2).getName();
assertTrue(fileName0.startsWith("guvnor-m2repo-editor-backend1"));
assertTrue(fileName2.startsWith("guvnor-m2repo-editor-backend2"));
}
示例3: testListFilesWithSortOnNameDescending
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithSortOnNameDescending() throws Exception {
deployArtifact(gavBackend1);
deployArtifact(gavBackend2);
//Sort by Name descending
final PageResponse<JarListPageRow> response = assertFilesCount(null,
null,
JarListPageRequest.COLUMN_NAME,
false,
4);
final List<JarListPageRow> files = response.getPageRowList();
final String fileName0 = files.get(0).getName();
final String fileName2 = files.get(2).getName();
assertTrue(fileName0.startsWith("guvnor-m2repo-editor-backend2"));
assertTrue(fileName2.startsWith("guvnor-m2repo-editor-backend1"));
}
示例4: testListFilesWithSortOnPathAscending
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithSortOnPathAscending() throws Exception {
deployArtifact(gavBackend1);
deployArtifact(gavBackend2);
//Sort by Path ascending
final PageResponse<JarListPageRow> response = assertFilesCount(null,
null,
JarListPageRequest.COLUMN_PATH,
true,
4);
final List<JarListPageRow> files = response.getPageRowList();
final String filePath0 = files.get(0).getPath();
final String filePath2 = files.get(2).getPath();
assertTrue(filePath0.contains("guvnor-m2repo-editor-backend1"));
assertTrue(filePath2.contains("guvnor-m2repo-editor-backend2"));
}
示例5: testListFilesWithSortOnPathDescending
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithSortOnPathDescending() throws Exception {
deployArtifact(gavBackend1);
deployArtifact(gavBackend2);
//Sort by Path descending
final PageResponse<JarListPageRow> response = assertFilesCount(null,
null,
JarListPageRequest.COLUMN_PATH,
false,
4);
final List<JarListPageRow> files = response.getPageRowList();
final String filePath0 = files.get(0).getPath();
final String filePath2 = files.get(2).getPath();
assertTrue(filePath0.contains("guvnor-m2repo-editor-backend2"));
assertTrue(filePath2.contains("guvnor-m2repo-editor-backend1"));
}
示例6: testListFilesWithSortOnGavAscending
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithSortOnGavAscending() throws Exception {
deployArtifact(gavBackend1);
deployArtifact(gavBackend2);
//Sort by GAV ascending
final PageResponse<JarListPageRow> response = assertFilesCount(null,
null,
JarListPageRequest.COLUMN_GAV,
true,
4);
final List<JarListPageRow> files = response.getPageRowList();
final GAV gav0 = files.get(0).getGav();
final GAV gav2 = files.get(2).getGav();
assertEquals("guvnor-m2repo-editor-backend1",
gav0.getArtifactId());
assertEquals("guvnor-m2repo-editor-backend2",
gav2.getArtifactId());
}
示例7: testListFilesWithSortOnGavDescending
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithSortOnGavDescending() throws Exception {
deployArtifact(gavBackend1);
deployArtifact(gavBackend2);
//Sort by GAV descending
final PageResponse<JarListPageRow> response = assertFilesCount(null,
null,
JarListPageRequest.COLUMN_GAV,
false,
4);
final List<JarListPageRow> files = response.getPageRowList();
final GAV gav0 = files.get(0).getGav();
final GAV gav2 = files.get(2).getGav();
assertEquals("guvnor-m2repo-editor-backend2",
gav0.getArtifactId());
assertEquals("guvnor-m2repo-editor-backend1",
gav2.getArtifactId());
}
示例8: testListFilesWithSortOnLastModifiedAscending
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithSortOnLastModifiedAscending() throws Exception {
deployArtifact(gavBackend1);
//Wait a bit before deploying other file (to ensure different Last Modified times)
Thread.sleep(2000);
//This installs a JAR and a POM
deployArtifact(gavBackend2);
//Sort by Last Modified ascending
final PageResponse<JarListPageRow> response = assertFilesCount(null,
null,
JarListPageRequest.COLUMN_LAST_MODIFIED,
true,
4);
final List<JarListPageRow> files = response.getPageRowList();
final Long fileTime0 = files.get(0).getLastModified().getTime();
final Long fileTime2 = files.get(2).getLastModified().getTime();
assertTrue(fileTime0.compareTo(fileTime2) < 0);
}
示例9: testListFilesWithSortOnLastModifiedDescending
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithSortOnLastModifiedDescending() throws Exception {
deployArtifact(gavBackend1);
//Wait a bit before deploying other file (to ensure different Last Modified times)
Thread.sleep(2000);
deployArtifact(gavBackend2);
//Sort by Last Modified descending
final PageResponse<JarListPageRow> response = assertFilesCount(null,
null,
JarListPageRequest.COLUMN_LAST_MODIFIED,
false,
4);
final List<JarListPageRow> files = response.getPageRowList();
final Long fileTime0 = files.get(0).getLastModified().getTime();
final Long fileTime2 = files.get(2).getLastModified().getTime();
assertTrue(fileTime0.compareTo(fileTime2) > 0);
}
示例10: testListFilesWithPageSize
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithPageSize() throws Exception {
//Deploy 2 files (equating to 4 files)
deployArtifact(gavBackend1);
deployArtifact(gavBackend2);
final JarListPageRequest request = new JarListPageRequest(0,
10,
null,
null,
null,
true);
final PageResponse<JarListPageRow> response = service.listArtifacts(request);
assertEquals(4,
response.getPageRowList().size());
}
示例11: testListFilesWithStartBeyondMaximum
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Test
public void testListFilesWithStartBeyondMaximum() throws Exception {
//Deploy 2 files (equating to 4 files)
deployArtifact(gavBackend1);
deployArtifact(gavBackend2);
final JarListPageRequest request = new JarListPageRequest(10,
10,
null,
null,
null,
true);
final PageResponse<JarListPageRow> response = service.listArtifacts(request);
assertEquals(0,
response.getPageRowList().size());
}
示例12: assertFilesCount
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
private PageResponse<JarListPageRow> assertFilesCount(final String filters,
final List<String> fileFormats,
final String dataSourceName,
final boolean isAscending,
final int filesCount) {
final JarListPageRequest request = new JarListPageRequest(0,
null,
filters,
fileFormats,
dataSourceName,
isAscending);
final PageResponse<JarListPageRow> response = service.listArtifacts(request);
assertEquals(filesCount,
response.getPageRowList().size());
return response;
}
示例13: buildResponse
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
@Override
public PageResponse<RefactoringPageRow> buildResponse(final int pageSize,
final int startRow,
final List<KObject> kObjects) {
final int hits = kObjects.size();
final PageResponse<RefactoringPageRow> response = new PageResponse<RefactoringPageRow>();
final List<RefactoringPageRow> result = buildResponse(kObjects);
response.setTotalRowSize(hits);
response.setPageRowList(result);
response.setTotalRowSizeExact(true);
response.setStartRowIndex(startRow);
response.setLastPage((pageSize * startRow + 2) >= hits);
return response;
}
示例14: getFormResources
import org.uberfire.paging.PageResponse; //导入依赖的package包/类
private PageResponse<RefactoringPageRow> getFormResources() throws IllegalArgumentException {
final RefactoringPageRequest request = new RefactoringPageRequest(FindResourcesQuery.NAME,
new HashSet<ValueIndexTerm>() {{
add(new ValueResourceIndexTerm("*",
ResourceType.FORM,
ValueIndexTerm.TermSearchType.WILDCARD));
}},
0,
10);
return service.query(request);
}
示例15: getQueryResults
import org.uberfire.paging.PageResponse; //导入依赖的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);
}
}