Class DefaultGroupByThemeExtension
- java.lang.Object
-
- org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.DefaultGroupByThemeExtension
-
- All Implemented Interfaces:
IThemeExtension
- Direct Known Subclasses:
ModernGroupByThemeExtension
public class DefaultGroupByThemeExtension extends Object implements IThemeExtension
IThemeExtension that adds styling configurations for the GroupBy feature that comes with the GlazedLists extension.Note: It is not possible to change the
ICellPainter
via this default theme configuration. The reason for this is that the implementationGroupByHeaderPainter
contains several technical details that are necessary to make the GroupBy feature work as it is. Changing the painter could break the feature.Note: Simply changing the font doesn't result in automatically resizing the GroupBy header height. This is the same as for all other layers too, as for calculation of the row height, the GC is necessary. To support also bigger fonts in the GroupBy header region, you are able to resize the GroupBy header manually like this:
natTable.doCommand(new RowResizeCommand(groupByHeaderLayer, 0, 50));
-
-
Field Summary
-
Constructor Summary
Constructors Constructor Description DefaultGroupByThemeExtension()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configureGroupByHeaderBackgroundColor(IConfigRegistry configRegistry)
Registering the background color for the GroupBy header region.protected void
configureGroupByHint(IConfigRegistry configRegistry)
Method to configure the styling of the GroupBy hint in the GroupBy header.protected void
configureGroupByObjectSelectionStyle(IConfigRegistry configRegistry)
Registering the style configuration for the selected GroupBy objects.protected void
configureGroupByObjectStyle(IConfigRegistry configRegistry)
Registering the style configuration for the GroupBy objects.protected void
configureGroupByStyle(IConfigRegistry configRegistry)
Registering the style configuration for the GroupBy header region.protected void
configureGroupBySummarySelectionStyle(IConfigRegistry configRegistry)
Registering the style configuration for the selected GroupBy summary.protected void
configureGroupBySummaryStyle(IConfigRegistry configRegistry)
Registering the style configuration for the GroupBy summary.void
createPainterInstances()
Method that is used to create the painter instances that should be registered for styling.protected org.eclipse.swt.graphics.Color
getGroupByHeaderBackgroundColor()
Returns theColor
that should be used to render the group by header background.protected String
getGroupByHint()
protected IStyle
getGroupByHintStyle()
protected ICellPainter
getGroupByObjectCellPainter()
Returns theICellPainter
that should be used to render the GroupBy object row cells in a NatTable.protected ICellPainter
getGroupByObjectSelectionCellPainter()
Returns theICellPainter
that should be used to render the selected GroupBy object row cells in a NatTable.protected IStyle
getGroupByObjectSelectionStyle()
Returns theIStyle
that should be used to render the selected GroupBy object rows in a NatTable.protected IStyle
getGroupByObjectStyle()
Returns theIStyle
that should be used to render the GroupBy object rows in a NatTable.protected IStyle
getGroupByStyle()
Returns theIStyle
that should be used to render the GroupBy region in a NatTable.protected ICellPainter
getGroupBySummaryCellPainter()
Returns theICellPainter
that should be used to render the GroupBy row summary cells in a NatTable.protected ICellPainter
getGroupBySummarySelectionCellPainter()
Returns theICellPainter
that should be used to render the selected GroupBy row summary cells in a NatTable.protected IStyle
getGroupBySummarySelectionStyle()
Returns theIStyle
that should be used to render the selected GroupBy row summary cells in a NatTable.protected IStyle
getGroupBySummaryStyle()
Returns theIStyle
that should be used to render the GroupBy row summary cells in a NatTable.void
registerStyles(IConfigRegistry configRegistry)
Register the style configurations that should be added by this IThemeExtension.void
unregisterStyles(IConfigRegistry configRegistry)
Unregister the style configurations that were registered by this IThemeExtension.
-
-
-
Field Detail
-
groupByHeaderBgColor
public org.eclipse.swt.graphics.Color groupByHeaderBgColor
-
groupByBgColor
public org.eclipse.swt.graphics.Color groupByBgColor
-
groupByFgColor
public org.eclipse.swt.graphics.Color groupByFgColor
-
groupByGradientBgColor
public org.eclipse.swt.graphics.Color groupByGradientBgColor
-
groupByGradientFgColor
public org.eclipse.swt.graphics.Color groupByGradientFgColor
-
groupByHAlign
public HorizontalAlignmentEnum groupByHAlign
-
groupByVAlign
public VerticalAlignmentEnum groupByVAlign
-
groupByFont
public org.eclipse.swt.graphics.Font groupByFont
-
groupByImage
public org.eclipse.swt.graphics.Image groupByImage
-
groupByBorderStyle
public BorderStyle groupByBorderStyle
-
groupByPWEchoChar
public Character groupByPWEchoChar
-
groupByTextDecoration
public TextDecorationEnum groupByTextDecoration
-
groupByObjectBgColor
public org.eclipse.swt.graphics.Color groupByObjectBgColor
-
groupByObjectFgColor
public org.eclipse.swt.graphics.Color groupByObjectFgColor
-
groupByObjectGradientBgColor
public org.eclipse.swt.graphics.Color groupByObjectGradientBgColor
-
groupByObjectGradientFgColor
public org.eclipse.swt.graphics.Color groupByObjectGradientFgColor
-
groupByObjectHAlign
public HorizontalAlignmentEnum groupByObjectHAlign
-
groupByObjectVAlign
public VerticalAlignmentEnum groupByObjectVAlign
-
groupByObjectFont
public org.eclipse.swt.graphics.Font groupByObjectFont
-
groupByObjectImage
public org.eclipse.swt.graphics.Image groupByObjectImage
-
groupByObjectBorderStyle
public BorderStyle groupByObjectBorderStyle
-
groupByObjectPWEchoChar
public Character groupByObjectPWEchoChar
-
groupByObjectTextDecoration
public TextDecorationEnum groupByObjectTextDecoration
-
groupByObjectCellPainter
public ICellPainter groupByObjectCellPainter
-
groupByObjectSelectionBgColor
public org.eclipse.swt.graphics.Color groupByObjectSelectionBgColor
-
groupByObjectSelectionFgColor
public org.eclipse.swt.graphics.Color groupByObjectSelectionFgColor
-
groupByObjectSelectionGradientBgColor
public org.eclipse.swt.graphics.Color groupByObjectSelectionGradientBgColor
-
groupByObjectSelectionGradientFgColor
public org.eclipse.swt.graphics.Color groupByObjectSelectionGradientFgColor
-
groupByObjectSelectionHAlign
public HorizontalAlignmentEnum groupByObjectSelectionHAlign
-
groupByObjectSelectionVAlign
public VerticalAlignmentEnum groupByObjectSelectionVAlign
-
groupByObjectSelectionFont
public org.eclipse.swt.graphics.Font groupByObjectSelectionFont
-
groupByObjectSelectionImage
public org.eclipse.swt.graphics.Image groupByObjectSelectionImage
-
groupByObjectSelectionBorderStyle
public BorderStyle groupByObjectSelectionBorderStyle
-
groupByObjectSelectionPWEchoChar
public Character groupByObjectSelectionPWEchoChar
-
groupByObjectSelectionTextDecoration
public TextDecorationEnum groupByObjectSelectionTextDecoration
-
groupByObjectSelectionCellPainter
public ICellPainter groupByObjectSelectionCellPainter
-
groupBySummaryBgColor
public org.eclipse.swt.graphics.Color groupBySummaryBgColor
-
groupBySummaryFgColor
public org.eclipse.swt.graphics.Color groupBySummaryFgColor
-
groupBySummaryGradientBgColor
public org.eclipse.swt.graphics.Color groupBySummaryGradientBgColor
-
groupBySummaryGradientFgColor
public org.eclipse.swt.graphics.Color groupBySummaryGradientFgColor
-
groupBySummaryHAlign
public HorizontalAlignmentEnum groupBySummaryHAlign
-
groupBySummaryVAlign
public VerticalAlignmentEnum groupBySummaryVAlign
-
groupBySummaryFont
public org.eclipse.swt.graphics.Font groupBySummaryFont
-
groupBySummaryImage
public org.eclipse.swt.graphics.Image groupBySummaryImage
-
groupBySummaryBorderStyle
public BorderStyle groupBySummaryBorderStyle
-
groupBySummaryPWEchoChar
public Character groupBySummaryPWEchoChar
-
groupBySummaryTextDecoration
public TextDecorationEnum groupBySummaryTextDecoration
-
groupBySummaryCellPainter
public ICellPainter groupBySummaryCellPainter
-
groupBySummarySelectionBgColor
public org.eclipse.swt.graphics.Color groupBySummarySelectionBgColor
-
groupBySummarySelectionFgColor
public org.eclipse.swt.graphics.Color groupBySummarySelectionFgColor
-
groupBySummarySelectionGradientBgColor
public org.eclipse.swt.graphics.Color groupBySummarySelectionGradientBgColor
-
groupBySummarySelectionGradientFgColor
public org.eclipse.swt.graphics.Color groupBySummarySelectionGradientFgColor
-
groupBySummarySelectionHAlign
public HorizontalAlignmentEnum groupBySummarySelectionHAlign
-
groupBySummarySelectionVAlign
public VerticalAlignmentEnum groupBySummarySelectionVAlign
-
groupBySummarySelectionFont
public org.eclipse.swt.graphics.Font groupBySummarySelectionFont
-
groupBySummarySelectionImage
public org.eclipse.swt.graphics.Image groupBySummarySelectionImage
-
groupBySummarySelectionBorderStyle
public BorderStyle groupBySummarySelectionBorderStyle
-
groupBySummarySelectionPWEchoChar
public Character groupBySummarySelectionPWEchoChar
-
groupBySummarySelectionTextDecoration
public TextDecorationEnum groupBySummarySelectionTextDecoration
-
groupBySummarySelectionCellPainter
public ICellPainter groupBySummarySelectionCellPainter
-
groupByHint
public String groupByHint
-
groupByHintBgColor
public org.eclipse.swt.graphics.Color groupByHintBgColor
-
groupByHintFgColor
public org.eclipse.swt.graphics.Color groupByHintFgColor
-
groupByHintGradientBgColor
public org.eclipse.swt.graphics.Color groupByHintGradientBgColor
-
groupByHintGradientFgColor
public org.eclipse.swt.graphics.Color groupByHintGradientFgColor
-
groupByHintHAlign
public HorizontalAlignmentEnum groupByHintHAlign
-
groupByHintVAlign
public VerticalAlignmentEnum groupByHintVAlign
-
groupByHintFont
public org.eclipse.swt.graphics.Font groupByHintFont
-
groupByHintImage
public org.eclipse.swt.graphics.Image groupByHintImage
-
groupByHintBorderStyle
public BorderStyle groupByHintBorderStyle
-
groupByHintPWEchoChar
public Character groupByHintPWEchoChar
-
groupByHintTextDecoration
public TextDecorationEnum groupByHintTextDecoration
-
-
Method Detail
-
createPainterInstances
public void createPainterInstances()
Description copied from interface:IThemeExtension
Method that is used to create the painter instances that should be registered for styling. Needed to update painters in case zoom operations- Specified by:
createPainterInstances
in interfaceIThemeExtension
-
registerStyles
public void registerStyles(IConfigRegistry configRegistry)
Description copied from interface:IThemeExtension
Register the style configurations that should be added by this IThemeExtension.- Specified by:
registerStyles
in interfaceIThemeExtension
- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configurations should be registered.
-
configureGroupByHeaderBackgroundColor
protected void configureGroupByHeaderBackgroundColor(IConfigRegistry configRegistry)
Registering the background color for the GroupBy header region.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
getGroupByHeaderBackgroundColor
protected org.eclipse.swt.graphics.Color getGroupByHeaderBackgroundColor()
Returns theColor
that should be used to render the group by header background. Ifnull
is returned, the default color will be used.- Returns:
- The
Color
that should be used to render group by header background.
-
configureGroupByStyle
protected void configureGroupByStyle(IConfigRegistry configRegistry)
Registering the style configuration for the GroupBy header region. Note that it is not possible to exchange the ICellPainter that is used to render the GroupBy header region, as it contains a lot of internal code.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
getGroupByStyle
protected IStyle getGroupByStyle()
Returns theIStyle
that should be used to render the GroupBy region in a NatTable.That means this
IStyle
is registered againstDisplayMode.NORMAL
and the configuration labelGroupByHeaderLayer.GROUP_BY_REGION
.If this method returns
null
, 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.- Returns:
- The
IStyle
that should be used to render the GroupBy region in a NatTable.
-
configureGroupByObjectStyle
protected void configureGroupByObjectStyle(IConfigRegistry configRegistry)
Registering the style configuration for the GroupBy objects.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
getGroupByObjectStyle
protected IStyle getGroupByObjectStyle()
Returns theIStyle
that should be used to render the GroupBy object rows in a NatTable.That means this
IStyle
is registered againstDisplayMode.NORMAL
and the configuration labelGroupByDataLayer.GROUP_BY_OBJECT
.If this method returns
null
, 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.- Returns:
- The
IStyle
that should be used to render the GroupBy object rows in a NatTable.
-
getGroupByObjectCellPainter
protected ICellPainter getGroupByObjectCellPainter()
Returns theICellPainter
that should be used to render the GroupBy object row cells in a NatTable. Typically you should use aGroupByCellTextPainter
is most inner cell painter, as it is configured to only render group by content like group by summary and tree cells.That means this
ICellPainter
is registered againstDisplayMode.NORMAL
and the configuration labelGroupByDataLayer.GROUP_BY_OBJECT
.If this method returns
null
, 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.- Returns:
- The
ICellPainter
that should be used to render the GroupBy object row cells in a NatTable.
-
configureGroupByObjectSelectionStyle
protected void configureGroupByObjectSelectionStyle(IConfigRegistry configRegistry)
Registering the style configuration for the selected GroupBy objects.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
getGroupByObjectSelectionStyle
protected IStyle getGroupByObjectSelectionStyle()
Returns theIStyle
that should be used to render the selected GroupBy object rows in a NatTable.That means this
IStyle
is registered againstDisplayMode.SELECT
and the configuration labelGroupByDataLayer.GROUP_BY_OBJECT
.If this method returns
null
, 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.- Returns:
- The
IStyle
that should be used to render the selected GroupBy object rows in a NatTable.
-
getGroupByObjectSelectionCellPainter
protected ICellPainter getGroupByObjectSelectionCellPainter()
Returns theICellPainter
that should be used to render the selected GroupBy object row cells in a NatTable. Typically you should use aGroupByCellTextPainter
is most inner cell painter, as it is configured to only render group by content like group by summary and tree cells.That means this
ICellPainter
is registered againstDisplayMode.SELECT
and the configuration labelGroupByDataLayer.GROUP_BY_OBJECT
.If this method returns
null
, 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.- Returns:
- The
ICellPainter
that should be used to render the selected GroupBy object row cells in a NatTable.
-
configureGroupBySummaryStyle
protected void configureGroupBySummaryStyle(IConfigRegistry configRegistry)
Registering the style configuration for the GroupBy summary.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
getGroupBySummaryStyle
protected IStyle getGroupBySummaryStyle()
Returns theIStyle
that should be used to render the GroupBy row summary cells in a NatTable.That means this
IStyle
is registered againstDisplayMode.NORMAL
and the configuration labelGroupByDataLayer.GROUP_BY_SUMMARY
.If this method returns
null
, 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.- Returns:
- The
IStyle
that should be used to render the GroupBy summary row cells in a NatTable.
-
getGroupBySummaryCellPainter
protected ICellPainter getGroupBySummaryCellPainter()
Returns theICellPainter
that should be used to render the GroupBy row summary cells in a NatTable. Typically you should use aGroupByCellTextPainter
is most inner cell painter, as it is configured to only render group by content like group by summary and tree cells.That means this
ICellPainter
is registered againstDisplayMode.NORMAL
and the configuration labelGroupByDataLayer.GROUP_BY_SUMMARY
.If this method returns
null
, 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.- Returns:
- The
ICellPainter
that should be used to render the GroupBy row summary cells in a NatTable.
-
configureGroupBySummarySelectionStyle
protected void configureGroupBySummarySelectionStyle(IConfigRegistry configRegistry)
Registering the style configuration for the selected GroupBy summary.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
getGroupBySummarySelectionStyle
protected IStyle getGroupBySummarySelectionStyle()
Returns theIStyle
that should be used to render the selected GroupBy row summary cells in a NatTable.That means this
IStyle
is registered againstDisplayMode.SELECT
and the configuration labelGroupByDataLayer.GROUP_BY_SUMMARY
.If this method returns
null
, 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.- Returns:
- The
IStyle
that should be used to render the selected GroupBy summary row cells in a NatTable.
-
getGroupBySummarySelectionCellPainter
protected ICellPainter getGroupBySummarySelectionCellPainter()
Returns theICellPainter
that should be used to render the selected GroupBy row summary cells in a NatTable. Typically you should use aGroupByCellTextPainter
is most inner cell painter, as it is configured to only render group by content like group by summary and tree cells.That means this
ICellPainter
is registered againstDisplayMode.SELECT
and the configuration labelGroupByDataLayer.GROUP_BY_SUMMARY
.If this method returns
null
, 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.- Returns:
- The
ICellPainter
that should be used to render the selected GroupBy row summary cells in a NatTable.
-
configureGroupByHint
protected void configureGroupByHint(IConfigRegistry configRegistry)
Method to configure the styling of the GroupBy hint in the GroupBy header.The GroupBy hint is usually rendered by the GroupByHeaderPainter. If you registered a different
ICellPainter
for the GroupByHeaderLayer, this might not be interpreted.- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configuration should be applied to.
-
getGroupByHint
protected String getGroupByHint()
- Returns:
- The hint that should be rendered in case there is no grouping applied.
-
getGroupByHintStyle
protected IStyle getGroupByHintStyle()
- Returns:
- The
IStyle
that should be used to render the GroupBy hint.
-
unregisterStyles
public void unregisterStyles(IConfigRegistry configRegistry)
Description copied from interface:IThemeExtension
Unregister the style configurations that were registered by this IThemeExtension.- Specified by:
unregisterStyles
in interfaceIThemeExtension
- Parameters:
configRegistry
- The IConfigRegistry that is used by the NatTable instance to which the style configurations were applied to.
-
-