Class MarkupDisplayConverter

    • Constructor Detail

      • MarkupDisplayConverter

        public MarkupDisplayConverter()
      • MarkupDisplayConverter

        public MarkupDisplayConverter​(IDisplayConverter wrappedConverter)
    • 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.
      • registerMarkup

        public void registerMarkup​(String value,
                                   String markupPrefix,
                                   String markupSuffix)
        Registers a value and the markup that should be placed around the value while rendering.
        Parameters:
        value - The value that should be replacement with the markup for rendering.
        markupPrefix - The String that will be added as prefix to the value.
        markupSuffix - The String that will be added as suffix to the value.
      • registerRegexMarkup

        public void registerRegexMarkup​(String value,
                                        String markupPrefix,
                                        String markupSuffix)
        Registers a regular expression and a markup that should be placed around the value that is specified by the regular expression. The regular expression needs to contain at least one group.

        Example: (IMPORTANT|URGENT) as value will result as either of both words will be surrounded by the markup.

        Parameters:
        value - A regular expression that specifies the value that should be replacement with the markup for rendering. Needs to contain at least one group that will be replaced.
        markupPrefix - The String that will be added as prefix to the value.
        markupSuffix - The String that will be added as suffix to the value.
        Since:
        1.1
      • unregisterMarkup

        public void unregisterMarkup​(String value)
        Unregister the markup that was registered for the given value.
        Parameters:
        value - The value for which a markup was registered. In case of a value or regex markup this is the value for which the markup was registered. In case of a custom MarkupProcessor it needs to be the id for which it was registered.
      • clearMarkups

        public void clearMarkups()
        Remove all registered markups.