Class ColumnPathRenderer<SOURCE>

  • Type Parameters:
    SOURCE - the object model type
    All Implemented Interfaces:
    Serializable

    public class ColumnPathRenderer<SOURCE>
    extends Renderer<SOURCE>
    Renderer for columns that doesn't use any template for rendering its contents (only the value from the object model). In such cases, a template element is not needed on the client-side, only the path property.
    Author:
    Vaadin Ltd.
    See Also:
    Grid.addColumn(ValueProvider), Serialized Form
    • Constructor Detail

      • ColumnPathRenderer

        public ColumnPathRenderer​(String property,
                                  ValueProvider<SOURCE,​?> provider)
        Creates a new renderer based on the property and the value provider for that property.
        Parameters:
        property - the property name
        provider - the value provider for the property
    • Method Detail

      • render

        public Rendering<SOURCE> render​(Element container,
                                        DataKeyMapper<SOURCE> keyMapper)
        Description copied from class: Renderer
        Handles the rendering of the model objects by creating a new <template> element in the given container.
        Overrides:
        render in class Renderer<SOURCE>
        Parameters:
        container - the element in which the template will be attached to
        keyMapper - mapper used internally to fetch items by key and to provide keys for given items. It is required when either event handlers or DataGenerator are supported
        Returns:
        the context of the rendering, that can be used by the components to provide extra customization
      • render

        public Rendering<SOURCE> render​(Element container,
                                        DataKeyMapper<SOURCE> keyMapper,
                                        Element contentTemplate)
        Description copied from class: Renderer
        Handles the rendering of the model objects by using the given <template> element in the given container.

        Subclasses of Renderer usually override this method to provide additional features.

        Overrides:
        render in class Renderer<SOURCE>
        Parameters:
        container - the element in which the template will be attached to, not null
        keyMapper - mapper used internally to fetch items by key and to provide keys for given items. It is required when either event handlers or DataGenerator are supported
        contentTemplate - the <template> element to be used for rendering in the container, not null
        Returns:
        the context of the rendering, that can be used by the components to provide extra customization