com.vaadin.ui
Class AbstractComponentContainer

java.lang.Object
  extended by com.vaadin.server.AbstractClientConnector
      extended by com.vaadin.ui.AbstractComponent
          extended by com.vaadin.ui.AbstractComponentContainer
All Implemented Interfaces:
MethodEventSource, ClientConnector, Sizeable, com.vaadin.shared.Connector, Component, ComponentContainer, HasComponents, HasComponents.ComponentAttachDetachNotifier, java.io.Serializable, java.lang.Iterable<Component>
Direct Known Subclasses:
AbstractLayout, AbstractSplitPanel, TabSheet

public abstract class AbstractComponentContainer
extends AbstractComponent
implements ComponentContainer

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.

Since:
3.0
Author:
Vaadin Ltd
See Also:
Serialized Form

Nested Class Summary
 
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.ui.Component
Component.ErrorEvent, Component.Event, Component.Focusable, Component.Listener
 
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.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
AbstractComponentContainer()
          Constructs a new component container.
 
Method Summary
 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 by #addComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)
 void addListener(HasComponents.ComponentDetachListener listener)
          Deprecated. As of 7.0, replaced by #addComponentDetachListener(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.
 java.util.Iterator<Component> getComponentIterator()
          Deprecated. As of 7.0, use HasComponents.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 by #removeComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)
 void removeListener(HasComponents.ComponentDetachListener listener)
          Deprecated. As of 7.0, replaced by #removeComponentDetachListener(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
addListener, addShortcutListener, addStyleName, attach, beforeClientResponse, detach, findAncestor, fireComponentErrorEvent, fireComponentEvent, focus, getActionManager, getCaption, getComponentError, getCustomAttributes, getData, getDebugId, getDescription, getErrorMessage, getHeight, getHeightUnits, getIcon, getId, getLocale, getParent, getPrimaryStyleName, getState, getState, getStyleName, getWidth, getWidthUnits, isCaptionAsHtml, isConnectorEnabled, isEnabled, isImmediate, isOrHasAncestor, isReadOnly, isVisible, readDesign, removeListener, removeShortcutListener, removeStyleName, setCaption, setCaptionAsHtml, setComponentError, setData, setDebugId, setDescription, setEnabled, setHeight, setHeightUndefined, setIcon, setId, setImmediate, setLocale, setParent, setPrimaryStyleName, setReadOnly, setSizeFull, setSizeUndefined, 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.ui.ComponentContainer
getComponentCount, replaceComponent
 
Methods inherited from interface com.vaadin.ui.HasComponents
iterator
 
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.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.shared.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.server.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeightUndefined, setSizeFull, setSizeUndefined, setWidth, setWidthUndefined
 

Constructor Detail

AbstractComponentContainer

public AbstractComponentContainer()
Constructs a new component container.

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 interface ComponentContainer
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 interface ComponentContainer

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 from source.

Specified by:
moveComponentsFrom in interface ComponentContainer
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 interface HasComponents.ComponentAttachDetachNotifier
Parameters:
listener - the listener to add.

addListener

@Deprecated
public void addListener(HasComponents.ComponentAttachListener listener)
Deprecated. As of 7.0, replaced by #addComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)

Specified by:
addListener in interface ComponentContainer

removeComponentAttachListener

public void removeComponentAttachListener(HasComponents.ComponentAttachListener listener)
Description copied from interface: HasComponents.ComponentAttachDetachNotifier
Stops the listening component attach events.

Specified by:
removeComponentAttachListener in interface HasComponents.ComponentAttachDetachNotifier
Parameters:
listener - the listener to removed.

addListener

@Deprecated
public void addListener(HasComponents.ComponentDetachListener listener)
Deprecated. As of 7.0, replaced by #addComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)

Specified by:
addListener in interface ComponentContainer

addComponentDetachListener

public void addComponentDetachListener(HasComponents.ComponentDetachListener listener)
Description copied from interface: HasComponents.ComponentAttachDetachNotifier
Listens the component detach events.

Specified by:
addComponentDetachListener in interface HasComponents.ComponentAttachDetachNotifier

removeListener

@Deprecated
public void removeListener(HasComponents.ComponentAttachListener listener)
Deprecated. As of 7.0, replaced by #removeComponentAttachListener(com.vaadin.ui.ComponentContainer.ComponentAttachListener)

Specified by:
removeListener in interface ComponentContainer

removeComponentDetachListener

public void removeComponentDetachListener(HasComponents.ComponentDetachListener listener)
Description copied from interface: HasComponents.ComponentAttachDetachNotifier
Stops the listening component detach events.

Specified by:
removeComponentDetachListener in interface HasComponents.ComponentAttachDetachNotifier

removeListener

@Deprecated
public void removeListener(HasComponents.ComponentDetachListener listener)
Deprecated. As of 7.0, replaced by #removeComponentDetachListener(com.vaadin.ui.ComponentContainer.ComponentDetachListener)

Specified by:
removeListener in interface ComponentContainer

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 interface ComponentContainer
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 interface ComponentContainer
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 interface Sizeable
Overrides:
setWidth in class AbstractComponent
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 interface Sizeable
Overrides:
setHeight in class AbstractComponent
Parameters:
height - the height of the object.
unit - the unit used for the width.

getComponentIterator

@Deprecated
public java.util.Iterator<Component> getComponentIterator()
Deprecated. As of 7.0, use HasComponents.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 interface ComponentContainer
Returns:
the component iterator.


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.