Package com.vaadin.ui
Class AbstractComponentContainer
- java.lang.Object
-
- com.vaadin.server.AbstractClientConnector
-
- com.vaadin.ui.AbstractComponent
-
- com.vaadin.ui.AbstractComponentContainer
-
- All Implemented Interfaces:
ContextClickEvent.ContextClickNotifier
,MethodEventSource
,ClientConnector
,Sizeable
,Connector
,Component
,ComponentContainer
,HasComponents
,HasComponents.ComponentAttachDetachNotifier
,Serializable
,Iterable<Component>
- Direct Known Subclasses:
AbstractLayout
,AbstractSplitPanel
,TabSheet
public abstract class AbstractComponentContainer extends AbstractComponent implements ComponentContainer
Extension toAbstractComponent
that defines the default implementation for the methods inComponentContainer
. Basic UI components that need to contain other components inherit this class to easily qualify as a component container.- Since:
- 3.0
- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.vaadin.server.ClientConnector
ClientConnector.AttachEvent, ClientConnector.AttachListener, ClientConnector.ConnectorErrorEvent, ClientConnector.DetachEvent, ClientConnector.DetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
-
Nested classes/interfaces inherited from interface com.vaadin.ui.HasComponents
HasComponents.ComponentAttachDetachNotifier, HasComponents.ComponentAttachEvent, HasComponents.ComponentAttachListener, HasComponents.ComponentDetachEvent, HasComponents.ComponentDetachListener
-
Nested classes/interfaces inherited from interface com.vaadin.server.Sizeable
Sizeable.Unit
-
-
Field Summary
-
Fields inherited from class com.vaadin.ui.AbstractComponent
DESIGN_ATTR_PLAIN_TEXT
-
Fields inherited from interface com.vaadin.server.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
-
-
Constructor Summary
Constructors Constructor Description AbstractComponentContainer()
Constructs a new component container.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addComponent(Component c)
This only implements the events and component parent calls.void
addComponentAttachListener(HasComponents.ComponentAttachListener listener)
Listens the component attach events.void
addComponentDetachListener(HasComponents.ComponentDetachListener listener)
Listens the component detach events.void
addComponents(Component... components)
Adds the components in the given order to this component container.void
addListener(HasComponents.ComponentAttachListener listener)
Deprecated.As of 7.0, replaced byaddComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)
void
addListener(HasComponents.ComponentDetachListener listener)
Deprecated.As of 7.0, replaced byaddComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)
protected void
fireComponentAttachEvent(Component component)
Fires the component attached event.protected void
fireComponentDetachEvent(Component component)
Fires the component detached event.Iterator<Component>
getComponentIterator()
Deprecated.As of 7.0, useHasComponents.iterator()
instead.void
moveComponentsFrom(ComponentContainer source)
Moves all components from an another container into this container.void
removeAllComponents()
Removes all components from the container.void
removeComponent(Component c)
This only implements the events and component parent calls.void
removeComponentAttachListener(HasComponents.ComponentAttachListener listener)
Stops the listening component attach events.void
removeComponentDetachListener(HasComponents.ComponentDetachListener listener)
Stops the listening component detach events.void
removeListener(HasComponents.ComponentAttachListener listener)
Deprecated.As of 7.0, replaced byremoveComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)
void
removeListener(HasComponents.ComponentDetachListener listener)
Deprecated.As of 7.0, replaced byremoveComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)
void
setHeight(float height, Sizeable.Unit unit)
Sets the height of the object.void
setWidth(float width, Sizeable.Unit unit)
Sets the width of the object.-
Methods inherited from class com.vaadin.ui.AbstractComponent
addContextClickListener, addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getExplicitImmediateValue, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getState, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isResponsive, isVisible, readDesign, removeContextClickListener, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setResponsive, setSizeFull, setSizeUndefined, setStyleName, setStyleName, setVisible, setWidth, setWidthUndefined, writeDesign
-
Methods inherited from class com.vaadin.server.AbstractClientConnector
addAttachListener, addDetachListener, addExtension, addListener, addListener, addListener, addMethodInvocationToQueue, createState, encodeState, equals, fireEvent, getAllChildrenIterable, getConnectorId, getErrorHandler, getExtensions, getListeners, getResource, getRpcManager, getRpcProxy, getSession, getStateType, getUI, handleConnectorRequest, hashCode, hasListeners, isAttached, isThis, markAsDirty, markAsDirtyRecursive, registerRpc, registerRpc, removeAttachListener, removeDetachListener, removeExtension, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler, setResource
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.vaadin.server.ClientConnector
addAttachListener, addDetachListener, beforeClientResponse, detach, encodeState, getErrorHandler, getExtensions, getRpcManager, getStateType, handleConnectorRequest, isAttached, isConnectorEnabled, markAsDirty, markAsDirtyRecursive, removeAttachListener, removeDetachListener, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setErrorHandler
-
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, attach, getCaption, getDescription, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getStyleName, getUI, isEnabled, isReadOnly, isVisible, readDesign, removeListener, removeStyleName, setCaption, setEnabled, setIcon, setId, setParent, setPrimaryStyleName, setReadOnly, setStyleName, setVisible, writeDesign
-
Methods inherited from interface com.vaadin.ui.ComponentContainer
getComponentCount, replaceComponent
-
Methods inherited from interface com.vaadin.shared.Connector
getConnectorId
-
Methods inherited from interface com.vaadin.ui.HasComponents
iterator
-
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidthUndefined
-
-
-
-
Method Detail
-
addComponents
public void addComponents(Component... components)
Description copied from interface:ComponentContainer
Adds the components in the given order to this component container.- Specified by:
addComponents
in interfaceComponentContainer
- Parameters:
components
- The components to add.
-
removeAllComponents
public void removeAllComponents()
Removes all components from the container. This should probably be re-implemented in extending classes for a more powerful implementation.- Specified by:
removeAllComponents
in interfaceComponentContainer
-
moveComponentsFrom
public void moveComponentsFrom(ComponentContainer source)
Description copied from interface:ComponentContainer
Moves all components from an another container into this container. The components are removed fromsource
.- Specified by:
moveComponentsFrom
in interfaceComponentContainer
- Parameters:
source
- the container which contains the components that are to be moved to this container.
-
addComponentAttachListener
public void addComponentAttachListener(HasComponents.ComponentAttachListener listener)
Description copied from interface:HasComponents.ComponentAttachDetachNotifier
Listens the component attach events.- Specified by:
addComponentAttachListener
in interfaceHasComponents.ComponentAttachDetachNotifier
- Parameters:
listener
- the listener to add.
-
addListener
@Deprecated public void addListener(HasComponents.ComponentAttachListener listener)
Deprecated.As of 7.0, replaced byaddComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)
- Specified by:
addListener
in interfaceComponentContainer
-
removeComponentAttachListener
public void removeComponentAttachListener(HasComponents.ComponentAttachListener listener)
Description copied from interface:HasComponents.ComponentAttachDetachNotifier
Stops the listening component attach events.- Specified by:
removeComponentAttachListener
in interfaceHasComponents.ComponentAttachDetachNotifier
- Parameters:
listener
- the listener to removed.
-
addListener
@Deprecated public void addListener(HasComponents.ComponentDetachListener listener)
Deprecated.As of 7.0, replaced byaddComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)
- Specified by:
addListener
in interfaceComponentContainer
-
addComponentDetachListener
public void addComponentDetachListener(HasComponents.ComponentDetachListener listener)
Description copied from interface:HasComponents.ComponentAttachDetachNotifier
Listens the component detach events.- Specified by:
addComponentDetachListener
in interfaceHasComponents.ComponentAttachDetachNotifier
-
removeListener
@Deprecated public void removeListener(HasComponents.ComponentAttachListener listener)
Deprecated.As of 7.0, replaced byremoveComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)
- Specified by:
removeListener
in interfaceComponentContainer
-
removeComponentDetachListener
public void removeComponentDetachListener(HasComponents.ComponentDetachListener listener)
Description copied from interface:HasComponents.ComponentAttachDetachNotifier
Stops the listening component detach events.- Specified by:
removeComponentDetachListener
in interfaceHasComponents.ComponentAttachDetachNotifier
-
removeListener
@Deprecated public void removeListener(HasComponents.ComponentDetachListener listener)
Deprecated.As of 7.0, replaced byremoveComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)
- Specified by:
removeListener
in interfaceComponentContainer
-
fireComponentAttachEvent
protected void fireComponentAttachEvent(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(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.
-
addComponent
public void addComponent(Component c)
This only implements the events and component parent calls. The extending classes must implement component list maintenance and call this method after component list maintenance.- Specified by:
addComponent
in interfaceComponentContainer
- Parameters:
c
- the component to be added.- See Also:
ComponentContainer.addComponent(Component)
-
removeComponent
public void removeComponent(Component c)
This only implements the events and component parent calls. The extending classes must implement component list maintenance and call this method before component list maintenance.- Specified by:
removeComponent
in interfaceComponentContainer
- Parameters:
c
- the component to be removed.- See Also:
ComponentContainer.removeComponent(Component)
-
setWidth
public void setWidth(float width, Sizeable.Unit unit)
Description copied from interface:Sizeable
Sets the width of the object. Negative number implies unspecified size (terminal is free to set the size).- Specified by:
setWidth
in interfaceSizeable
- Overrides:
setWidth
in classAbstractComponent
- Parameters:
width
- the width of the object.unit
- the unit used for the width.
-
setHeight
public void setHeight(float height, Sizeable.Unit unit)
Description copied from interface:Sizeable
Sets the height of the object. Negative number implies unspecified size (terminal is free to set the size).- Specified by:
setHeight
in interfaceSizeable
- Overrides:
setHeight
in classAbstractComponent
- Parameters:
height
- the height of the object.unit
- the unit used for the width.
-
getComponentIterator
@Deprecated public Iterator<Component> getComponentIterator()
Deprecated.As of 7.0, useHasComponents.iterator()
instead.Gets an iterator to the collection of contained components. Using this iterator it is possible to step through all components contained in this container.- Specified by:
getComponentIterator
in interfaceComponentContainer
- Returns:
- the component iterator.
-
-