Class BasicUtilsKt

  • All Implemented Interfaces:

    
    public final class BasicUtilsKt
    
                        
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      String getId_()
      void setId_(String id_)
      final Boolean get_isVisible()
      final String get_text()
      final Integer get_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 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.

      final static Unit expectNotEditableByUser(Component $self) Fails if the component is editable.
      final static Boolean isEffectivelyEnabled(Component $self) Computes whether this component and all of its parents are enabled.
      final static Boolean matches(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.
      • Methods inherited from class java.lang.Object

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

    • Method Detail

      • _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.