use of org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundImagePainter in project nebula.widgets.nattable by eclipse.
the class StyledColumnHeaderConfiguration method addSelectedModeStyling.
private void addSelectedModeStyling(IConfigRegistry configRegistry) {
Image selectedBgImage = GUIHelper.getImageByURL("selectedColumnHeaderBg", getClass().getResource("selected_column_header_bg.png"));
TextPainter txtPainter = new TextPainter(false, false);
ICellPainter selectedCellPainter = new BackgroundImagePainter(txtPainter, selectedBgImage, GUIHelper.getColor(192, 192, 192));
// If sorting is enables we still want the sort icon to be drawn.
SortableHeaderTextPainter selectedHeaderPainter = new SortableHeaderTextPainter(selectedCellPainter, false, true);
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, selectedHeaderPainter, DisplayMode.SELECT, GridRegion.COLUMN_HEADER);
}
use of org.eclipse.nebula.widgets.nattable.painter.cell.BackgroundImagePainter 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);
}
}
Aggregations