Package com.vaadin.mpr.core
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.HasStyleA wrapper that allows adding legacy components into Flow layouts.By default the wrapper creates a
divon the client side, where the legacy component is added. The wrapperdivinherits the width and height of its parent. This behavior can be changed by setting a specific size to it.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONTEXT_RELATIVE_PATHprotected static Map<com.vaadin.ui.Component,WeakReference<AbstractLegacyWrapper>>legacyMapstatic StringTHEME_KEYstatic StringWIDGETSET_KEY
-
Constructor Summary
Constructors Constructor Description AbstractLegacyWrapper(com.vaadin.ui.Component legacyComponent)LegacyWrapper constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract AbstractMprUIContentcreateMprUIContent()Get a new MprUIContent object instance.com.vaadin.ui.ComponentgetLegacyComponent()Gets the legacy component set in this wrapper in the constructor.protected abstract AbstractLegacyEmbedgetLegacyEmbed(com.vaadin.flow.component.UI ui)Get a LegacyEmbed object instance for given Flow UI.voidonEnabledStateChanged(boolean enabled)voidsetHeightFull()voidsetSizeFull()-
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, 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.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeUndefined, setWidth, setWidth, setWidthFull
-
-
-
-
Field Detail
-
THEME_KEY
public static final String THEME_KEY
- See Also:
- Constant Field Values
-
WIDGETSET_KEY
public static final String WIDGETSET_KEY
- See Also:
- Constant Field Values
-
CONTEXT_RELATIVE_PATH
public static final String CONTEXT_RELATIVE_PATH
- See Also:
- Constant Field Values
-
legacyMap
protected static Map<com.vaadin.ui.Component,WeakReference<AbstractLegacyWrapper>> legacyMap
-
-
Method Detail
-
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:
onEnabledStateChangedin classcom.vaadin.flow.component.Component
-
setSizeFull
public void setSizeFull()
- Specified by:
setSizeFullin interfacecom.vaadin.flow.component.HasSize
-
setHeightFull
public void setHeightFull()
- Specified by:
setHeightFullin interfacecom.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
-
-