Package com.vaadin.classic.v8.ui
Class AbstractComponentContainer
java.lang.Object
com.vaadin.flow.component.Component
com.vaadin.classic.v8.server.AbstractClientConnector
com.vaadin.classic.v8.ui.AbstractComponent
com.vaadin.classic.v8.ui.AbstractComponentContainer
- All Implemented Interfaces:
ClientConnector,Sizeable,ComponentContainer,HasComponents,HasComponents.ComponentAttachDetachNotifier,com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasComponents,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasEnabled,com.vaadin.flow.component.HasStyle,Serializable,Iterable<com.vaadin.flow.component.Component>
- Direct Known Subclasses:
AbstractLayout
public abstract class AbstractComponentContainer
extends AbstractComponent
implements ComponentContainer
Legacy version of AbstractComponentContainer that resembles Vaadin 7/8's
AbstractComponentContainer API as closely as possible in order to facilitate
migration to newer versions of Vaadin.
Extension to AbstractComponent that defines the default
implementation for the methods in ComponentContainer. Basic UI
components that need to contain other components inherit this class to easily
qualify as a component container.
- Author:
- Vaadin Ltd
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.vaadin.classic.v8.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.DetachEvent, ClientConnector.DetachListenerNested classes/interfaces inherited from interface com.vaadin.classic.v8.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListenerNested classes/interfaces inherited from interface com.vaadin.classic.v8.server.Sizeable
Sizeable.Unit -
Field Summary
Fields inherited from interface com.vaadin.classic.v8.server.Sizeable
SIZE_UNDEFINED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(com.vaadin.flow.component.Component... components) voidaddComponent(com.vaadin.flow.component.Component component) Adds the component into this container.com.vaadin.flow.shared.RegistrationListens the component attach events.com.vaadin.flow.shared.RegistrationListens the component detach events.voidaddComponents(com.vaadin.flow.component.Component... components) Adds the components in the given order to this component container.protected voidfireComponentAttachEvent(com.vaadin.flow.component.Component component) Fires the component attached event.protected voidfireComponentDetachEvent(com.vaadin.flow.component.Component component) Fires the component detached event.Iterator<com.vaadin.flow.component.Component>iterator()Gets the component container iterator for going through all the components in the container.voidmoveComponentsFrom(ComponentContainer source) Moves all components from another container into this container.voidremove(com.vaadin.flow.component.Component... components) voidvoidRemoves all components from this container.voidremoveComponent(com.vaadin.flow.component.Component component) Removes the component from this container.voidsetHeight(float height, Sizeable.Unit unit) Sets the height of the object.voidsetWidth(float width, Sizeable.Unit unit) Sets the width of the object.Methods inherited from class com.vaadin.classic.v8.ui.AbstractComponent
addInternalStyles, addListener, addShortcutListener, addStyleName, addStyleNames, beforeClientResponse, doSetHeight, doSetWidth, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getCustomStyles, getData, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getInternalStyles, getLocale, getPrimaryStyleName, getState, getState, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isEnabled, isOrHasAncestor, isReadOnly, isRequiredIndicatorVisible, isResponsive, isVisible, notifyParentAboutStyleChanges, onEnabledStateChanged, removeInternalStyles, removeStyleName, removeStyleNames, setCaption, setCaptionAsHtml, setComponentError, setData, setDescription, setDescription, setEnabled, setHeight, setHeightFull, setHeightUndefined, setIcon, setLocale, setParent, setPrimaryStyleName, setReadOnly, setRequiredIndicatorVisible, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidthFull, setWidthUndefinedMethods inherited from class com.vaadin.classic.v8.server.AbstractClientConnector
addExtension, addLegacyAttachListener, addLegacyDetachListener, addListener, addListener, addMethodInvocationToQueue, attach, createState, detach, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getResource, getSession, handleConnectorRequest, hasListeners, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, onAttach, onDetach, registerRpc, registerRpc, removeExtension, setErrorHandler, setResource, updateDiffstateMethods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isTemplateMapped, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setIdMethods 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.classic.v8.ui.ComponentContainer
getComponentCount, replaceComponentMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasComponents
add, add, addComponentAsFirst, addComponentAtIndex, removeMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasEnabled
isEnabled, setEnabledMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
AbstractComponentContainer
public AbstractComponentContainer()
-
-
Method Details
-
addComponent
public void addComponent(com.vaadin.flow.component.Component component) Description copied from interface:ComponentContainerAdds the component into this container.- Specified by:
addComponentin interfaceComponentContainer- Parameters:
component- the component to be added.
-
addComponents
public void addComponents(com.vaadin.flow.component.Component... components) Description copied from interface:ComponentContainerAdds the components in the given order to this component container.- Specified by:
addComponentsin interfaceComponentContainer- Parameters:
components- The components to add.
-
add
public void add(com.vaadin.flow.component.Component... components) - Specified by:
addin interfacecom.vaadin.flow.component.HasComponents
-
moveComponentsFrom
Moves all components from another container into this container. The components are removed fromsource.Note that only
componentsare moved fromsourceinto this container. If an element in thesourcedoes not have a component, it will remain in thesource.- Specified by:
moveComponentsFromin interfaceComponentContainer- Parameters:
source- the container which contains the components that are to be moved to this container.
-
removeAllComponents
public void removeAllComponents()Description copied from interface:ComponentContainerRemoves all components from this container.- Specified by:
removeAllComponentsin interfaceComponentContainer
-
removeAll
public void removeAll()- Specified by:
removeAllin interfacecom.vaadin.flow.component.HasComponents
-
removeComponent
public void removeComponent(com.vaadin.flow.component.Component component) Description copied from interface:ComponentContainerRemoves the component from this container.- Specified by:
removeComponentin interfaceComponentContainer- Parameters:
component- the component to be removed.
-
remove
public void remove(com.vaadin.flow.component.Component... components) - Specified by:
removein interfacecom.vaadin.flow.component.HasComponents
-
iterator
Gets the component container iterator for going through all the components in the container.- Specified by:
iteratorin interfaceHasComponents- Specified by:
iteratorin interfaceIterable<com.vaadin.flow.component.Component>- Returns:
- the Iterator of the components inside the container.
-
setHeight
Description copied from interface:SizeableSets the height of the object. Negative number implies unspecified size (terminal is free to set the size).- Specified by:
setHeightin interfaceSizeable- Overrides:
setHeightin classAbstractComponent- Parameters:
height- the height of the object.unit- the unit used for the width.
-
setWidth
Description copied from interface:SizeableSets the width of the object. Negative number implies unspecified size (terminal is free to set the size).- Specified by:
setWidthin interfaceSizeable- Overrides:
setWidthin classAbstractComponent- Parameters:
width- the width of the object.unit- the unit used for the width.
-
addComponentAttachListener
public com.vaadin.flow.shared.Registration addComponentAttachListener(HasComponents.ComponentAttachListener listener) Description copied from interface:HasComponents.ComponentAttachDetachNotifierListens the component attach events.- Specified by:
addComponentAttachListenerin interfaceHasComponents.ComponentAttachDetachNotifier- Parameters:
listener- the listener to add, not null- Returns:
- a registration object for removing the listener
- See Also:
-
Registration
-
addComponentDetachListener
public com.vaadin.flow.shared.Registration addComponentDetachListener(HasComponents.ComponentDetachListener listener) Description copied from interface:HasComponents.ComponentAttachDetachNotifierListens the component detach events.- Specified by:
addComponentDetachListenerin interfaceHasComponents.ComponentAttachDetachNotifier
-
fireComponentAttachEvent
protected void fireComponentAttachEvent(com.vaadin.flow.component.Component component) Fires the component attached event. This should be called by the addComponent methods after the component have been added to this container.- Parameters:
component- the component that has been added to this container.
-
fireComponentDetachEvent
protected void fireComponentDetachEvent(com.vaadin.flow.component.Component component) Fires the component detached event. This should be called by the removeComponent methods after the component have been removed from this container.- Parameters:
component- the component that has been removed from this container.
-