use of org.eclipse.nebula.widgets.nattable.style.IStyle 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.style.IStyle 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.style.IStyle in project nebula.widgets.nattable by eclipse.
the class DefaultGroupByThemeExtension method configureGroupByHint.
/**
* Method to configure the styling of the GroupBy hint in the GroupBy
* header.
* <p>
* The GroupBy hint is usually rendered by the GroupByHeaderPainter. If you
* registered a different {@link ICellPainter} for the GroupByHeaderLayer,
* this might not be interpreted.
* </p>
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureGroupByHint(IConfigRegistry configRegistry) {
String groupByHint = getGroupByHint();
if (groupByHint != null && groupByHint.length() > 0) {
configRegistry.registerConfigAttribute(GroupByConfigAttributes.GROUP_BY_HINT, groupByHint);
}
IStyle hintStyle = getGroupByHintStyle();
if (!ThemeConfiguration.isStyleEmpty(hintStyle)) {
configRegistry.registerConfigAttribute(GroupByConfigAttributes.GROUP_BY_HINT_STYLE, hintStyle);
}
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle 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.style.IStyle in project nebula.widgets.nattable by eclipse.
the class RichTextCellPainter method paintCell.
@Override
public void paintCell(ILayerCell cell, GC gc, Rectangle bounds, IConfigRegistry configRegistry) {
IStyle cellStyle = CellStyleUtil.getCellStyle(cell, configRegistry);
setupGCFromConfig(gc, cellStyle);
String htmlText = CellDisplayConversionUtils.convertDataType(cell, configRegistry);
Rectangle painterBounds = new Rectangle(bounds.x, bounds.y - this.richTextPainter.getParagraphSpace(), bounds.width, bounds.height);
this.richTextPainter.paintHTML(htmlText, gc, painterBounds);
int height = this.richTextPainter.getPreferredSize().y - 2 * this.richTextPainter.getParagraphSpace();
if (performRowResize(height, painterBounds)) {
cell.getLayer().doCommand(new RowResizeCommand(cell.getLayer(), cell.getRowPosition(), GUIHelper.convertVerticalDpiToPixel(height) + (cell.getBounds().height - bounds.height)));
}
if (performColumnResize(this.richTextPainter.getPreferredSize().x, painterBounds)) {
cell.getLayer().doCommand(new ColumnResizeCommand(cell.getLayer(), cell.getColumnPosition(), GUIHelper.convertHorizontalDpiToPixel(this.richTextPainter.getPreferredSize().x) + (cell.getBounds().width - bounds.width)));
}
}
Aggregations