com.vaadin.ui
Interface ComponentContainer

All Superinterfaces:
ClientConnector, Component, Connector, HasComponents, Iterable<Component>, RpcTarget, Serializable, Sizeable
All Known Subinterfaces:
Layout
All Known Implementing Classes:
AbsoluteLayout, AbstractComponentContainer, AbstractLayout, AbstractOrderedLayout, AbstractSplitPanel, Accordion, CssLayout, CustomComponent, CustomField, CustomLayout, DragAndDropWrapper, FormLayout, GridLayout, HorizontalLayout, HorizontalSplitPanel, LoginForm, Navigator.EmptyView, Navigator.SimpleViewDisplay, Panel, PopupView, Root, Root.LegacyWindow, TabSheet, VerticalLayout, VerticalSplitPanel, Window

public interface ComponentContainer
extends HasComponents

Extension to the Component interface which adds to it the capacity to contain other components. All UI elements that can have child elements implement this interface.

Since:
3.0
Version:
7.0.0.alpha3
Author:
Vaadin Ltd.

Nested Class Summary
static class ComponentContainer.ComponentAttachEvent
          Component attach event sent when a component is attached to container.
static interface ComponentContainer.ComponentAttachListener
          Component attach listener interface.
static class ComponentContainer.ComponentDetachEvent
          Component detach event sent when a component is detached from container.
static interface ComponentContainer.ComponentDetachListener
          Component detach listener interface.
 
Nested classes/interfaces inherited from interface com.vaadin.ui.Component
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.vaadin.terminal.Sizeable
Sizeable.Unit
 
Field Summary
 
Fields inherited from interface com.vaadin.terminal.Sizeable
SIZE_UNDEFINED, UNITS_CM, UNITS_EM, UNITS_EX, UNITS_INCH, UNITS_MM, UNITS_PERCENTAGE, UNITS_PICAS, UNITS_PIXELS, UNITS_POINTS
 
Method Summary
 void addComponent(Component c)
          Adds the component into this container.
 void addListener(ComponentContainer.ComponentAttachListener listener)
          Listens the component attach events.
 void addListener(ComponentContainer.ComponentDetachListener listener)
          Listens the component detach events.
 int getComponentCount()
          Gets the number of children this ComponentContainer has.
 void moveComponentsFrom(ComponentContainer source)
          Moves all components from an another container into this container.
 void removeAllComponents()
          Removes all components from this container.
 void removeComponent(Component c)
          Removes the component from this container.
 void removeListener(ComponentContainer.ComponentAttachListener listener)
          Stops the listening component attach events.
 void removeListener(ComponentContainer.ComponentDetachListener listener)
          Stops the listening component detach events.
 void replaceComponent(Component oldComponent, Component newComponent)
          Replaces the component in the container with another one without changing position.
 
Methods inherited from interface com.vaadin.ui.HasComponents
getComponentIterator, isComponentVisible
 
Methods inherited from interface com.vaadin.ui.Component
addListener, addStyleName, attach, getApplication, getCaption, getDebugId, getIcon, getLocale, getParent, getRoot, getState, getStyleName, isEnabled, isReadOnly, isVisible, removeListener, removeStyleName, setCaption, setDebugId, setEnabled, setIcon, setReadOnly, setStyleName, setVisible, updateState
 
Methods inherited from interface com.vaadin.terminal.gwt.server.ClientConnector
detach, getExtensions, getStateType, isConnectorEnabled, removeExtension, requestRepaint, requestRepaintAll, retrievePendingRpcCalls, setParent
 
Methods inherited from interface com.vaadin.terminal.gwt.client.Connector
getConnectorId
 
Methods inherited from interface com.vaadin.terminal.gwt.server.RpcTarget
getRpcManager
 
Methods inherited from interface com.vaadin.terminal.Sizeable
getHeight, getHeightUnits, getWidth, getWidthUnits, setHeight, setHeight, setSizeFull, setSizeUndefined, setWidth, setWidth
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

addComponent

void addComponent(Component c)
Adds the component into this container.

Parameters:
c - the component to be added.

removeComponent

void removeComponent(Component c)
Removes the component from this container.

Parameters:
c - the component to be removed.

removeAllComponents

void removeAllComponents()
Removes all components from this container.


replaceComponent

void replaceComponent(Component oldComponent,
                      Component newComponent)
Replaces the component in the container with another one without changing position.

This method replaces component with another one is such way that the new component overtakes the position of the old component. If the old component is not in the container, the new component is added to the container. If the both component are already in the container, their positions are swapped. Component attach and detach events should be taken care as with add and remove.

Parameters:
oldComponent - the old component that will be replaced.
newComponent - the new component to be replaced.

getComponentCount

int getComponentCount()
Gets the number of children this ComponentContainer has. This must be symmetric with what HasComponents.getComponentIterator() returns.

Returns:
The number of child components this container has.
Since:
7.0.0

moveComponentsFrom

void moveComponentsFrom(ComponentContainer source)
Moves all components from an another container into this container. The components are removed from source.

Parameters:
source - the container which contains the components that are to be moved to this container.

addListener

void addListener(ComponentContainer.ComponentAttachListener listener)
Listens the component attach events.

Parameters:
listener - the listener to add.

removeListener

void removeListener(ComponentContainer.ComponentAttachListener listener)
Stops the listening component attach events.

Parameters:
listener - the listener to removed.

addListener

void addListener(ComponentContainer.ComponentDetachListener listener)
Listens the component detach events.


removeListener

void removeListener(ComponentContainer.ComponentDetachListener listener)
Stops the listening component detach events.



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