Package com.vaadin.browserless.internal
Class FlowComponentsSupport
java.lang.Object
com.vaadin.browserless.internal.FlowComponentsSupport
- All Implemented Interfaces:
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
ConstructorsConstructorDescriptionCreates the support; looked up through the service loader. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds component-specific details to the one-line description produced byPrettyPrintTree.toPrettyString(Component).booleanfiresClosedEvent(com.vaadin.flow.component.Component component) Checks whether the component is an overlay whose client-side part fires aclosedDOM 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 thatLocator._expectNoDialogs()checks for.getLabel(com.vaadin.flow.component.Component component) Returns the label of a component that doesn't implementHasLabel.booleanisClosedDialog(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.
-
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:ComponentSupportReturns 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:
getAllChildrenin interfaceComponentSupport- Parameters:
component- the component, not null.- Returns:
- the children, or
nullif this implementation doesn't handle the component.
-
isClosedDialog
public boolean isClosedDialog(com.vaadin.flow.component.Component component) Description copied from interface:ComponentSupportChecks 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:
isClosedDialogin interfaceComponentSupport- Parameters:
component- the component, not null.- Returns:
- true if the component should be removed.
-
getDialogTypes
Description copied from interface:ComponentSupportReturns the dialog types thatLocator._expectNoDialogs()checks for. The types of all implementations are checked together.- Specified by:
getDialogTypesin interfaceComponentSupport- Returns:
- the dialog types, not null.
-
firesClosedEvent
public boolean firesClosedEvent(com.vaadin.flow.component.Component component) Description copied from interface:ComponentSupportChecks whether the component is an overlay whose client-side part fires aclosedDOM event once it has closed, which the mocked environment then simulates. The event is simulated if any implementation returns true.- Specified by:
firesClosedEventin interfaceComponentSupport- Parameters:
component- the component, not null.- Returns:
- true if the
closedevent should be simulated.
-
describe
Description copied from interface:ComponentSupportAdds component-specific details to the one-line description produced byPrettyPrintTree.toPrettyString(Component). Every implementation is asked, in order.- Specified by:
describein interfaceComponentSupport- 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:ComponentSupportReturns the data provider currently set to the component.- Specified by:
getDataProviderin interfaceComponentSupport- Parameters:
component- the component, not null.- Returns:
- the data provider, or
nullif this implementation doesn't handle the component or none is set.
-
getLabel
Description copied from interface:ComponentSupportReturns the label of a component that doesn't implementHasLabel.- Specified by:
getLabelin interfaceComponentSupport- Parameters:
component- the component, not null.- Returns:
- the label, an empty string if the component has none, or
nullif this implementation doesn't handle the component.
-
getCaption
Description copied from interface:ComponentSupportReturns the caption of a component that shows it directly on itself, such as a button's text.- Specified by:
getCaptionin interfaceComponentSupport- Parameters:
component- the component, not null.- Returns:
- the caption, or
nullif this implementation doesn't handle the component.
-