Search in sources :

Example 81 with Style

use of org.eclipse.nebula.widgets.nattable.style.Style in project nebula.widgets.nattable by eclipse.

the class DefaultColumnHeaderStyleConfiguration method configureRegistry.

@Override
public void configureRegistry(IConfigRegistry configRegistry) {
    // configure the painter
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, this.cellPainter, DisplayMode.NORMAL, GridRegion.COLUMN_HEADER);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_PAINTER, this.cellPainter, DisplayMode.NORMAL, GridRegion.CORNER);
    // configure whether to render grid lines or not
    // e.g. for the BeveledBorderDecorator the rendering of the grid lines
    // should be disabled
    configRegistry.registerConfigAttribute(CellConfigAttributes.RENDER_GRID_LINES, this.renderGridLines, DisplayMode.NORMAL, GridRegion.COLUMN_HEADER);
    configRegistry.registerConfigAttribute(CellConfigAttributes.RENDER_GRID_LINES, this.renderGridLines, DisplayMode.NORMAL, GridRegion.CORNER);
    // configure the normal style
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.bgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.fgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.gradientBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.gradientFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.hAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.vAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.borderStyle);
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.font);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL, GridRegion.COLUMN_HEADER);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL, GridRegion.CORNER);
}
Also used : Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Example 82 with Style

use of org.eclipse.nebula.widgets.nattable.style.Style in project nebula.widgets.nattable by eclipse.

the class DefaultRowHeaderStyleConfiguration method configureRowHeaderStyle.

protected void configureRowHeaderStyle(IConfigRegistry configRegistry) {
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.bgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.fgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.gradientBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.gradientFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.hAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.vAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.borderStyle);
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.font);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL, GridRegion.ROW_HEADER);
}
Also used : Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Example 83 with Style

use of org.eclipse.nebula.widgets.nattable.style.Style in project nebula.widgets.nattable by eclipse.

the class DefaultSelectionStyleConfiguration method configureSelectionAnchorStyle.

protected void configureSelectionAnchorStyle(IConfigRegistry configRegistry) {
    // Selection anchor style for normal display mode
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.anchorBorderStyle);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.NORMAL, SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
    // Selection anchor style for select display mode
    cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.anchorBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.anchorFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.anchorBorderStyle);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.SELECT, SelectionStyleLabels.SELECTION_ANCHOR_STYLE);
}
Also used : Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Example 84 with Style

use of org.eclipse.nebula.widgets.nattable.style.Style in project nebula.widgets.nattable by eclipse.

the class DefaultSelectionStyleConfiguration method configureHeaderHasSelectionStyle.

protected void configureHeaderHasSelectionStyle(IConfigRegistry configRegistry) {
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.selectedHeaderFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.selectedHeaderBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.selectedHeaderFont);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.selectedHeaderBorderStyle);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.SELECT, GridRegion.COLUMN_HEADER);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle.clone(), DisplayMode.SELECT, GridRegion.CORNER);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle.clone(), DisplayMode.SELECT, GridRegion.ROW_HEADER);
}
Also used : Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Example 85 with Style

use of org.eclipse.nebula.widgets.nattable.style.Style in project nebula.widgets.nattable by eclipse.

the class DefaultSelectionStyleConfiguration method configureSelectionAnchorGridLineStyle.

protected void configureSelectionAnchorGridLineStyle(IConfigRegistry configRegistry) {
    Style cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.anchorGridBorderStyle);
    configRegistry.registerConfigAttribute(CellConfigAttributes.CELL_STYLE, cellStyle, DisplayMode.SELECT, SelectionStyleLabels.SELECTION_ANCHOR_GRID_LINE_STYLE);
}
Also used : Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Aggregations

Style (org.eclipse.nebula.widgets.nattable.style.Style)115 BorderStyle (org.eclipse.nebula.widgets.nattable.style.BorderStyle)60 IStyle (org.eclipse.nebula.widgets.nattable.style.IStyle)52 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)18 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)17 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)16 HashMap (java.util.HashMap)15 AbstractRegistryConfiguration (org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration)15 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)13 DataLayer (org.eclipse.nebula.widgets.nattable.layer.DataLayer)13 ConfigRegistry (org.eclipse.nebula.widgets.nattable.config.ConfigRegistry)12 DefaultColumnHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider)12 ColumnHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer)12 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)12 DefaultColumnHeaderDataLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer)11 GridLayer (org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer)11 DefaultCornerDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider)10 CornerLayer (org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer)10 DefaultRowHeaderDataLayer (org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer)10 RowHeaderLayer (org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer)10