@Override public void setTableSelection(TableDto tableDto, int index) { int pageIndex = index / table.getPageSize(); if (pageIndex != pager.getPage()) { pager.setPage(pageIndex); } table.getSelectionModel().setSelected(tableDto, true); }
@Override public void afterRenderRows() { dataProvider.refresh(); boolean enableItem = table.getRowCount() > 0; pager.setVisible(table.getRowCount() > Table.DEFAULT_PAGESIZE); downloadDictionary.setEnabled(enableItem); exportData.setDisabled(!enableItem); copyData.setDisabled(!enableItem); table.hideLoadingIndicator(); }
@Override public void beforeRenderRows() { pager.setVisible(false); table.showLoadingIndicator(dataProvider); }
private void addTableColumns() { table.addColumn( new Column<TableDto, TableDto>( new PlaceRequestCell<TableDto>(placeManager) { @Override public PlaceRequest getPlaceRequest(TableDto value) { return ProjectPlacesHelper.getTablePlace( value.getDatasourceName(), value.getName()); } @Override public String getText(TableDto value) { String name = value.getName(); return value.hasViewLink() ? "<i class=\"icon-cog\"></i> " + name : "<i class=\"icon-table\"></i> " + name; } }) { @Override public TableDto getValue(TableDto object) { return object; } }, translations.nameLabel()); table.addColumn( new TextColumn<TableDto>() { @Override public String getValue(TableDto object) { return object.getEntityType(); } }, translations.entityTypeColumnLabel()); table.addColumn( new TextColumn<TableDto>() { @Override public String getValue(TableDto object) { return Integer.toString(object.getVariableCount()); } }, translations.variablesLabel()); table.addColumn( new TextColumn<TableDto>() { @Override public String getValue(TableDto object) { return Integer.toString(object.getValueSetCount()); } }, translations.entitiesLabel()); dataProvider.addDataDisplay(table); table.setSelectionModel(new SingleSelectionModel<TableDto>()); table.setPageSize(Table.DEFAULT_PAGESIZE); table.setEmptyTableWidget(new InlineLabel(translations.noTablesLabel())); pager.setDisplay(table); }