Interface Design.ComponentMapper

  • All Superinterfaces:
    java.io.Serializable
    All Known Implementing Classes:
    Design.DefaultComponentMapper
    Enclosing class:
    Design

    public static interface Design.ComponentMapper
    extends java.io.Serializable
    Delegate for handling the mapping between tag names and component instances.

    Use Design.setComponentMapper(ComponentMapper) to configure Vaadin to use a custom component mapper.

    Since:
    7.5.0
    Author:
    Vaadin Ltd
    • Method Detail

      • tagToComponent

        Component tagToComponent​(java.lang.String tag,
                                 Design.ComponentFactory componentFactory,
                                 DesignContext context)
        Resolves and creates a component using the provided component factory based on a tag name.

        This method should be in sync with componentToTag(Component, DesignContext) so that the resolved tag for a created component is the same as the tag for which the component was created.

        Parameters:
        tag - the tag name to create a component for
        componentFactory - the component factory that actually creates a component based on a fully qualified class name
        context - the design context for which the component is created
        Returns:
        a newly created component
      • componentToTag

        java.lang.String componentToTag​(Component component,
                                        DesignContext context)
        Resolves a tag name from a component.
        Parameters:
        component - the component to get a tag name for
        context - the design context for which the tag name is needed
        Returns:
        the tag name corresponding to the component