use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class DefaultNatTableThemeConfiguration method getSummaryRowStyle.
@Override
protected IStyle getSummaryRowStyle() {
IStyle cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.summaryRowBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.summaryRowFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.summaryRowGradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.summaryRowGradientFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.summaryRowHAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.summaryRowVAlign);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.summaryRowFont);
cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.summaryRowImage);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.summaryRowBorderStyle);
cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.summaryRowPWEchoChar);
cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.summaryRowTextDecoration);
return cellStyle;
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureDefaultStyle.
/**
* Register default style configurations. Typically these configurations are
* used be the body region and will be overridden by more specific
* configurations of the header regions or custom styling based on labels.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureDefaultStyle(IConfigRegistry configRegistry) {
IStyle defaultStyle = getDefaultCellStyle();
if (!isStyleEmpty(defaultStyle)) {
// register body cell style for every display mode
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, defaultStyle);
}
ICellPainter defaultPainter = getDefaultCellPainter();
if (defaultPainter != null) {
// register body cell painter for every display mode
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, defaultPainter);
}
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureTreeStyle.
/**
* This method is used to register style configurations for a tree
* representation. It will only be applied in case a TreeLayer is involved,
* which adds the configuration label {@link TreeLayer#TREE_COLUMN_CELL} to
* the tree column.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureTreeStyle(IConfigRegistry configRegistry) {
IStyle treeStyle = getTreeStyle();
if (!isStyleEmpty(treeStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, treeStyle, DisplayMode.NORMAL, TreeLayer.TREE_COLUMN_CELL);
}
ICellPainter cellPainter = getTreeCellPainter();
if (cellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, cellPainter, DisplayMode.NORMAL, TreeLayer.TREE_COLUMN_CELL);
}
IStyle treeSelectionStyle = getTreeSelectionStyle();
if (!isStyleEmpty(treeSelectionStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, treeSelectionStyle, DisplayMode.SELECT, TreeLayer.TREE_COLUMN_CELL);
}
ICellPainter selectionCellPainter = getTreeSelectionCellPainter();
if (selectionCellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, selectionCellPainter, DisplayMode.SELECT, TreeLayer.TREE_COLUMN_CELL);
}
ICellPainter treePainter = getTreeStructurePainter();
if (treePainter != null) {
configRegistry.registerConfigAttribute(TreeConfigAttributes.TREE_STRUCTURE_PAINTER, treePainter, DisplayMode.NORMAL);
}
ICellPainter treeSelectionPainter = getTreeStructureSelectionPainter();
if (treeSelectionPainter != null) {
configRegistry.registerConfigAttribute(TreeConfigAttributes.TREE_STRUCTURE_PAINTER, treeSelectionPainter, DisplayMode.SELECT);
}
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureSelectionAnchorStyle.
/**
* Register the style configurations to render the selection anchor.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureSelectionAnchorStyle(IConfigRegistry configRegistry) {
// Selection anchor style for normal display mode
IStyle anchorStyle = getSelectionAnchorStyle();
if (!isStyleEmpty(anchorStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, anchorStyle, DisplayMode.NORMAL, SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
}
ICellPainter anchorPainter = getSelectionAnchorCellPainter();
if (anchorPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, anchorPainter, DisplayMode.NORMAL, SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
}
// Selection anchor style for select display mode
IStyle selectionAnchorStyle = getSelectionAnchorSelectionStyle();
if (!isStyleEmpty(selectionAnchorStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, selectionAnchorStyle, DisplayMode.SELECT, SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
}
ICellPainter selectionAnchorPainter = getSelectionAnchorSelectionCellPainter();
if (selectionAnchorPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, selectionAnchorPainter, DisplayMode.SELECT, SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
}
// configure selection anchor grid line style
IStyle gridLineStyle = getSelectionAnchorGridLineStyle();
if (!isStyleEmpty(gridLineStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, gridLineStyle, DisplayMode.SELECT, SelectionStyleLabels.SELECTION_ANCHOR_GRID_LINE_STYLE);
}
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class ThemeConfiguration method configureDefaultSelectionStyle.
/**
* Register default selection style configurations. Typically these
* configurations are used be the body region and will be overridden by more
* specific configurations of the header regions or custom styling based on
* labels.
*
* @param configRegistry
* The IConfigRegistry that is used by the NatTable instance to
* which the style configuration should be applied to.
*/
protected void configureDefaultSelectionStyle(IConfigRegistry configRegistry) {
// register body cell style for every display mode
IStyle defaultSelectionStyle = getDefaultSelectionCellStyle();
if (!isStyleEmpty(defaultSelectionStyle)) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, defaultSelectionStyle, DisplayMode.SELECT);
}
// register body cell painter for every display mode
ICellPainter defaultSelectionCellPainter = getDefaultSelectionCellPainter();
if (defaultSelectionCellPainter != null) {
configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, defaultSelectionCellPainter, DisplayMode.SELECT);
}
}
Aggregations