Search in sources :

Example 46 with IStyle

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

the class DefaultGroupByThemeExtension method getGroupByStyle.

/**
 * Returns the {@link IStyle} that should be used to render the GroupBy
 * region in a NatTable.
 * <p>
 * That means this {@link IStyle} is registered against
 * {@link DisplayMode#NORMAL} and the configuration label
 * {@link GroupByHeaderLayer#GROUP_BY_REGION}.
 * </p>
 * <p>
 * If this method returns <code>null</code>, no value will be registered to
 * keep the IConfigRegistry clean. The result would be the same, as if no
 * value is found in the IConfigRegistry. In this case the rendering will
 * fallback to the default configuration.
 * </p>
 *
 * @return The {@link IStyle} that should be used to render the GroupBy
 *         region in a NatTable.
 */
protected IStyle getGroupByStyle() {
    IStyle cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.groupByBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.groupByFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.groupByGradientBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.groupByGradientFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.groupByHAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.groupByVAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.groupByFont);
    cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.groupByImage);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.groupByBorderStyle);
    cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.groupByPWEchoChar);
    cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.groupByTextDecoration);
    return cellStyle;
}
Also used : IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Example 47 with IStyle

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

the class DefaultGroupByThemeExtension method getGroupByObjectSelectionStyle.

/**
 * Returns the {@link IStyle} that should be used to render the selected
 * GroupBy object rows in a NatTable.
 * <p>
 * That means this {@link IStyle} is registered against
 * {@link DisplayMode#SELECT} and the configuration label
 * {@link GroupByDataLayer#GROUP_BY_OBJECT}.
 * </p>
 * <p>
 * If this method returns <code>null</code>, no value will be registered to
 * keep the IConfigRegistry clean. The result would be the same, as if no
 * value is found in the IConfigRegistry. In this case the rendering will
 * fallback to the default configuration.
 * </p>
 *
 * @return The {@link IStyle} that should be used to render the selected
 *         GroupBy object rows in a NatTable.
 */
protected IStyle getGroupByObjectSelectionStyle() {
    IStyle cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.groupByObjectSelectionBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.groupByObjectSelectionFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.groupByObjectSelectionGradientBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.groupByObjectSelectionGradientFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.groupByObjectSelectionHAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.groupByObjectSelectionVAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.groupByObjectSelectionFont);
    cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.groupByObjectSelectionImage);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.groupByObjectSelectionBorderStyle);
    cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.groupByObjectSelectionPWEchoChar);
    cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.groupByObjectSelectionTextDecoration);
    return cellStyle;
}
Also used : IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Example 48 with IStyle

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

the class DefaultGroupByThemeExtension method getGroupBySummarySelectionStyle.

/**
 * Returns the {@link IStyle} that should be used to render the selected
 * GroupBy row summary cells in a NatTable.
 * <p>
 * That means this {@link IStyle} is registered against
 * {@link DisplayMode#SELECT} and the configuration label
 * {@link GroupByDataLayer#GROUP_BY_SUMMARY}.
 * </p>
 * <p>
 * If this method returns <code>null</code>, no value will be registered to
 * keep the IConfigRegistry clean. The result would be the same, as if no
 * value is found in the IConfigRegistry. In this case the rendering will
 * fallback to the default configuration.
 * </p>
 *
 * @return The {@link IStyle} that should be used to render the selected
 *         GroupBy summary row cells in a NatTable.
 */
protected IStyle getGroupBySummarySelectionStyle() {
    IStyle cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.groupBySummarySelectionBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.groupBySummarySelectionFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.groupBySummarySelectionGradientBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.groupBySummarySelectionGradientFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.groupBySummarySelectionHAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.groupBySummarySelectionVAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.groupBySummarySelectionFont);
    cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.groupBySummarySelectionImage);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.groupBySummarySelectionBorderStyle);
    cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.groupBySummarySelectionPWEchoChar);
    cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.groupBySummarySelectionTextDecoration);
    return cellStyle;
}
Also used : IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Example 49 with IStyle

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

the class DefaultGroupByThemeExtension method getGroupByObjectStyle.

/**
 * Returns the {@link IStyle} that should be used to render the GroupBy
 * object rows in a NatTable.
 * <p>
 * That means this {@link IStyle} is registered against
 * {@link DisplayMode#NORMAL} and the configuration label
 * {@link GroupByDataLayer#GROUP_BY_OBJECT}.
 * </p>
 * <p>
 * If this method returns <code>null</code>, no value will be registered to
 * keep the IConfigRegistry clean. The result would be the same, as if no
 * value is found in the IConfigRegistry. In this case the rendering will
 * fallback to the default configuration.
 * </p>
 *
 * @return The {@link IStyle} that should be used to render the GroupBy
 *         object rows in a NatTable.
 */
