Class AbstractLegacyWrapper

java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.mpr.core.AbstractLegacyWrapper
All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier, com.vaadin.flow.component.DetachNotifier, com.vaadin.flow.component.HasElement, com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle, Serializable

@Tag("div") public abstract class AbstractLegacyWrapper extends com.vaadin.flow.component.Component implements com.vaadin.flow.component.HasSize, com.vaadin.flow.component.HasStyle
A wrapper that allows adding legacy components into Flow layouts.

By default the wrapper creates a div on the client side, where the legacy component is added. The wrapper div inherits the width and height of its parent. This behavior can be changed by setting a specific size to it.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    protected static Map<com.vaadin.ui.Component,WeakReference<AbstractLegacyWrapper>>
     
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractLegacyWrapper(com.vaadin.ui.Component legacyComponent)
    LegacyWrapper constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract AbstractMprUIContent
    Get a new MprUIContent object instance.
    com.vaadin.ui.Component
    Gets the legacy component set in this wrapper in the constructor.
    protected abstract AbstractLegacyEmbed
    getLegacyEmbed(com.vaadin.flow.component.UI ui)
    Get a LegacyEmbed object instance for given Flow UI.
    void
    onEnabledStateChanged(boolean enabled)
     
    void
     
    void
     

    Methods inherited from class com.vaadin.flow.component.Component

    addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onAttach, onDetach, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisible

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.vaadin.flow.component.AttachNotifier

    addAttachListener

    Methods inherited from interface com.vaadin.flow.component.DetachNotifier

    addDetachListener

    Methods inherited from interface com.vaadin.flow.component.HasElement

    getElement

    Methods inherited from interface com.vaadin.flow.component.HasSize

    getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeUndefined, setWidth, setWidth, setWidthFull

    Methods inherited from interface com.vaadin.flow.component.HasStyle

    addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
  • Field Details

  • Constructor Details

    • AbstractLegacyWrapper

      public AbstractLegacyWrapper(com.vaadin.ui.Component legacyComponent)
      LegacyWrapper constructor.

      If this is the first legacy component then the Legacy client will be configured on attach of component.

      Parameters:
      legacyComponent - Legacy component to wrap
  • Method Details

    • getLegacyComponent

      public com.vaadin.ui.Component getLegacyComponent()
      Gets the legacy component set in this wrapper in the constructor.
      Returns:
      the legacy component, not null
    • onEnabledStateChanged

      public void onEnabledStateChanged(boolean enabled)
      Overrides:
      onEnabledStateChanged in class com.vaadin.flow.component.Component
    • setSizeFull

      public void setSizeFull()
      Specified by:
      setSizeFull in interface com.vaadin.flow.component.HasSize
    • setHeightFull

      public void setHeightFull()
      Specified by:
      setHeightFull in interface com.vaadin.flow.component.HasSize
    • getLegacyEmbed

      protected abstract AbstractLegacyEmbed getLegacyEmbed(com.vaadin.flow.component.UI ui)
      Get a LegacyEmbed object instance for given Flow UI.
      Parameters:
      ui - Flow UI
      Returns:
      LegacyEmbed instance
    • createMprUIContent

      protected abstract AbstractMprUIContent createMprUIContent()
      Get a new MprUIContent object instance.
      Returns:
      MprUIContent instance