当前位置: 首页>>代码示例>>Java>>正文


Java PageResponse类代码示例

本文整理汇总了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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:ArtifactListPresenterImpl.java

示例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"));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:M2RepositoryServiceImplTest.java

示例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"));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:M2RepositoryServiceImplTest.java

示例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"));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:M2RepositoryServiceImplTest.java

示例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"));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:M2RepositoryServiceImplTest.java

示例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());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:M2RepositoryServiceImplTest.java

示例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());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:M2RepositoryServiceImplTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:M2RepositoryServiceImplTest.java

示例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);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:21,代码来源:M2RepositoryServiceImplTest.java

示例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());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:M2RepositoryServiceImplTest.java

示例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());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:M2RepositoryServiceImplTest.java

示例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;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:M2RepositoryServiceImplTest.java

示例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;
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:16,代码来源:FindFormDefinitionIdsQuery.java

示例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);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:13,代码来源:FormDefinitionIndexerTest.java

示例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);
    }
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:10,代码来源:QueryRpcService.java


注:本文中的org.uberfire.paging.PageResponse类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。