use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter 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);
}
}
use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter in project nebula.widgets.nattable by eclipse.
the class DefaultGroupByThemeExtension method configureGroupBySummaryStyle.
/**
* Registering the style configuration for the GroupBy summary.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureGroupBySummaryStyle(IConfigRegistry configRegistry) {
IStyle groupBySummaryStyle = getGroupBySummaryStyle();
if (!ThemeConfiguration.isStyleEmpty(groupBySummaryStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, groupBySummaryStyle, DisplayMode.NORMAL, GroupByDataLayer.GROUP_BY_SUMMARY);
}
ICellPainter cellPainter = getGroupBySummaryCellPainter();
if (cellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter, DisplayMode.NORMAL, GroupByDataLayer.GROUP_BY_SUMMARY);
}
}
use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter in project nebula.widgets.nattable by eclipse.
the class DefaultGroupByThemeExtension method configureGroupBySummarySelectionStyle.
/**
* Registering the style configuration for the selected GroupBy summary.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureGroupBySummarySelectionStyle(IConfigRegistry configRegistry) {
IStyle groupBySummaryStyle = getGroupBySummarySelectionStyle();
if (!ThemeConfiguration.isStyleEmpty(groupBySummaryStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, groupBySummaryStyle, DisplayMode.SELECT, GroupByDataLayer.GROUP_BY_SUMMARY);
}
ICellPainter cellPainter = getGroupBySummarySelectionCellPainter();
if (cellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter, DisplayMode.SELECT, GroupByDataLayer.GROUP_BY_SUMMARY);
}
}
use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter in project nebula.widgets.nattable by eclipse.
the class DefaultGroupByThemeExtension method configureGroupByObjectSelectionStyle.
/**
* Registering the style configuration for the selected GroupBy objects.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureGroupByObjectSelectionStyle(IConfigRegistry configRegistry) {
IStyle groupByObjectStyle = getGroupByObjectSelectionStyle();
if (!ThemeConfiguration.isStyleEmpty(groupByObjectStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, groupByObjectStyle, DisplayMode.SELECT, GroupByDataLayer.GROUP_BY_OBJECT);
}
ICellPainter cellPainter = getGroupByObjectSelectionCellPainter();
if (cellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter, DisplayMode.SELECT, GroupByDataLayer.GROUP_BY_OBJECT);
}
}
use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter in project nebula.widgets.nattable by eclipse.
the class CellPainterFactory method getContentPainter.
/**
* Create the content painter for the given key and properties.
*
* @param key
* The content painter key.
* @param painterProperties
* The painter properties for painter initialization.
* @return The content painter to use
*/
public ICellPainter getContentPainter(String key, Map<String, Object> painterProperties) {
ICellPainter result = null;
String lowerKey = key.toLowerCase();
CellPainterCreator creator = this.contentPainter.get(lowerKey);
if (creator != null) {
result = creator.createCellPainter(painterProperties, null);
}
return result;
}
Aggregations