/** * Replace this model's list with the specified list. * * <p> * The wrapped list should no longer be modified as the data provider cannot * detect changes to the wrapped list. Instead, call {@link #getList()} to * retrieve a wrapper that can be modified and will correctly forward changes * to displays. * * @param listToWrap the model's new list * * @see #getList() */ public void setList(List<T> listToWrap) { listWrapper = new ListWrapper(listToWrap); listWrapper.minModified = 0; listWrapper.maxModified = listWrapper.size(); listWrapper.modified = true; flush(); }
public void clear() { dataProvider.getList().clear(); dataProvider.flush(); }
public void setData(List<ShowcaseSampleDefinition> data) { dataProvider.getList().clear(); dataProvider.getList().addAll(data); dataProvider.flush(); }
public void setData(List<ShowcaseSampleDefinition> data) { dataProvider.getList().clear(); dataProvider.getList().addAll(data); dataProvider.flush(); }
public void setItems(final List<TemplateParam> items) { dataProvider.getList().clear(); dataProvider.getList().addAll(items); dataProvider.flush(); }
public void setData(List<ShowcaseSampleDefinition> data) { dataProvider.getList().clear(); dataProvider.getList().addAll(data); dataProvider.flush(); }
@OnFocus public void onFocus() { //workaround. dataProvider.flush(); dataProvider.refresh(); }
@OnClose public void onClose() { dataProvider.flush(); view.clearIssue(); }
public void loadVariableHistory(final List<ProcessVariableSummary> processVariableSummaries) { dataProvider.getList().clear(); dataProvider.getList().addAll(processVariableSummaries); dataProvider.flush(); pagination.rebuild(pager); }
public void loadVariableHistory(final List<ProcessVariableSummary> processVariableSummaries) { dataProvider.getList().clear(); dataProvider.getList().addAll(processVariableSummaries); dataProvider.flush(); pagination.rebuild(pager); }
public void addMenuItem(final DynamicMenuItem menuItem) { DynamicMenuItem existingItem = getExistingMenuItem(menuItem, null); if (existingItem == null) { getDynamicMenuItems().add(menuItem); } else { //No need to re-select edited item as DynamicMenuEditorView resets itself after *any* edit dataProvider.refresh(); } dataProvider.flush(); }
public void addMenuItem(final DynamicMenuItem menuItem) { DynamicMenuItem existingItem = getExistingMenuItem(menuItem, null); if (existingItem == null) { getDynamicMenuItems().add(menuItem); } else { //No need to re-select edited item as DynamicMenuEditorView resets itself after *any* edit dataProvider.refresh(); } dataProvider.flush(); }
private void loadDataSources(Collection<DataSourceDefInfo> dataSourceDefInfos) { dataProvider.getList().clear(); for (DataSourceDefInfo defInfo : dataSourceDefInfos) { dataProvider.getList().add(new DataSourceSelectorPageRow(defInfo)); } dataProvider.flush(); view.show(); } }
/** * Replace this model's list with the specified list. * * <p> * The wrapped list should no longer be modified as the data provider cannot * detect changes to the wrapped list. Instead, call {@link #getList()} to * retrieve a wrapper that can be modified and will correctly forward changes * to displays. * * @param listToWrap the model's new list * * @see #getList() */ public void setList(List<T> listToWrap) { listWrapper = new ListWrapper(listToWrap); listWrapper.minModified = 0; listWrapper.maxModified = listWrapper.size(); listWrapper.modified = true; flush(); }
/** * Replace this model's list with the specified list. * * <p> * The wrapped list should no longer be modified as the data provider cannot * detect changes to the wrapped list. Instead, call {@link #getList()} to * retrieve a wrapper that can be modified and will correctly forward changes * to displays. * * @param listToWrap the model's new list * * @see #getList() */ public void setList(List<T> listToWrap) { listWrapper = new ListWrapper(listToWrap); listWrapper.minModified = 0; listWrapper.maxModified = listWrapper.size(); listWrapper.modified = true; flush(); }
@Test public void testSetItems() { @SuppressWarnings("unchecked") List<TemplateParam> items = mock(List.class); presenter.setItems(items); verify(dataProviderList, times(1)).clear(); verify(dataProviderList, times(1)).addAll(items); verify(dataProvider, times(1)).flush(); }
@Test public void testClear() { presenter.clear(); verify(dataProviderList, times(1)).clear(); verify(dataProvider, times(1)).flush(); }
public void connect() { Iterator<String> titleIt = columnTitles.iterator(); Iterator<Column<T, ?>> columnIt = columns.iterator(); Iterator<Comparator<T>> comparatorIt = comparators.iterator(); ListHandler<T> handler = new ListHandler<T>(dataProvider.getList()); while (titleIt.hasNext()) { String title = titleIt.next(); Column<T, ?> column = columnIt.next(); Comparator<T> comparator = comparatorIt.next(); boolean sortable = comparator != null; column.setSortable(sortable); dataTable.addColumn(column, title); if (sortable) { handler.setComparator(column, comparator); } } dataProvider.addDataDisplay(dataTable); pager.setDisplay(dataTable); dataTable.setRowStyles(rowStyles); dataTable.addCellPreviewHandler(cellPreviewHandler); dataTable.addColumnSortHandler(handler); if (selectionModel != null) { dataTable.setSelectionModel(selectionModel, selectionEventManager); } dataProvider.flush(); } }
public void setItems(List<T> persons) { List<T> list = dataProvider.getList(); list.clear(); if (persons != null) { list.addAll(persons); } SetSelectionModel<T> selectionModel = getSelectionModel(); if (selectionModel != null) { selectionModel.clear(); } dataProvider.flush(); ColumnSortList sortList = dataTable.getColumnSortList(); sortList.clear(); if (defaultSortColumnIndex != null) { sortList.push(dataTable.getColumn(defaultSortColumnIndex)); } getPager().setDisplay(dataTable); getPager().setPage(0); }