protected IStyle getGroupByObjectStyle() {
    IStyle cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.groupByObjectBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.groupByObjectFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.groupByObjectGradientBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.groupByObjectGradientFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.groupByObjectHAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.groupByObjectVAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.groupByObjectFont);
    cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.groupByObjectImage);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.groupByObjectBorderStyle);
    cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.groupByObjectPWEchoChar);
    cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.groupByObjectTextDecoration);
    return cellStyle;
}
Also used : IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Example 50 with IStyle

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

the class DefaultGroupByThemeExtension method getGroupBySummaryStyle.

/**
 * Returns the {@link IStyle} that should be used to render the GroupBy row
 * summary cells in a NatTable.
 * <p>
 * That means this {@link IStyle} is registered against
 * {@link DisplayMode#NORMAL} and the configuration label
 * {@link GroupByDataLayer#GROUP_BY_SUMMARY}.
 * </p>
 * <p>
 * If this method returns <code>null</code>, no value will be registered to
 * keep the IConfigRegistry clean. The result would be the same, as if no
 * value is found in the IConfigRegistry. In this case the rendering will
 * fallback to the default configuration.
 * </p>
 *
 * @return The {@link IStyle} that should be used to render the GroupBy
 *         summary row cells in a NatTable.
 */
protected IStyle getGroupBySummaryStyle() {
    IStyle cellStyle = new Style();
    cellStyle.setAttributeValue(CellStyleAttributes.BACKGROUND_COLOR, this.groupBySummaryBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.FOREGROUND_COLOR, this.groupBySummaryFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_BACKGROUND_COLOR, this.groupBySummaryGradientBgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.GRADIENT_FOREGROUND_COLOR, this.groupBySummaryGradientFgColor);
    cellStyle.setAttributeValue(CellStyleAttributes.HORIZONTAL_ALIGNMENT, this.groupBySummaryHAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.VERTICAL_ALIGNMENT, this.groupBySummaryVAlign);
    cellStyle.setAttributeValue(CellStyleAttributes.FONT, this.groupBySummaryFont);
    cellStyle.setAttributeValue(CellStyleAttributes.IMAGE, this.groupBySummaryImage);
    cellStyle.setAttributeValue(CellStyleAttributes.BORDER_STYLE, this.groupBySummaryBorderStyle);
    cellStyle.setAttributeValue(CellStyleAttributes.PASSWORD_ECHO_CHAR, this.groupBySummaryPWEchoChar);
    cellStyle.setAttributeValue(CellStyleAttributes.TEXT_DECORATION, this.groupBySummaryTextDecoration);
    return cellStyle;
}
Also used : IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) IStyle(org.eclipse.nebula.widgets.nattable.style.IStyle) Style(org.eclipse.nebula.widgets.nattable.style.Style) BorderStyle(org.eclipse.nebula.widgets.nattable.style.BorderStyle)

Aggregations

IStyle (org.eclipse.nebula.widgets.nattable.style.IStyle)97 BorderStyle (org.eclipse.nebula.widgets.nattable.style.BorderStyle)50 Style (org.eclipse.nebula.widgets.nattable.style.Style)49 ICellPainter (org.eclipse.nebula.widgets.nattable.painter.cell.ICellPainter)24 ILayer (org.eclipse.nebula.widgets.nattable.layer.ILayer)8 IConfigRegistry (org.eclipse.nebula.widgets.nattable.config.IConfigRegistry)7 NatTable (org.eclipse.nebula.widgets.nattable.NatTable)6 HashMap (java.util.HashMap)5 AbstractRegistryConfiguration (org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration)5 DefaultNatTableStyleConfiguration (org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration)5 IDataProvider (org.eclipse.nebula.widgets.nattable.data.IDataProvider)5 ExtendedPersonWithAddress (org.eclipse.nebula.widgets.nattable.dataset.person.ExtendedPersonWithAddress)5 DefaultColumnHeaderDataProvider (org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider)5 VisualRefreshCommand (org.eclipse.nebula.widgets.nattable.command.VisualRefreshCommand)4 ConfigRegistry (org.eclipse.nebula.widgets.nattable.config.ConfigRegistry)4 ExtendedReflectiveColumnPropertyAccessor (org.eclipse.nebula.widgets.nattable.data.ExtendedReflectiveColumnPropertyAccessor)4 ListDataProvider (org.eclipse.nebula.widgets.nattable.data.ListDataProvider)4 DefaultDoubleDisplayConverter (org.eclipse.nebula.widgets.nattable.data.convert.DefaultDoubleDisplayConverter)4 GroupByDataLayer (org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByDataLayer)4 GroupByHeaderLayer (org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.GroupByHeaderLayer)4