Package com.vaadin.featurepack.ui
Class CustomComponent
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
com.vaadin.featurepack.ui.CustomComponent
- All Implemented Interfaces:
ClientConnector,FAbstractClientConnector,FSizeable,HasSizeable,FAbstractComponent,HasComponents,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,Serializable,Iterable<com.vaadin.flow.component.Component>
public class CustomComponent
extends com.vaadin.flow.component.Composite<com.vaadin.flow.component.html.Div>
implements HasComponents, FAbstractComponent, HasSizeable
Legacy version of CustomComponent that resembles Vaadin 7/8's CustomComponent
API as closely as possible in order to facilitate migration to newer versions
of Vaadin.
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.featurepack.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.DetachEvent, ClientConnector.DetachListenerNested classes/interfaces inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
FAbstractClientConnector.LegacyMethodEventNested classes/interfaces inherited from interface com.vaadin.featurepack.ui.FAbstractComponent
FAbstractComponent.DataKeyNested classes/interfaces inherited from interface com.vaadin.featurepack.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new custom component.CustomComponent(com.vaadin.flow.component.Component compositionRoot) Constructs a new custom component. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidfireEvent(com.vaadin.flow.component.ComponentEvent<?> componentEvent) intGets the number of contained components.protected com.vaadin.flow.component.ComponentReturns the composition root.Iterator<com.vaadin.flow.component.Component> iterator()Gets an iterator to the collection of contained components.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) protected voidonDetach(com.vaadin.flow.component.DetachEvent detachEvent) protected voidsetCompositionRoot(com.vaadin.flow.component.Component compositionRoot) Sets the composition root for the component.voidsetLabelComponent(com.vaadin.flow.component.Component labelComponent) Sets the component's label component.Methods inherited from class com.vaadin.flow.component.Composite
getChildren, getContent, getElement, initContentMethods inherited from class com.vaadin.flow.component.Component
addListener, bindVisible, findAncestor, findAncestor, from, get, getEventBus, getId, getListeners, getLocale, getParent, getTestId, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, getUIOrThrow, hasListener, isAttached, isTemplateMapped, isVisible, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setTestId, setVisible, whenAttachedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.featurepack.server.FAbstractClientConnector
addLegacyAttachListener, addLegacyDetachListener, addListener, addListener, attach, detach, doConnectorOnAttach, doConnectorOnDetach, fireEvent, fireEvent, getAllChildrenIterable, getFListeners, getFlowComponent, getResource, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeListener, removeListener, setResourceMethods inherited from interface com.vaadin.featurepack.ui.FAbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, addStyleNames, beforeClientResponse, getCaption, getComponentError, getData, getDescription, getFErrorIndicator, getFErrorMessage, getFId, getFParent, getIcon, getIconResource, getPrimaryStyleName, getStyleName, isCaptionAsHtml, isImmediate, isResponsive, notifyParentAboutStyleChanges, removeContextClickListener, removeShortcutListener, removeStyleName, removeStyleNames, setCaption, setCaptionAsHtml, setComponentError, setData, setDescription, setDescription, setIcon, setIcon, setIconResource, setImmediate, setLocale, setPrimaryStyleName, setResponsive, setStyleName, setStyleNameMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
bindEnabled, isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasSize
bindHeight, bindWidth, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidthMethods inherited from interface com.vaadin.featurepack.server.HasSizeable
getFHeight, getFWidth, getHeightUnits, getWidthUnits, setHeight, setHeight, setHeightFull, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull, setWidthUndefinedMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, bindClassName, bindClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
CustomComponent
public CustomComponent()Constructs a new custom component.Note that you must set the composition root before the component can be used, preferably in the constructor.
-
CustomComponent
public CustomComponent(com.vaadin.flow.component.Component compositionRoot) Constructs a new custom component.- Parameters:
compositionRoot- the root of the composition component tree. It must not be null.
-
-
Method Details
-
getCompositionRoot
protected com.vaadin.flow.component.Component getCompositionRoot()Returns the composition root.- Returns:
- the Component Composition root.
-
setCompositionRoot
protected void setCompositionRoot(com.vaadin.flow.component.Component compositionRoot) Sets the composition root for the component.You must set the composition root to a non-null value before the component can be used. You can change it later.
- Parameters:
compositionRoot- the root of the composition component tree.
-
iterator
Description copied from interface:HasComponentsGets an iterator to the collection of contained components. Using this iterator it is possible to step through all components contained in this container.The iterator is typically unmodifiable, and calls to
Iterator.remove()throw an exception.- Specified by:
iteratorin interfaceHasComponents- Specified by:
iteratorin interfaceIterable<com.vaadin.flow.component.Component>- Returns:
- the component iterator.
-
getComponentCount
public int getComponentCount()Gets the number of contained components.- Returns:
- the number of contained components (zero or one)
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
onDetach
protected void onDetach(com.vaadin.flow.component.DetachEvent detachEvent) - Overrides:
onDetachin classcom.vaadin.flow.component.Component
-
setLabelComponent
public void setLabelComponent(com.vaadin.flow.component.Component labelComponent) Description copied from interface:FAbstractComponentSets the component's label component. Flow components that support caption component usually overrides this.- Specified by:
setLabelComponentin interfaceFAbstractComponent- Parameters:
labelComponent- the new label component for the component.
-
fireEvent
protected void fireEvent(com.vaadin.flow.component.ComponentEvent<?> componentEvent) - Overrides:
fireEventin classcom.vaadin.flow.component.Component
-