Class FlowComponentsSupport

java.lang.Object
com.vaadin.browserless.internal.FlowComponentsSupport
All Implemented Interfaces:
ComponentSupport

public class FlowComponentsSupport extends Object implements ComponentSupport
The ComponentSupport for the Vaadin components: everything the mocked environment needs to know about Grid, the menus, the dialogs and the other components whose structure Flow alone doesn't describe.

This is internal API and may change without notice.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the support; looked up through the service loader.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    describe(com.vaadin.flow.component.Component component, List<String> description)
    Adds component-specific details to the one-line description produced by PrettyPrintTree.toPrettyString(Component).
    boolean
    firesClosedEvent(com.vaadin.flow.component.Component component)
    Checks whether the component is an overlay whose client-side part fires a closed DOM event once it has closed, which the mocked environment then simulates.
    List<com.vaadin.flow.component.Component>
    getAllChildren(com.vaadin.flow.component.Component component)
    Returns all children of the component as seen by component lookups, including the ones that are not part of the regular component hierarchy, such as a Grid's header components.
    getCaption(com.vaadin.flow.component.Component component)
    Returns the caption of a component that shows it directly on itself, such as a button's text.
    com.vaadin.flow.data.provider.DataProvider<?,?>
    getDataProvider(com.vaadin.flow.component.Component component)
    Returns the data provider currently set to the component.
    Collection<Class<? extends com.vaadin.flow.component.Component>>
    Returns the dialog types that Locator._expectNoDialogs() checks for.
    getLabel(com.vaadin.flow.component.Component component)
    Returns the label of a component that doesn't implement HasLabel.
    boolean
    isClosedDialog(com.vaadin.flow.component.Component component)
    Checks whether the component is a closed dialog that a browser would have removed from the DOM after closing it.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FlowComponentsSupport

      public FlowComponentsSupport()
      Creates the support; looked up through the service loader.
  • Method Details

    • getAllChildren

      public List<com.vaadin.flow.component.Component> getAllChildren(com.vaadin.flow.component.Component component)
      Description copied from interface: ComponentSupport
      Returns all children of the component as seen by component lookups, including the ones that are not part of the regular component hierarchy, such as a Grid's header components.
      Specified by:
      getAllChildren in interface ComponentSupport
      Parameters:
      component - the component, not null.
      Returns:
      the children, or null if this implementation doesn't handle the component.
    • isClosedDialog

      public boolean isClosedDialog(com.vaadin.flow.component.Component component)
      Description copied from interface: ComponentSupport
      Checks whether the component is a closed dialog that a browser would have removed from the DOM after closing it. Such components are removed from the UI after every round trip. The component is removed if any implementation returns true.
      Specified by:
      isClosedDialog in interface ComponentSupport
      Parameters:
      component - the component, not null.
      Returns:
      true if the component should be removed.
    • getDialogTypes

      public Collection<Class<? extends com.vaadin.flow.component.Component>> getDialogTypes()
      Description copied from interface: ComponentSupport
      Returns the dialog types that Locator._expectNoDialogs() checks for. The types of all implementations are checked together.
      Specified by:
      getDialogTypes in interface ComponentSupport
      Returns:
      the dialog types, not null.
    • firesClosedEvent

      public boolean firesClosedEvent(com.vaadin.flow.component.Component component)
      Description copied from interface: ComponentSupport
      Checks whether the component is an overlay whose client-side part fires a closed DOM event once it has closed, which the mocked environment then simulates. The event is simulated if any implementation returns true.
      Specified by:
      firesClosedEvent in interface ComponentSupport
      Parameters:
      component - the component, not null.
      Returns:
      true if the closed event should be simulated.
    • describe

      public void describe(com.vaadin.flow.component.Component component, List<String> description)
      Description copied from interface: ComponentSupport
      Adds component-specific details to the one-line description produced by PrettyPrintTree.toPrettyString(Component). Every implementation is asked, in order.
      Specified by:
      describe in interface ComponentSupport
      Parameters:
      component - the component, not null.
      description - the description parts collected so far, to add to.
    • getDataProvider

      public com.vaadin.flow.data.provider.DataProvider<?,?> getDataProvider(com.vaadin.flow.component.Component component)
      Description copied from interface: ComponentSupport
      Returns the data provider currently set to the component.
      Specified by:
      getDataProvider in interface ComponentSupport
      Parameters:
      component - the component, not null.
      Returns:
      the data provider, or null if this implementation doesn't handle the component or none is set.
    • getLabel

      public String getLabel(com.vaadin.flow.component.Component component)
      Description copied from interface: ComponentSupport
      Returns the label of a component that doesn't implement HasLabel.
      Specified by:
      getLabel in interface ComponentSupport
      Parameters:
      component - the component, not null.
      Returns:
      the label, an empty string if the component has none, or null if this implementation doesn't handle the component.
    • getCaption

      public String getCaption(com.vaadin.flow.component.Component component)
      Description copied from interface: ComponentSupport
      Returns the caption of a component that shows it directly on itself, such as a button's text.
      Specified by:
      getCaption in interface ComponentSupport
      Parameters:
      component - the component, not null.
      Returns:
      the caption, or null if this implementation doesn't handle the component.