Class 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 implementation GroupByHeaderPainter 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 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
      • groupByFont

        public org.eclipse.swt.graphics.Font groupByFont
      • groupByImage

        public org.eclipse.swt.graphics.Image groupByImage
      • groupByBorderStyle

        public BorderStyle groupByBorderStyle
      • groupByPWEchoChar

        public Character groupByPWEchoChar
      • 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
      • groupByObjectFont

        public org.eclipse.swt.graphics.Font groupByObjectFont
      • groupByObjectImage

        public org.eclipse.swt.graphics.Image groupByObjectImage
      • groupByObjectBorderStyle

        public BorderStyle groupByObjectBorderStyle
      • groupByObjectPWEchoChar

        public Character groupByObjectPWEchoChar
      • 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
      • 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
      • groupBySummaryFont

        public org.eclipse.swt.graphics.Font groupBySummaryFont
      • groupBySummaryImage

        public org.eclipse.swt.graphics.Image groupBySummaryImage
      • groupBySummaryBorderStyle

        public BorderStyle groupBySummaryBorderStyle
      • groupBySummaryPWEchoChar

        public Character groupBySummaryPWEchoChar
      • 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
      • 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
      • groupByHintFont

        public org.eclipse.swt.graphics.Font groupByHintFont
      • groupByHintImage

        public org.eclipse.swt.graphics.Image groupByHintImage
      • groupByHintBorderStyle

        public BorderStyle groupByHintBorderStyle
      • groupByHintPWEchoChar

        public Character groupByHintPWEchoChar
    • Constructor Detail

      • DefaultGroupByThemeExtension

        public DefaultGroupByThemeExtension()
    • 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 interface IThemeExtension
      • 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 interface IThemeExtension
        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 the Color that should be used to render the group by header background. If null 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 the IStyle that should be used to render the GroupBy region in a NatTable.

        That means this IStyle is registered against DisplayMode.NORMAL and the configuration label GroupByHeaderLayer.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 the IStyle that should be used to render the GroupBy object rows in a NatTable.

        That means this IStyle is registered against DisplayMode.NORMAL and the configuration label GroupByDataLayer.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 the ICellPainter that should be used to render the GroupBy object row cells in a NatTable. Typically you should use a GroupByCellTextPainter 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 against DisplayMode.NORMAL and the configuration label GroupByDataLayer.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 the IStyle that should be used to render the selected GroupBy object rows in a NatTable.

        That means this IStyle is registered against DisplayMode.SELECT and the configuration label GroupByDataLayer.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 the ICellPainter that should be used to render the selected GroupBy object row cells in a NatTable. Typically you should use a GroupByCellTextPainter 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 against DisplayMode.SELECT and the configuration label GroupByDataLayer.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 the IStyle that should be used to render the GroupBy row summary cells in a NatTable.

        That means this IStyle is registered against DisplayMode.NORMAL and the configuration label GroupByDataLayer.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 the ICellPainter that should be used to render the GroupBy row summary cells in a NatTable. Typically you should use a GroupByCellTextPainter 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 against DisplayMode.NORMAL and the configuration label GroupByDataLayer.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 the IStyle that should be used to render the selected GroupBy row summary cells in a NatTable.

        That means this IStyle is registered against DisplayMode.SELECT and the configuration label GroupByDataLayer.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 the ICellPainter that should be used to render the selected GroupBy row summary cells in a NatTable. Typically you should use a GroupByCellTextPainter 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 against DisplayMode.SELECT and the configuration label GroupByDataLayer.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 interface IThemeExtension
        Parameters:
        configRegistry - The IConfigRegistry that is used by the NatTable instance to which the style configurations were applied to.