use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class SelectionLayerPainter method applyBorderStyle.
/**
* @deprecated Use {@link #getBorderStyle} instead.
*/
@Deprecated
protected void applyBorderStyle(GC gc, IConfigRegistry configRegistry) {
BorderStyle borderStyle = configRegistry.getConfigAttribute(SelectionConfigAttributes.SELECTION_GRID_LINE_STYLE, DisplayMode.SELECT);
// check for backwards compatibility style configuration
if (borderStyle == null) {
// Note: If there is no style configured for the
// SelectionStyleLabels.SELECTION_ANCHOR_GRID_LINE_STYLE
// label, the style configured for DisplayMode.SELECT will be
// retrieved by this call.
// Ensure that the selection style configuration does not contain a
// border style configuration to avoid strange rendering behavior.
// By default there is no border configuration added, so there
// shouldn't be issues with backwards compatibility. And if there
// are some, they can be solved easily by adding the necessary
// border style configuration.
IStyle cellStyle = configRegistry.getConfigAttribute(CellConfigAttributes.CELL_STYLE, DisplayMode.SELECT, SelectionStyleLabels.SELECTION_ANCHOR_GRID_LINE_STYLE);
borderStyle = cellStyle != null ? cellStyle.getAttributeValue(CellStyleAttributes.BORDER_STYLE) : null;
}
// backwards compatibility
if (borderStyle == null) {
gc.setLineStyle(SWT.LINE_CUSTOM);
gc.setLineDash(new int[] { 1, 1 });
gc.setForeground(GUIHelper.COLOR_BLACK);
} else {
gc.setLineStyle(LineStyleEnum.toSWT(borderStyle.getLineStyle()));
gc.setLineWidth(borderStyle.getThickness());
gc.setForeground(borderStyle.getColor());
}
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class DefaultNatTableThemeConfiguration method getColumnHeaderFullSelectionStyle.
@Override
protected IStyle getColumnHeaderFullSelectionStyle() {
IStyle cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.cHeaderFullSelectionBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.cHeaderFullSelectionFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.cHeaderFullSelectionGradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.cHeaderFullSelectionGradientFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.cHeaderFullSelectionHAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.cHeaderFullSelectionVAlign);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.cHeaderFullSelectionFont);
cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.cHeaderFullSelectionImage);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.cHeaderFullSelectionBorderStyle);
cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.cHeaderFullSelectionPWEchoChar);
cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.cHeaderFullSelectionTextDecoration);
return cellStyle;
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class DefaultNatTableThemeConfiguration method getRowHeaderStyle.
@Override
protected IStyle getRowHeaderStyle() {
IStyle cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.rHeaderBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.rHeaderFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.rHeaderGradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.rHeaderGradientFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.rHeaderHAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.rHeaderVAlign);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.rHeaderFont);
cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.rHeaderImage);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.rHeaderBorderStyle);
cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.rHeaderPWEchoChar);
cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.rHeaderTextDecoration);
return cellStyle;
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class DefaultNatTableThemeConfiguration method getRowHeaderSelectionStyle.
@Override
protected IStyle getRowHeaderSelectionStyle() {
IStyle cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.rHeaderSelectionBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.rHeaderSelectionFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.rHeaderSelectionGradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.rHeaderSelectionGradientFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.rHeaderSelectionHAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.rHeaderSelectionVAlign);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.rHeaderSelectionFont);
cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.rHeaderSelectionImage);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.rHeaderSelectionBorderStyle);
cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.rHeaderSelectionPWEchoChar);
cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.rHeaderSelectionTextDecoration);
return cellStyle;
}
use of org.eclipse.nebula.widgets.nattable.style.IStyle in project nebula.widgets.nattable by eclipse.
the class DefaultNatTableThemeConfiguration method getFilterRowStyle.
@Override
protected IStyle getFilterRowStyle() {
IStyle cellStyle = new Style();
cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.filterRowBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.filterRowFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.filterRowGradientBgColor);
cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.filterRowGradientFgColor);
cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.filterRowHAlign);
cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.filterRowVAlign);
cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.filterRowFont);
cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.filterRowImage);
cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.filterRowBorderStyle);
cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.filterRowPWEchoChar);
cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.filterRowTextDecoration);
return cellStyle;
}
Aggregations