use of com.vaadin.ui.Grid.CellStyleGenerator in project VaadinUtils by rlsutton1.
the class GridHeadingV2PropertySet method addActionColumn.
@SuppressWarnings("unchecked")
private void addActionColumn() {
((GeneratedPropertyListContainer<E>) grid.getContainerDataSource()).addGeneratedProperty(ACTION_MENU_PROPERTY_ID, getActionMenuColumnGenerator());
final Column actionMenuColumn = grid.addColumn(ACTION_MENU_PROPERTY_ID);
grid.setFrozenColumnCount(1);
actionMenuColumn.setHeaderCaption("");
actionMenuColumn.setRenderer(new ComponentRenderer());
actionMenuColumn.setWidth(40);
actionMenuColumn.setResizable(false);
grid.setCellStyleGenerator(new CellStyleGenerator() {
/**
*/
private static final long serialVersionUID = 1L;
@Override
public String getStyle(CellReference event) {
String style = "";
if (event.getPropertyId().equals(ACTION_MENU_PROPERTY_ID)) {
style = "grid-actionmenu";
}
return style;
}
});
}
Aggregations