List of usage examples for com.google.gwt.user.cellview.client Column setFieldUpdater
public void setFieldUpdater(FieldUpdater<T, C> fieldUpdater)
From source file:stroom.cache.client.presenter.CacheListPresenter.java
License:Apache License
@Inject public CacheListPresenter(final EventBus eventBus, final ClientDispatchAsync dispatcher, final TooltipPresenter tooltipPresenter) { super(eventBus, new DataGridViewImpl<CacheRow>(true)); // Name//from www . j a v a 2 s .com getView().addResizableColumn(new Column<CacheRow, String>(new TextCell()) { @Override public String getValue(final CacheRow row) { return row.getCacheName(); } }, "Name", 400); // Clear. final Column<CacheRow, String> clearColumn = new Column<CacheRow, String>(new ButtonCell()) { @Override public String getValue(final CacheRow row) { return "Clear"; } }; clearColumn.setFieldUpdater(new FieldUpdater<CacheRow, String>() { @Override public void update(final int index, final CacheRow row, final String value) { dispatcher.execute(new CacheClearAction(row.getCacheName(), null), null); } }); getView().addColumn(clearColumn, "</br>", 50); getView().addEndColumn(new EndColumn<CacheRow>()); dataProvider = new ActionDataProvider<CacheRow>(dispatcher, action); dataProvider.addDataDisplay(getView().getDataDisplay()); }
From source file:stroom.cache.client.presenter.CacheNodeListPresenter.java
License:Apache License
@Inject public CacheNodeListPresenter(final EventBus eventBus, final ClientDispatchAsync dispatcher, final TooltipPresenter tooltipPresenter) { super(eventBus, new DataGridViewImpl<CacheNodeRow>(false)); this.dispatcher = dispatcher; this.tooltipPresenter = tooltipPresenter; // Info./* w w w .ja v a 2s. co m*/ addInfoColumn(); // Node. getView().addResizableColumn(new Column<CacheNodeRow, String>(new TextCell()) { @Override public String getValue(final CacheNodeRow row) { return row.getNode().getName(); } }, "Node", MEDIUM_COL); // Hits. getView().addResizableColumn(new Column<CacheNodeRow, String>(new TextCell()) { @Override public String getValue(final CacheNodeRow row) { return Long.toString(row.getCacheInfo().getCacheHits()); } }, "Hits", SMALL_COL); // Misses. getView().addResizableColumn(new Column<CacheNodeRow, String>(new TextCell()) { @Override public String getValue(final CacheNodeRow row) { return Long.toString(row.getCacheInfo().getCacheMisses()); } }, "Misses", SMALL_COL); // Objects. getView().addResizableColumn(new Column<CacheNodeRow, String>(new TextCell()) { @Override public String getValue(final CacheNodeRow row) { return Long.toString(row.getCacheInfo().getObjectCount()); } }, "Objects", SMALL_COL); // Clear. final Column<CacheNodeRow, String> clearColumn = new Column<CacheNodeRow, String>(new ButtonCell()) { @Override public String getValue(final CacheNodeRow row) { return "Clear"; } }; clearColumn.setFieldUpdater(new FieldUpdater<CacheNodeRow, String>() { @Override public void update(final int index, final CacheNodeRow row, final String value) { dispatcher.execute(new CacheClearAction(row.getCacheInfo().getName(), row.getNode()), null); } }); getView().addColumn(clearColumn, "</br>", 50); getView().addEndColumn(new EndColumn<CacheNodeRow>()); }
From source file:stroom.dashboard.client.table.FieldCell.java
License:Apache License
public static FieldCell create(final FieldsManager fieldsManager) { final List<HasCell<Field, ?>> cells = new ArrayList<HasCell<Field, ?>>(); final Column<Field, String> name = new Column<Field, String>(new FieldEditTextCell(fieldsManager)) { @Override//from w w w. j a v a 2 s . co m public String getValue(final Field field) { return field.getName(); } }; name.setFieldUpdater(new FieldUpdater<Field, String>() { @Override public void update(final int index, final Field object, final String value) { object.setName(value); } }); cells.add(name); final Column<Field, ImageResource> group = new Column<Field, ImageResource>(new ImageResourceCell()) { @Override public ImageResource getValue(final Field field) { if (field.getGroup() == null) { return null; } else { return fieldsManager.getResources().group(); } } }; cells.add(group); final Column<Field, SafeHtml> groupNo = new Column<Field, SafeHtml>(new SafeHtmlCell()) { @Override public SafeHtml getValue(final Field field) { if (field.getGroup() == null) { return SafeHtmlUtils.EMPTY_SAFE_HTML; } else { return SafeHtmlUtils .fromTrustedString("<div class=\"" + fieldsManager.getResources().style().sortOrder() + "\">" + (field.getGroup() + 1) + "</div>"); } } }; cells.add(groupNo); final Column<Field, ImageResource> sort = new Column<Field, ImageResource>(new ImageResourceCell()) { @Override public ImageResource getValue(final Field field) { if (field.getSort() == null) { return null; } else if (Sort.SortDirection.ASCENDING == field.getSort().getDirection()) { return fieldsManager.getResources().sortaz(); } else { return fieldsManager.getResources().sortza(); } } }; cells.add(sort); final Column<Field, SafeHtml> sortOrder = new Column<Field, SafeHtml>(new SafeHtmlCell()) { @Override public SafeHtml getValue(final Field field) { if (field.getSort() == null) { return SafeHtmlUtils.EMPTY_SAFE_HTML; } else { return SafeHtmlUtils .fromTrustedString("<div class=\"" + fieldsManager.getResources().style().sortOrder() + "\">" + (field.getSort().getOrder() + 1) + "</div>"); } } }; cells.add(sortOrder); final Column<Field, ImageResource> filter = new Column<Field, ImageResource>(new ImageResourceCell()) { @Override public ImageResource getValue(final Field field) { final Filter filter = field.getFilter(); if (filter != null) { if ((filter.getIncludes() != null && filter.getIncludes().trim().length() > 0) || (filter.getExcludes() != null && filter.getExcludes().trim().length() > 0)) { return fieldsManager.getResources().filter(); } } return null; } }; cells.add(filter); return new FieldCell(cells); }
From source file:stroom.dashboard.client.table.TablePresenter.java
License:Apache License
private void addExpanderColumn(final int maxDepth) { // Expander column. final Column<Row, Expander> column = new Column<Row, Expander>(new ExpanderCell()) { @Override//from www. j av a 2 s . co m public Expander getValue(final Row row) { if (row == null) { return null; } if (row.getDepth() < maxDepth) { // Set the width of the expander column if it needs to be // made wider. final int width = 16 + (row.getDepth() * 10); if (width > currentExpanderColumnWidth) { currentExpanderColumnWidth = width; lastExpanderColumnWidth = width; getView().setColumnWidth(this, width, Unit.PX); } final boolean open = tableResultRequest.isGroupOpen(row.getGroupKey()); return new Expander(row.getDepth(), open, false); } else if (row.getDepth() > 0) { return new Expander(row.getDepth(), false, true); } return null; } }; column.setFieldUpdater(new FieldUpdater<Row, Expander>() { @Override public void update(final int index, final Row result, final Expander value) { tableResultRequest.setGroupOpen(result.getGroupKey(), !value.isExpanded()); refresh(); } }); getView().addColumn(column, "<br/>", lastExpanderColumnWidth); existingColumns.add(column); }
From source file:stroom.explorer.client.presenter.TypeFilterPresenter.java
License:Apache License
@Inject public TypeFilterPresenter(final EventBus eventBus) { super(eventBus, new CellTableViewImpl<DocumentType>(false, (Resources) GWT.create(BasicResources.class))); this.eventBus = eventBus; // Checked.//from w w w. ja va2 s . c o m final Column<DocumentType, TickBoxState> checkedColumn = new Column<DocumentType, TickBoxState>( new TickBoxCell(false, true)) { @Override public TickBoxState getValue(final DocumentType object) { return TickBoxState.fromBoolean(selected.contains(object.getType())); } }; checkedColumn.setFieldUpdater(new FieldUpdater<DocumentType, TickBoxState>() { @Override public void update(final int index, final DocumentType object, final TickBoxState value) { if (selected.contains(object.getType())) { selected.remove(object.getType()); } else { selected.add(object.getType()); } DataSelectionEvent.fire(TypeFilterPresenter.this, TypeFilterPresenter.this, false); } }); getView().addColumn(checkedColumn); // Icon. final Column<DocumentType, SafeUri> iconColumn = new Column<DocumentType, SafeUri>(new SafeImageCell()) { @Override public SafeUri getValue(final DocumentType object) { return UriUtils.fromString(ImageUtil.getImageURL() + object.getIconUrl()); } }; getView().addColumn(iconColumn); // Text. final Column<DocumentType, String> textColumn = new Column<DocumentType, String>(new TextCell()) { @Override public String getValue(final DocumentType object) { return object.getType(); } }; getView().addColumn(textColumn); final Style style = getView().asWidget().getElement().getStyle(); style.setPaddingLeft(1, Unit.PX); style.setPaddingRight(3, Unit.PX); style.setPaddingTop(2, Unit.PX); style.setPaddingBottom(1, Unit.PX); }
From source file:stroom.importexport.client.presenter.ImportConfigConfirmPresenter.java
License:Apache License
private void addSelectedColumn() { final TickBoxCell.MarginAppearance tickBoxAppearance = GWT.create(TickBoxCell.MarginAppearance.class); // Select Column final Column<EntityActionConfirmation, TickBoxState> column = new Column<EntityActionConfirmation, TickBoxState>( new TickBoxCell(tickBoxAppearance, false, false)) { @Override//from ww w . j av a 2s.c om public TickBoxState getValue(final EntityActionConfirmation object) { return TickBoxState.fromBoolean(object.isAction()); } }; final Header<TickBoxState> header = new Header<TickBoxState>( new TickBoxCell(tickBoxAppearance, false, false)) { @Override public TickBoxState getValue() { return getHeaderState(); } }; dataGridView.addColumn(column, header, 15); // Add Handlers column.setFieldUpdater(new FieldUpdater<EntityActionConfirmation, TickBoxState>() { @Override public void update(final int index, final EntityActionConfirmation row, final TickBoxState value) { row.setAction(value.toBoolean()); } }); header.setUpdater(new ValueUpdater<TickBoxState>() { @Override public void update(final TickBoxState value) { if (confirmList != null) { if (value.equals(TickBoxState.UNTICK)) { for (final EntityActionConfirmation item : confirmList) { item.setAction(false); } } if (value.equals(TickBoxState.TICK)) { for (final EntityActionConfirmation item : confirmList) { item.setAction(true); } } // Refresh list dataGridView.setRowData(0, confirmList); dataGridView.setRowCount(confirmList.size()); } } }); }
From source file:stroom.index.client.presenter.IndexShardPresenter.java
License:Apache License
private void addSelectedColumn() { final TickBoxCell.MarginAppearance tickBoxAppearance = GWT.create(TickBoxCell.MarginAppearance.class); // Select Column final Column<IndexShard, TickBoxState> column = new Column<IndexShard, TickBoxState>( new TickBoxCell(tickBoxAppearance, false, false)) { @Override//from w ww . j a v a 2 s . c o m public TickBoxState getValue(final IndexShard indexShard) { final boolean match = Boolean.TRUE.equals(criteria.getIndexShardSet().getMatchAll()) || criteria.getIndexShardSet().contains(indexShard.getId()); return TickBoxState.fromBoolean(match); } }; final Header<TickBoxState> header = new Header<TickBoxState>( new TickBoxCell(tickBoxAppearance, false, false)) { @Override public TickBoxState getValue() { if (Boolean.TRUE.equals(criteria.getIndexShardSet().getMatchAll())) { return TickBoxState.TICK; } else if (criteria.getIndexShardSet().getSet().size() > 0) { return TickBoxState.HALF_TICK; } return TickBoxState.UNTICK; } }; getView().addColumn(column, header, 15); // Add Handlers header.setUpdater(value -> { if (value.equals(TickBoxState.UNTICK)) { criteria.getIndexShardSet().clear(); criteria.getIndexShardSet().setMatchAll(false); } else if (value.equals(TickBoxState.TICK)) { criteria.getIndexShardSet().clear(); criteria.getIndexShardSet().setMatchAll(true); } if (dataProvider != null) { dataProvider.updateRowData(dataProvider.getRanges()[0].getStart(), resultList); } enableButtons(); }); column.setFieldUpdater((index, row, value) -> { if (value.toBoolean()) { criteria.getIndexShardSet().add(row); } else { // De-selecting one and currently matching all ? if (Boolean.TRUE.equals(criteria.getIndexShardSet().getMatchAll())) { criteria.getIndexShardSet().setMatchAll(false); criteria.getIndexShardSet().addAll(getResultStreamIdSet()); } criteria.getIndexShardSet().remove(row); } enableButtons(); }); }
From source file:stroom.jobsystem.client.presenter.JobListPresenter.java
License:Apache License
@Inject public JobListPresenter(final EventBus eventBus, final ClientDispatchAsync dispatcher, final TooltipPresenter tooltipPresenter) { super(eventBus, new DataGridViewImpl<Job>(true)); jobSaver = new SaveQueue<Job>(dispatcher); getView().addColumn(new InfoHelpLinkColumn<Job>() { @Override/*from w w w . j ava2 s. co m*/ public GlyphIcon getValue(final Job row) { if (!row.isPersistent()) { return null; } return GlyphIcons.HELP; } @Override protected String getHelpLink(final Job row) { return GWT.getHostPageBaseURL() + "doc/user-guide/tasks/tasks.html" + formatAnchor(row.getName()); } }, "<br/>", 20); getView().addColumn(new Column<Job, String>(new TextCell()) { @Override public String getValue(final Job row) { if (!row.isPersistent()) { return ""; } return row.getName(); } }, "Job"); // Enabled. final Column<Job, TickBoxState> enabledColumn = new Column<Job, TickBoxState>( new TickBoxCell(false, false)) { @Override public TickBoxState getValue(final Job row) { if (!row.isPersistent()) { return null; } return TickBoxState.fromBoolean(row.isEnabled()); } }; enabledColumn.setFieldUpdater(new FieldUpdater<Job, TickBoxState>() { @Override public void update(final int index, final Job row, final TickBoxState value) { final boolean newValue = value.toBoolean(); jobSaver.save(new EntitySaveTask<Job>(new EntityRow<Job>(row)) { @Override protected void setValue(final Job entity) { entity.setEnabled(newValue); } }); } }); getView().addColumn(enabledColumn, "Enabled", 80); getView().addColumn(new Column<Job, String>(new TextCell()) { @Override public String getValue(final Job row) { if (!row.isPersistent()) { return ""; } return row.getDescription(); } }, "Description", 800); getView().addEndColumn(new EndColumn<Job>()); this.dataProvider = new EntityServiceFindActionDataProvider<FindJobCriteria, Job>(dispatcher, getView()) { // Add in extra blank item @Override protected ResultList<Job> processData(final ResultList<Job> data) { final List<Job> rtnList = new ArrayList<Job>(); boolean done = false; for (int i = 0; i < data.size(); i++) { rtnList.add(data.get(i)); if (data.get(i).isAdvanced() && !done) { rtnList.add(i, new Job()); done = true; } } return new BaseResultList<Job>(rtnList, 0L, (long) rtnList.size(), false); } }; final FindJobCriteria findJobCriteria = new FindJobCriteria(); findJobCriteria.setOrderBy(FindJobCriteria.ORDER_BY_ADVANCED_AND_NAME); this.dataProvider.setCriteria(findJobCriteria); }
From source file:stroom.jobsystem.client.presenter.JobNodeListPresenter.java
License:Apache License
/** * Add the columns to the table./* w w w. j a v a2s . c o m*/ */ private void initTable() { final Column<JobNodeRow, String> nameColumn = new Column<JobNodeRow, String>(new TextCell()) { @Override public String getValue(final JobNodeRow row) { return row.getEntity().getJob().getName(); } }; getView().addResizableColumn(nameColumn, "Job", 200); final Column<JobNodeRow, String> nodeColumn = new Column<JobNodeRow, String>(new TextCell()) { @Override public String getValue(final JobNodeRow row) { return row.getEntity().getNode().getName(); } }; getView().addResizableColumn(nodeColumn, "Node", 200); // Type. final Column<JobNodeRow, TaskType> typeColumn = new Column<JobNodeRow, TaskType>(new TaskTypeCell()) { @Override public TaskType getValue(final JobNodeRow row) { if (row.getEntity().isPersistent()) { return new TaskType(row.getEntity().getJobType(), row.getEntity().getSchedule()); } return null; } @Override public void onBrowserEvent(final Context context, final Element elem, final JobNodeRow row, final NativeEvent event) { super.onBrowserEvent(context, elem, row, event); // Get the target element. final Element target = event.getEventTarget().cast(); final String eventType = event.getType(); if ("click".equals(eventType)) { final String tagName = target.getTagName(); if ("img".equalsIgnoreCase(tagName)) { if (row instanceof JobNodeRow) { final JobNodeRow jobNodeRow = row; final JobNode jobNode = jobNodeRow.getEntity(); JobNodeInfo jobNodeInfo = jobNodeRow.getJobNodeInfo(); if (jobNodeInfo == null) { jobNodeInfo = new JobNodeInfo(); } schedulePresenter.setSchedule(jobNode.getJobType(), jobNodeInfo.getScheduleReferenceTime(), jobNodeInfo.getLastExecutedTime(), jobNode.getSchedule()); final PopupUiHandlers popupUiHandlers = new PopupUiHandlers() { @Override public void onHideRequest(final boolean autoClose, final boolean ok) { schedulePresenter.hide(autoClose, ok); } @Override public void onHide(final boolean autoClose, final boolean ok) { if (ok && jobNodeRow != null) { jobNodeSaver.save(new EntitySaveTask<JobNode>(jobNodeRow) { @Override protected void setValue(final JobNode entity) { entity.setSchedule(schedulePresenter.getScheduleString()); } }); } } }; schedulePresenter.show(popupUiHandlers); } } } } }; getView().addColumn(typeColumn, "Type", 300); // Max. final Column<JobNodeRow, Number> maxColumn = new Column<JobNodeRow, Number>(new ValueSpinnerCell(1, 100)) { @Override public Number getValue(final JobNodeRow row) { if (row instanceof JobNodeRow) { final JobNodeRow jobNodeRow = (row); if (jobNodeRow.getEntity().getJobType().equals(JobType.DISTRIBUTED)) { return new EditableInteger(row.getEntity().getTaskLimit()); } } return null; } }; maxColumn.setFieldUpdater(new FieldUpdater<JobNodeRow, Number>() { @Override public void update(final int index, final JobNodeRow row, final Number value) { if (row instanceof JobNodeRow) { final JobNodeRow jobNodeRow = row; jobNodeSaver.save(new EntitySaveTask<JobNode>(jobNodeRow) { @Override protected void setValue(final JobNode entity) { entity.setTaskLimit(value.intValue()); } }); } } }); getView().addColumn(maxColumn, "Max", 59); // Cur. final Column<JobNodeRow, String> curColumn = new Column<JobNodeRow, String>(new TextCell()) { @Override public String getValue(final JobNodeRow row) { if (row instanceof JobNodeRow) { final JobNodeRow jobNodeRow = row; if (jobNodeRow.getJobNodeInfo() != null) { return ModelStringUtil.formatCsv(jobNodeRow.getJobNodeInfo().getCurrentTaskCount()); } else { return "?"; } } return null; } }; getView().addColumn(curColumn, "Cur", 59); // Last executed. final Column<JobNodeRow, String> lastExecutedColumn = new Column<JobNodeRow, String>(new TextCell()) { @Override public String getValue(final JobNodeRow row) { if (row instanceof JobNodeRow) { final JobNodeRow jobNodeRow = (row); if (jobNodeRow.getJobNodeInfo() != null) { return ClientDateUtil .createDateTimeString(jobNodeRow.getJobNodeInfo().getLastExecutedTime()); } else { return "?"; } } return null; } }; getView().addColumn(lastExecutedColumn, "Last Executed", ColumnSizeConstants.DATE_COL); // Enabled. final Column<JobNodeRow, TickBoxState> enabledColumn = new Column<JobNodeRow, TickBoxState>( new TickBoxCell(false, false)) { @Override public TickBoxState getValue(final JobNodeRow row) { return TickBoxState.fromBoolean(row.getEntity().isEnabled()); } }; enabledColumn.setFieldUpdater(new FieldUpdater<JobNodeRow, TickBoxState>() { @Override public void update(final int index, final JobNodeRow jobNodeRow, final TickBoxState value) { final boolean newValue = value.toBoolean(); jobNodeSaver.save(new EntitySaveTask<JobNode>(jobNodeRow) { @Override protected void setValue(final JobNode entity) { entity.setEnabled(newValue); } }); } }); getView().addColumn(enabledColumn, "Enabled", 80); getView().addEndColumn(new EndColumn<JobNodeRow>()); }
From source file:stroom.monitoring.client.presenter.TaskProgressMonitoringPresenter.java
License:Apache License
/** * Add the columns to the table.//from w w w . j av a 2 s.c om */ private void initTableColumns() { final TickBoxCell.MarginAppearance tickBoxAppearance = GWT.create(TickBoxCell.MarginAppearance.class); // Select Column final Column<TaskProgress, TickBoxState> column = new Column<TaskProgress, TickBoxState>( new TickBoxCell(tickBoxAppearance, false, false)) { @Override public TickBoxState getValue(final TaskProgress object) { return TickBoxState.fromBoolean(selectedTaskProgress.contains(object)); } }; getView().addColumn(column, "", 15); // Expander column. final Column<TaskProgress, Expander> expanderColumn = new Column<TaskProgress, Expander>( new ExpanderCell()) { @Override public Expander getValue(final TaskProgress row) { return buildExpander(row); } }; getView().addColumn(expanderColumn, ""); expanderColumn.setFieldUpdater((index, row, value) -> { action.setRowExpanded(row, !value.isExpanded()); dataProvider.refresh(); }); final InfoColumn<TaskProgress> furtherInfoColumn = new InfoColumn<TaskProgress>() { @Override protected void showInfo(final TaskProgress row, final int x, final int y) { final StringBuilder html = new StringBuilder(); TooltipUtil.addHeading(html, "Task"); TooltipUtil.addRowData(html, "Name", row.getTaskName()); TooltipUtil.addRowData(html, "User", row.getUserName()); TooltipUtil.addRowData(html, "Submit Time", ClientDateUtil.createDateTimeString(row.getSubmitTimeMs())); TooltipUtil.addRowData(html, "Age", ModelStringUtil.formatDurationString(row.getAgeMs())); TooltipUtil.addBreak(html); TooltipUtil.addRowData(html, "Id", row.getId()); TooltipUtil.addRowData(html, "Thread Name", row.getThreadName()); if (row.getId() != null) { final TaskId parentId = row.getId().getParentId(); if (parentId != null) { TooltipUtil.addRowData(html, "Parent Id", parentId); } } TooltipUtil.addRowData(html, "Session Id", row.getSessionId()); TooltipUtil.addRowData(html, row.getTaskInfo()); tooltipPresenter.setHTML(html.toString()); final PopupPosition popupPosition = new PopupPosition(x, y); ShowPopupEvent.fire(TaskProgressMonitoringPresenter.this, tooltipPresenter, PopupType.POPUP, popupPosition, null); } }; getView().addColumn(furtherInfoColumn, "<br/>", 15); // Add Handlers column.setFieldUpdater((index, object, value) -> { if (value.toBoolean()) { selectedTaskProgress.add(object); } else { // De-selecting one and currently matching all ? selectedTaskProgress.remove(object); } // setButtonsEnabled(); }); // Node. final Column<TaskProgress, String> nodeColumn = new Column<TaskProgress, String>(new TextCell()) { @Override public String getValue(final TaskProgress value) { if (value.getNode() != null) { return value.getNode().getName(); } return "?"; } }; getView().addResizableColumn(nodeColumn, "Node", 150); // Name. final Column<TaskProgress, String> nameColumn = new Column<TaskProgress, String>(new TextCell()) { @Override public String getValue(final TaskProgress value) { return value.getTaskName(); } }; getView().addResizableColumn(nameColumn, "Name", 150); // User. final Column<TaskProgress, String> userColumn = new Column<TaskProgress, String>(new TextCell()) { @Override public String getValue(final TaskProgress value) { return value.getUserName(); } }; getView().addResizableColumn(userColumn, "User", 80); // Submit Time. final Column<TaskProgress, String> submitTimeColumn = new Column<TaskProgress, String>(new TextCell()) { @Override public String getValue(final TaskProgress value) { return ClientDateUtil.createDateTimeString(value.getSubmitTimeMs()); } }; getView().addResizableColumn(submitTimeColumn, "Submit Time", ColumnSizeConstants.DATE_COL); // Age. final Column<TaskProgress, String> ageColumn = new Column<TaskProgress, String>(new TextCell()) { @Override public String getValue(final TaskProgress value) { return ModelStringUtil.formatDurationString(value.getAgeMs()); } }; getView().addResizableColumn(ageColumn, "Age", 50); // Info. final Column<TaskProgress, String> infoColumn = new Column<TaskProgress, String>(new TextCell()) { @Override public String getValue(final TaskProgress value) { if (value.isOrphan()) { return "??? Orphan Task ??? " + value.getTaskInfo(); } return value.getTaskInfo(); } }; getView().addResizableColumn(infoColumn, "Info", 400); getView().addEndColumn(new EndColumn<>()); // Handle use of the expander column. dataProvider.setTreeRowHandler(new TreeRowHandler<>(action, getView(), expanderColumn)); }