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


Java AsyncDataProvider类代码示例

本文整理汇总了Java中com.google.gwt.view.client.AsyncDataProvider的典型用法代码示例。如果您正苦于以下问题:Java AsyncDataProvider类的具体用法?Java AsyncDataProvider怎么用?Java AsyncDataProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AsyncDataProvider类属于com.google.gwt.view.client包,在下文中一共展示了AsyncDataProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createProvider

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
private void createProvider() {
    dataProvider = new AsyncDataProvider<DataGridFilterSummary>() {

        @Override
        protected void onRangeChanged(HasData<DataGridFilterSummary> display) {

            final Range visibleRange = display.getVisibleRange();
            List<DataGridFilterSummary> currentCustomFilters = getData();
            dataProvider.updateRowCount(currentCustomFilters.size(),
                                        true);
            int endRange;
            if (visibleRange.getStart() + 5 < currentCustomFilters.size()) {

                endRange = visibleRange.getStart() + 5;
            } else {
                endRange = currentCustomFilters.size();
            }
            dataProvider.updateRowData(visibleRange.getStart(),
                                       currentCustomFilters.subList(visibleRange.getStart(),
                                                                    endRange));
        }
    };
    existingFiltersGrid.setDataProvider(dataProvider);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:25,代码来源:NewFilterPopup.java

示例2: VersionHistoryPresenter

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@Inject
public VersionHistoryPresenter(
        final VersionHistoryPresenterView view,
        Caller<VersionService> versionService,
        Event<VersionSelectedEvent> versionSelectedEvent) {
    this.view = view;
    this.versionService = versionService;
    this.versionSelectedEvent = versionSelectedEvent;

    view.setPresenter(this);
    dataProvider = new AsyncDataProvider<VersionRecord>() {
        @Override
        protected void onRangeChanged(HasData<VersionRecord> display) {
            if (records != null) {
                updateRowCount(records.size(),
                               true);
                updateRowData(0,
                              records);
            }
        }
    };
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:VersionHistoryPresenter.java

示例3: testLoadHistory

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@Test
public void testLoadHistory() throws Exception {

    VersionRecord versionRecord1 = getVersionRecord("111");
    records.add(versionRecord1);
    VersionRecord versionRecord2 = getVersionRecord("222");
    records.add(versionRecord2);
    VersionRecord versionRecord3 = getVersionRecord("333");
    records.add(versionRecord3);

    screen.init(path333);

    screen.refresh("333");

    verify(view).setup(eq("333"),
                       any(AsyncDataProvider.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:VersionHistoryPresenterTest.java

示例4: testVersionChanges

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@Test
public void testVersionChanges() throws Exception {
    VersionRecord versionRecord1 = getVersionRecord("111");
    records.add(versionRecord1);
    VersionRecord versionRecord2 = getVersionRecord("222");
    records.add(versionRecord2);

    screen.init(path222);

    screen.refresh("222");

    verify(view).setup(eq("222"),
                       any(AsyncDataProvider.class));

    Path pathToFile = mock(Path.class);
    when(pathToFile.toURI()).thenReturn("hehe//test.file");
    screen.onVersionChange(new VersionSelectedEvent(pathToFile,
                                                    versionRecord1));

    verify(view).setup(eq("111"),
                       any(AsyncDataProvider.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:VersionHistoryPresenterTest.java

示例5: testVersionChangeForSomeOtherFile

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@Test
public void testVersionChangeForSomeOtherFile() throws Exception {
    VersionRecord versionRecord1 = getVersionRecord("111");
    records.add(versionRecord1);
    VersionRecord versionRecord2 = getVersionRecord("222");
    records.add(versionRecord2);

    screen.init(path222);

    screen.refresh("222");

    verify(view).setup(eq("222"),
                       any(AsyncDataProvider.class));

    Path pathToFile = mock(Path.class);
    when(pathToFile.toURI()).thenReturn("hehe//another.file");
    screen.onVersionChange(new VersionSelectedEvent(pathToFile,
                                                    getVersionRecord("111")));

    verify(view).setup(eq("222"),
                       any(AsyncDataProvider.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:VersionHistoryPresenterTest.java

示例6: ProjectClassList

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@Inject
public ProjectClassList( ProjectClassListView view ) {
    this.view = view;
    view.setPresenter( this );
    dataProvider = new AsyncDataProvider<ClassRow>() {
        @Override
        protected void onRangeChanged( HasData<ClassRow> display ) {
            if ( classes != null ) {
                updateRowCount( classes.size(), true );
                updateRowData( 0, classes );
            } else {
                updateRowCount( 0, true );
                updateRowData( 0, new ArrayList<ClassRow>(  ) );
            }
        }
    };
    view.setDataProvider( dataProvider );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:19,代码来源:ProjectClassList.java

示例7: testInitialize

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@Test
public void testInitialize() {

    DatabaseSchemaExplorer.Settings settings = new DatabaseSchemaExplorer.Settings().dataSourceUuid( DATASOURCE_ID );

    when( metadataService.getMetadata( settings.dataSourceUuid(), false, true ) ).thenReturn( metadata );
    when( metadata.getSchemas() ).thenReturn( schemas );
    when( translationService.getTranslation(
            DataSourceManagementConstants.DatabaseSchemaExplorerViewImpl_loadingDbSchemas ) ).thenReturn( LOADING_MESSAGE1 );

    schemaExplorer.initialize( settings );

    // expected rows
    List<DatabaseSchemaRow> rows = new ArrayList<>(  );
    for ( SchemaMetadata schema : schemas ) {
        rows.add( new DatabaseSchemaRow( schema.getSchemaName() ) );
    }
    assertEquals( rows, schemaExplorer.getItems() );

    // the UI should have been updated.
    verify( view, times( 1 ) ).setDataProvider( any( AsyncDataProvider.class ) );
    verify( view, times( 1 ) ).showBusyIndicator( LOADING_MESSAGE1 );
    verify( view, times( 1 ) ).hideBusyIndicator();
    verify( view, times( 2 ) ).redraw();
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:26,代码来源:DatabaseSchemaExplorerTest.java

示例8: CrudComponentTestHelper

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
public CrudComponentTestHelper(IsFormView<FORM_MODEL> formView,
                               List<CrudModel> listModels) {
    this.formView = formView;
    this.models = listModels;
    dataProvider = new AsyncDataProvider<CrudModel>() {
        @Override
        protected void onRangeChanged(HasData<CrudModel> hasData) {
            if (models != null) {
                updateRowCount(models.size(),
                               true);
                updateRowData(0,
                              models);
            } else {
                updateRowCount(0,
                               true);
                updateRowData(0,
                              new ArrayList<CrudModel>());
            }
        }
    };
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:22,代码来源:CrudComponentTestHelper.java

示例9: doInit

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
protected void doInit() {
    dataProvider = new AsyncDataProvider<TableEntry<TYPE>>() {
        @Override
        protected void onRangeChanged(HasData<TableEntry<TYPE>> display) {
            if (tableValues != null) {
                updateRowCount(tableValues.size(),
                               true);
                updateRowData(0,
                              tableValues);
            } else {
                updateRowCount(0,
                               true);
                updateRowData(0,
                              new ArrayList<>());
            }
        }
    };

    view.init(this);
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:21,代码来源:MultipleInputComponent.java

示例10: createDataProvider

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的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

示例11: setup

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@Override
public void setup(String version,
                  AsyncDataProvider<VersionRecord> dataProvider) {
    this.version = version;
    if (!dataProvider.getDataDisplays().contains(table)) {
        dataProvider.addDataDisplay(table);
    }
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:9,代码来源:VersionHistoryPresenterViewImpl.java

示例12: setup

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@Before
public void setup() {
    presenter = new ProjectClassList(view);
    presenter.addLoadClassesHandler(mockLoadClassesHandler);
    verify(view,
           times(1)).setPresenter(any(ProjectClassList.class));
    verify(view,
           times(1)).setDataProvider(any(AsyncDataProvider.class));
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:10,代码来源:ProjectClassListTest.java

示例13: init

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@PostConstruct
protected void init( ) {
    setObjectOptions( );
    dataProvider = new AsyncDataProvider< DatabaseObjectRow >( ) {
        @Override
        protected void onRangeChanged( HasData< DatabaseObjectRow > display ) {
            updateRowCount( rows.size( ), true );
            updateRowData( 0, rows );
        }
    };
    view.setDataProvider( dataProvider );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:13,代码来源:DatabaseObjectExplorer.java

示例14: init

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
@PostConstruct
protected void init( ) {
    dataProvider = new AsyncDataProvider< DatabaseSchemaRow >( ) {
        @Override
        protected void onRangeChanged( HasData< DatabaseSchemaRow > display ) {
            updateRowCount( rows.size( ), true );
            updateRowData( 0, rows );
        }
    };
    view.setDataProvider( dataProvider );
}
 
开发者ID:kiegroup,项目名称:kie-wb-common,代码行数:12,代码来源:DatabaseSchemaExplorer.java

示例15: setDataProvider

import com.google.gwt.view.client.AsyncDataProvider; //导入依赖的package包/类
/**
 * Link a data provider to the table
 * @param dProvider the async data provider
 */
public void setDataProvider( final AsyncDataProvider<T> dProvider ) {
    this.dataProvider = dProvider;
    this.dataProvider.addDataDisplay( dataGrid );
}
 
开发者ID:Teiid-Designer,项目名称:teiid-webui,代码行数:9,代码来源:PagedTable.java


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