Class BasicUtilsKt
-
- All Implemented Interfaces:
public final class BasicUtilsKt
-
-
Field Summary
Fields Modifier and Type Field Description private static Stringid_private final static Boolean_isVisibleprivate final static String_textprivate final static Integer_saneFetchLimit
-
Method Summary
Modifier and Type Method Description StringgetId_()voidsetId_(String id_)final Booleanget_isVisible()final Stringget_text()final Integerget_saneFetchLimit()final static Unit_fireEvent(Component $self, ComponentEvent<?> event)Allows us to fire any Vaadin event on any Vaadin component. final static Unit_fireDomEvent(Component $self, String eventType, JsonObject eventData)Fires a DOM event on this component. final static Unit_fireDomEvent(Component $self, String eventType)Fires a DOM event on this component. final static UnitcheckEditableByUser(Component $self)Checks that a component is actually editable by the user: The component must be effectively visible: it itself must be visible, its parent must be visible and all of its ascendants must be visible. For the purpose of testing individual components not attached to the UI, a component may be considered visible even though it's not currently nested in a UI.
The component must be effectively enabled: it itself must be enabled, its parent must be enabled and all of its ascendants must be enabled.
If the component is HasValue, it must not be HasValue.isReadOnly.
final static UnitexpectNotEditableByUser(Component $self)Fails if the component is editable. final static BooleanisEffectivelyEnabled(Component $self)Computes whether this component and all of its parents are enabled. final static Booleanmatches(Component $self, Function1<SearchSpec<Component>, Unit> spec)Checks whether this component matches given spec. final static <T extends Focusable<?>, Component> Unit_focus(T $self)Fires FocusNotifier.FocusEvent on the component, but only if it's editable. final static <T extends Focusable<?>, Component> Unit_blur(T $self)Fires BlurNotifier.BlurEvent on the component, but only if it's editable. final static Unit_close(UI $self)Closes the UI and simulates the end of the request. final static List<Component>_getVirtualChildren(Component $self)Returns child components which were added to this component via com.vaadin.flow.dom.Element.appendVirtualChild. -
-
Method Detail
-
get_isVisible
final Boolean get_isVisible()
-
get_saneFetchLimit
final Integer get_saneFetchLimit()
-
_fireEvent
final static Unit _fireEvent(Component $self, ComponentEvent<?> event)
Allows us to fire any Vaadin event on any Vaadin component.
- Parameters:
event- the event, not null.
-
_fireDomEvent
final static Unit _fireDomEvent(Component $self, String eventType, JsonObject eventData)
Fires a DOM event on this component.
- Parameters:
eventType- the event type, e.g.eventData- optional event data, defaults to an empty object.
-
_fireDomEvent
final static Unit _fireDomEvent(Component $self, String eventType)
Fires a DOM event on this component.
- Parameters:
eventType- the event type, e.g.
-
checkEditableByUser
final static Unit checkEditableByUser(Component $self)
Checks that a component is actually editable by the user:
The component must be effectively visible: it itself must be visible, its parent must be visible and all of its ascendants must be visible. For the purpose of testing individual components not attached to the UI, a component may be considered visible even though it's not currently nested in a UI.
The component must be effectively enabled: it itself must be enabled, its parent must be enabled and all of its ascendants must be enabled.
If the component is HasValue, it must not be HasValue.isReadOnly.
-
expectNotEditableByUser
final static Unit expectNotEditableByUser(Component $self)
Fails if the component is editable. See checkEditableByUser for more details.
-
isEffectivelyEnabled
final static Boolean isEffectivelyEnabled(Component $self)
Computes whether this component and all of its parents are enabled.
Recursively checks that all ancestors are also enabled (the "implicitly disabled" effect, see HasEnabled.isEnabled javadoc for more details).
Also check that the component is not inert due to there being a modal component.
- Returns:
false if this component or any of its parent is disabled or is inert.
-
matches
final static Boolean matches(Component $self, Function1<SearchSpec<Component>, Unit> spec)
Checks whether this component matches given spec. All rules are matched except the count rule. The rules are matched against given component only (not against its children).
-
_focus
final static <T extends Focusable<?>, Component> Unit _focus(T $self)
Fires FocusNotifier.FocusEvent on the component, but only if it's editable.
-
_blur
final static <T extends Focusable<?>, Component> Unit _blur(T $self)
Fires BlurNotifier.BlurEvent on the component, but only if it's editable.
-
_close
final static Unit _close(UI $self)
Closes the UI and simulates the end of the request. The UI.close is called, but also the session is set to null which fires the detach listeners and makes the UI and all of its components detached.
-
_getVirtualChildren
final static List<Component> _getVirtualChildren(Component $self)
Returns child components which were added to this component via com.vaadin.flow.dom.Element.appendVirtualChild.
-
-
-