Search in sources :

Example 1 with ColumnGroupHeaderTextPainter

use of org.eclipse.nebula.widgets.nattable.group.painter.ColumnGroupHeaderTextPainter in project nebula.widgets.nattable by eclipse.

the class ColumnGroupConfiguration method configureRegistry.

@Override
public void configureRegistry(IConfigRegistry configRegistry) {
    Image bgImage = this.tableModel.tableStyle.columnHeaderBgImage;
    if (ObjectUtils.isNotNull(bgImage)) {
        TextPainter txtPainter = new TextPainter(false, false);
        ICellPainter cellPainter = new BackgroundImagePainter(txtPainter, bgImage, GUIHelper.getColor(192, 192, 192));
        configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, new ColumnGroupHeaderTextPainter(cellPainter), DisplayMode.NORMAL, GridRegion.COLUMN_GROUP_HEADER);
    } else {
        super.configureRegistry(configRegistry);
    }
}
Also used : TextPainter(org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter) ColumnGroupHeaderTextPainter(org.eclipse.nebula.widgets.nattable.group.painter.ColumnGroupHeaderTextPainter) BackgroundImagePainter(org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundImagePainter) ColumnGroupHeaderTextPainter(org.eclipse.nebula.widgets.nattable.group.painter.ColumnGroupHeaderTextPainter) Image(org.eclipse.swt.graphics.Image) ICellPainter(org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter)

Aggregations

ColumnGroupHeaderTextPainter (org.eclipse.nebula.widgets.nattable.group.painter.ColumnGroupHeaderTextPainter)1 BackgroundImagePainter (org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundImagePainter)1 ICellPainter (org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter)1 TextPainter (org.eclipse.nebula.widgets.nattable.painter.cell.TextPainter)1 Image (org.eclipse.swt.graphics.Image)1