Class GroupByDisplayConverter<T>

    • Constructor Detail

      • GroupByDisplayConverter

        public GroupByDisplayConverter​(GroupByDataLayer<T> groupByDataLayer)
        Parameters:
        groupByDataLayer - The GroupByDataLayer necessary to perform index based or content based operations.
      • GroupByDisplayConverter

        public GroupByDisplayConverter​(GroupByDataLayer<T> groupByDataLayer,
                                       Object defaultSummaryValue)
        Parameters:
        groupByDataLayer - The GroupByDataLayer necessary to perform index based or content based operations.
        defaultSummaryValue - The value that will be shown in case the summary value is not calculated yet.
    • Method Detail

      • displayToCanonicalValue

        public Object displayToCanonicalValue​(ILayerCell cell,
                                              IConfigRegistry configRegistry,
                                              Object displayValue)
        Description copied from interface: IDisplayConverter
        Convert from display value to value in the backing data structure.

        NOTE:
        The type the display value is converted to must match the type in the setter of the backing bean/row object Use this method for contextual conversion.

        Specified by:
        displayToCanonicalValue in interface IDisplayConverter
        Specified by:
        displayToCanonicalValue in class ContextualDisplayConverter
        Parameters:
        cell - The ILayerCell whose canonical value should be converted.
        configRegistry - The IConfigRegistry of the NatTable to which the ILayerCell belongs.
        displayValue - The display value that should be converted to the data value that matches the backing data.
        Returns:
        The converted value to put to the backing data.
      • getDisplayValue

        protected Object getDisplayValue​(ILayerCell cell,
                                         IConfigRegistry configRegistry,
                                         Object canonicalValue)
        Searches for the IDisplayConverter to use for the given ILayerCell and converts the given canonical value to the display value using the found converter.
        Parameters:
        cell - The ILayerCell for which the display value is asked.
        configRegistry - The ConfigRegistry necessary to retrieve the IDisplayConverter.
        canonicalValue - The canonical value to convert.
        Returns:
        The canonical value converted to the display value.
      • registerUnderlyingDisplayConverter

        public void registerUnderlyingDisplayConverter​(int columnIndex,
                                                       IDisplayConverter converter)
        Registers a given IDisplayConverter for a column index. Only necessary to override the searching for a IDisplayConverter that is registered for the column of the grouping.
        Parameters:
        columnIndex - The column index for which the groupBy display converter should be overriden.
        converter - The IDisplayConverter that should be used for converting the groupBy value of the given index.
      • unregisterUnderlyingDisplayConverter

        public void unregisterUnderlyingDisplayConverter​(int columnIndex)
        Unregister the IDisplayConverter that is registered for the given column index.
        Parameters:
        columnIndex - The index for which the registered IDisplayConverter should be unregistered.
      • clearConverterCache

        public void clearConverterCache()
        Clear the internal converter cache. Needed in case of dynamical converter registry updates.