Search in sources :

Example 1 with SourceTable

use of org.activityinfo.ui.client.component.importDialog.model.source.SourceTable in project activityinfo by bedatadriven.

the class ColumnMappingGrid method refreshWithNewlyParsedRows.

private void refreshWithNewlyParsedRows() {
    eventBus.fireEvent(new PageChangedEvent(false, I18N.CONSTANTS.parsingRows()));
    Scheduler.get().scheduleFixedPeriod(new Scheduler.RepeatingCommand() {

        @Override
        public boolean execute() {
            SourceTable sourceTable = model.getSource();
            if (!sourceTable.parsedAllRows()) {
                sourceTable.parseNextRows(50);
                ColumnMappingGrid.this.setRowData(model.getSource().getRows());
                ColumnMappingGrid.this.getRowElement(ColumnMappingGrid.this.getRowCount() - 1).scrollIntoView();
            } else {
                ColumnMappingGrid.this.scrollColumnIntoView(0);
                eventBus.fireEvent(new PageChangedEvent(true, ""));
                return false;
            }
            return true;
        }
    }, 1);
}
Also used : Scheduler(com.google.gwt.core.client.Scheduler) SourceTable(org.activityinfo.ui.client.component.importDialog.model.source.SourceTable) PageChangedEvent(org.activityinfo.ui.client.component.importDialog.PageChangedEvent)

Aggregations

Scheduler (com.google.gwt.core.client.Scheduler)1 PageChangedEvent (org.activityinfo.ui.client.component.importDialog.PageChangedEvent)1 SourceTable (org.activityinfo.ui.client.component.importDialog.model.source.SourceTable)1