private void addColumn(String identifier, Column<T, ?> column) { if (getColumns().contains(column)) { return; } column.extend(this); columnSet.add(column); columnKeys.put(identifier, column); column.setInternalId(identifier); addDataGenerator(column.getDataGenerator()); getState().columnOrder.add(identifier); getHeader().addColumn(identifier); getFooter().addColumn(identifier); if (getDefaultHeaderRow() != null) { getDefaultHeaderRow().getCell(column).setText(column.getCaption()); } column.updateSortable(); }
/** * Sets the header caption for this column. * * @param caption * the header caption, not null * * @return this column */ public Column<T, V> setCaption(String caption) { Objects.requireNonNull(caption, "Header caption can't be null"); if (caption.equals(getState(false).caption)) { return this; } getState().caption = caption; HeaderRow row = getGrid().getDefaultHeaderRow(); if (row != null) { row.getCell(this).setText(caption); } return this; }
if (getDefaultHeaderRow() != null) { for (Column<T, ?> c : getColumns()) { HeaderCell headerCell = getDefaultHeaderRow().getCell(c); if (headerCell.getCellType() == GridStaticCellType.TEXT) { c.setCaption(headerCell.getText());
@Override public HeaderRow getDefaultRow() { return grid.getDefaultHeaderRow(); }
@Override public ListingHeaderRow<P> getDefaultRow() { return new HeaderRowWrapper<>(grid.getDefaultHeaderRow(), converter); }
@Override public HeaderRow getDefaultHeaderRow() { return getHeaderRowByGridRow(component.getDefaultHeaderRow()); }
HeaderRow row = getGrid().getDefaultHeaderRow(); if (row != null) { row.getCell(column).setHtml(header);