use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class DefaultNatTableThemeConfiguration method getTreeStyle.
@Override
protected IStyle getTreeStyle() {
IStyle cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.treeBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.treeFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.treeGradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.treeGradientFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.treeHAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.treeVAlign);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.treeFont);
cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.treeImage);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.treeBorderStyle);
cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.treePWEchoChar);
cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.treeTextDecoration);
return cellStyle;
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class DefaultNatTableThemeConfiguration method getRowHeaderHoverStyle.
@Override
protected IStyle getRowHeaderHoverStyle() {
IStyle cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.rHeaderHoverBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.rHeaderHoverFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.rHeaderHoverGradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.rHeaderHoverGradientFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.rHeaderHoverHAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.rHeaderHoverVAlign);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.rHeaderHoverFont);
cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.rHeaderHoverImage);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.rHeaderHoverBorderStyle);
cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.rHeaderHoverPWEchoChar);
cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.rHeaderHoverTextDecoration);
return cellStyle;
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class DefaultNatTableThemeConfiguration method getSelectionAnchorSelectionStyle.
@Override
protected IStyle getSelectionAnchorSelectionStyle() {
IStyle cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.selectionAnchorSelectionBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.selectionAnchorSelectionFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.selectionAnchorSelectionGradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.selectionAnchorSelectionGradientFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.selectionAnchorSelectionHAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.selectionAnchorSelectionVAlign);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.selectionAnchorSelectionFont);
cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.selectionAnchorSelectionImage);
// if there is not explicitly another border style configured use the
// same as in getSelectionAnchorStyle()
BorderStyle border = this.selectionAnchorSelectionBorderStyle != null ? this.selectionAnchorSelectionBorderStyle : this.selectionAnchorBorderStyle;
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, border);
cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.selectionAnchorSelectionPWEchoChar);
cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.selectionAnchorSelectionTextDecoration);
return cellStyle;
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureRowHeaderSelectionStyle.
/**
* Register the style configurations for rendering the selection in a row
* header in a NatTable.
* <p>
* By default this means to register the style configurations against
* {@link DisplayMode#SELECT} and config/region label
* {@link GridRegion#ROW_HEADER}. The styling for rendering full row
* selection is configured against the label
* {@link SelectionStyleLabels#ROW_FULLY_SELECTED_STYLE}.
* </p>
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureRowHeaderSelectionStyle(IConfigRegistry configRegistry) {
IStyle rowHeaderStyle = getRowHeaderSelectionStyle();
if (!isStyleEmpty(rowHeaderStyle)) {
// register column header cell style in select mode
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, rowHeaderStyle, DisplayMode.SELECT, GridRegion.ROW_HEADER);
}
ICellPainter rowHeaderCellPainter = getRowHeaderSelectionCellPainter();
if (rowHeaderCellPainter != null) {
// register column header cell painter in select mode
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, rowHeaderCellPainter, DisplayMode.SELECT, GridRegion.ROW_HEADER);
}
IStyle fullSelectionRowHeaderStyle = getRowHeaderFullSelectionStyle();
if (!isStyleEmpty(fullSelectionRowHeaderStyle)) {
// register row header cell style in select mode when all cells in
// the row are selected
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, fullSelectionRowHeaderStyle, DisplayMode.SELECT, SelectionStyleLabels.ROW_FULLY_SELECTED_STYLE);
}
ICellPainter fullSelectionRowHeaderCellPainter = getRowHeaderFullSelectionCellPainter();
if (fullSelectionRowHeaderCellPainter != null) {
// register row header cell painter in select mode when all cells in
// the row are selected
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, fullSelectionRowHeaderCellPainter, DisplayMode.SELECT, SelectionStyleLabels.ROW_FULLY_SELECTED_STYLE);
}
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureColumnGroupHeaderStyle.
/**
* This method is used to register style configurations for the column group
* header in a NatTable.
* <p>
* When adding the ColumnGroupHeaderLayer to a layer stack, there will be a
* new region with region label {@link GridRegion#COLUMN_GROUP_HEADER}.
* Typically it will share the same styling as the column header and have an
* internally configured {@link ICellPainter} to render dependent on the
* state of the ColumnGroupModel.
* </p>
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureColumnGroupHeaderStyle(IConfigRegistry configRegistry) {
IStyle columnGroupHeaderStyle = getColumnGroupHeaderStyle();
if (!isStyleEmpty(columnGroupHeaderStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, columnGroupHeaderStyle, DisplayMode.NORMAL, GridRegion.COLUMN_GROUP_HEADER);
}
ICellPainter columnGroupHeaderCellPainter = getColumnGroupHeaderCellPainter();
if (columnGroupHeaderCellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, columnGroupHeaderCellPainter, DisplayMode.NORMAL, GridRegion.COLUMN_GROUP_HEADER);
}
}
Aggregations