use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureAlternatingRowStyle.
/**
* When creating a NatTable grid composition, using the
* {@link DefaultGridLayerConfiguration}, the
* {@link AlternatingRowConfigLabelAccumulator} is configured for the body
* region to apply labels for alternating rows. It applies the following
* labels for which this method registers styles:
* <ul>
* <li>{@link AlternatingRowConfigLabelAccumulator#EVEN_ROW_CONFIG_TYPE}
* </li>
* <li>{@link AlternatingRowConfigLabelAccumulator#EVEN_ROW_CONFIG_TYPE}
* </li>
* </ul>
* If the {@link AlternatingRowConfigLabelAccumulator} is not configured,
* this style configuration will have no effect.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureAlternatingRowStyle(IConfigRegistry configRegistry) {
IStyle evenStyle = getEvenRowStyle();
if (!isStyleEmpty(evenStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, evenStyle, DisplayMode.NORMAL, AlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE);
}
ICellPainter evenCellPainter = getEvenRowCellPainter();
if (evenCellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, evenCellPainter, DisplayMode.NORMAL, AlternatingRowConfigLabelAccumulator.EVEN_ROW_CONFIG_TYPE);
}
IStyle oddStyle = getOddRowStyle();
if (!isStyleEmpty(oddStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, oddStyle, DisplayMode.NORMAL, AlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE);
}
ICellPainter oddCellPainter = getOddRowCellPainter();
if (oddCellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, oddCellPainter, DisplayMode.NORMAL, AlternatingRowConfigLabelAccumulator.ODD_ROW_CONFIG_TYPE);
}
}
use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureFilterRowStyle.
/**
* This method is used to register style configurations for the filter row.
* It will only be applied in case the FilterRowHeaderLayer is involved,
* which introduces a new region that is recognised by
* {@link GridRegion#FILTER_ROW}.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureFilterRowStyle(IConfigRegistry configRegistry) {
IStyle filterRowStyle = getFilterRowStyle();
if (!isStyleEmpty(filterRowStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, filterRowStyle, DisplayMode.NORMAL, GridRegion.FILTER_ROW);
}
ICellPainter cellPainter = getFilterRowCellPainter();
if (cellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter, DisplayMode.NORMAL, GridRegion.FILTER_ROW);
}
}
use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureSummaryRowStyle.
/**
* This method is used to register style configurations for a summary row.
* It will only be applied in case a SummaryRowLayer is involved, which adds
* the configuration label
* {@link SummaryRowLayer#DEFAULT_SUMMARY_ROW_CONFIG_LABEL} to the summary
* row.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureSummaryRowStyle(IConfigRegistry configRegistry) {
IStyle style = getSummaryRowStyle();
if (!isStyleEmpty(style)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, style, DisplayMode.NORMAL, SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL);
}
ICellPainter cellPainter = getSummaryRowCellPainter();
if (cellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter, DisplayMode.NORMAL, SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL);
}
style = getSummaryRowSelectionStyle();
if (!isStyleEmpty(style)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, style, DisplayMode.SELECT, SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL);
}
cellPainter = getSummaryRowSelectionCellPainter();
if (cellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter, DisplayMode.SELECT, SummaryRowLayer.DEFAULT_SUMMARY_ROW_CONFIG_LABEL);
}
}
use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureRowHeaderStyle.
/**
* Register the style configurations for rendering the row header in a
* NatTable.
* <p>
* By default this means to register the style configurations against
* {@link DisplayMode#NORMAL} and config/region label
* {@link GridRegion#ROW_HEADER}.
* </p>
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureRowHeaderStyle(IConfigRegistry configRegistry) {
IStyle rowHeaderStyle = getRowHeaderStyle();
if (!isStyleEmpty(rowHeaderStyle)) {
// register row header cell style in normal mode
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, rowHeaderStyle, DisplayMode.NORMAL, GridRegion.ROW_HEADER);
}
ICellPainter rowHeaderCellPainter = getRowHeaderCellPainter();
if (rowHeaderCellPainter != null) {
// register row header cell painter in normal mode
// will also be used in other modes if no other cell painter is
// registered explicitly
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, rowHeaderCellPainter, DisplayMode.NORMAL, GridRegion.ROW_HEADER);
}
}
use of org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureRowGroupHeaderStyle.
/**
* This method is used to register style configurations for the row group
* header in a NatTable.
* <p>
* When adding the RowGroupHeaderLayer to a layer stack, there will be a new
* region with region label {@link GridRegion#ROW_GROUP_HEADER}. Typically
* it will share the same styling as the row header and have an internally
* configured {@link ICellPainter} to render dependent on the state of the
* RowGroupModel.
* </p>
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureRowGroupHeaderStyle(IConfigRegistry configRegistry) {
IStyle rowGroupHeaderStyle = getRowGroupHeaderStyle();
if (!isStyleEmpty(rowGroupHeaderStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, rowGroupHeaderStyle, DisplayMode.NORMAL, GridRegion.ROW_GROUP_HEADER);
}
ICellPainter rowGroupHeaderCellPainter = getRowGroupHeaderCellPainter();
if (rowGroupHeaderCellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, rowGroupHeaderCellPainter, DisplayMode.NORMAL, GridRegion.ROW_GROUP_HEADER);
}
}
Aggregations