com.itmill.toolkit.ui
Class AbstractComponentContainer

java.lang.Object
  extended by com.itmill.toolkit.terminal.Identifiable
      extended by com.itmill.toolkit.ui.AbstractComponent
          extended by com.itmill.toolkit.ui.AbstractComponentContainer
All Implemented Interfaces:
MethodEventSource, Paintable, VariableOwner, Component, ComponentContainer, EventListener
Direct Known Subclasses:
CustomLayout, GridLayout, OrderedLayout, Panel, 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
Version:
4.1.4
Author:
IT Mill Ltd

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.ComponentContainer
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.ui.Component
Component.ErrorEvent, Component.ErrorListener, Component.Event, Component.Focusable, Component.Listener
 
Nested classes/interfaces inherited from interface com.itmill.toolkit.terminal.Paintable
Paintable.RepaintRequestEvent, Paintable.RepaintRequestListener
 
Constructor Summary
AbstractComponentContainer()
          Constructs a new component container.
 
Method Summary
 void addComponent(Component c)
          This only implements the events and component parent calls.
 void addListener(ComponentContainer.ComponentAttachListener listener)
          Listens the component attach events.
 void addListener(ComponentContainer.ComponentDetachListener listener)
          Listens the component detach events.
 void attach()
          Notifies all contained components that the container is attached to a window.
 void detach()
          Notifies all contained components that the container is detached from a window.
protected  void fireComponentAttachEvent(Component component)
          Fires the component attached event.
protected  void fireComponentDetachEvent(Component component)
          Fires the component detached event.
 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 removeListener(ComponentContainer.ComponentAttachListener listener)
          Stops the listening component attach events.
 void removeListener(ComponentContainer.ComponentDetachListener listener)
          Stops the listening component detach events.
 
Methods inherited from class com.itmill.toolkit.ui.AbstractComponent
addListener, addListener, addListener, addListener, changeVariables, childRequestedRepaint, dependsOn, fireComponentErrorEvent, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, getData, getDescription, getDirectDependencies, getErrorMessage, getIcon, getLocale, getParent, getStyle, getTag, getWindow, isEnabled, isImmediate, isReadOnly, isVisible, paint, paintContent, removeDirectDependency, removeListener, removeListener, removeListener, removeListener, removeListener, requestRepaint, requestRepaintRequests, setCaption, setComponentError, setData, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setReadOnly, setStyle, setVisible
 
Methods inherited from class com.itmill.toolkit.terminal.Identifiable
getDebugId, getUIID, setDebugId, setUIID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.itmill.toolkit.ui.ComponentContainer
getComponentIterator, replaceComponent
 
Methods inherited from interface com.itmill.toolkit.ui.Component
addListener, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isReadOnly, isVisible, removeListener, setEnabled, setParent, setReadOnly, setStyle, setVisible
 
Methods inherited from interface com.itmill.toolkit.terminal.Paintable
addListener, paint, removeListener, requestRepaint, requestRepaintRequests
 
Methods inherited from interface com.itmill.toolkit.terminal.VariableOwner
changeVariables, dependsOn, getDirectDependencies, isImmediate, removeDirectDependency
 

Constructor Detail

AbstractComponentContainer

public AbstractComponentContainer()
Constructs a new component container.

Method Detail

removeAllComponents

public void removeAllComponents()
Removes all components from the container. This should probably be reimplemented in extending classes for a more powerfull 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.

attach

public void attach()
Notifies all contained components that the container is attached to a window.

Specified by:
attach in interface Component
Overrides:
attach in class AbstractComponent
See Also:
Component.attach()

detach

public void detach()
Notifies all contained components that the container is detached from a window.

Specified by:
detach in interface Component
Overrides:
detach in class AbstractComponent
See Also:
Component.detach()

addListener

public void addListener(ComponentContainer.ComponentAttachListener listener)
Description copied from interface: ComponentContainer
Listens the component attach events.

Specified by:
addListener in interface ComponentContainer
Parameters:
listener - the listener to add.

addListener

public void addListener(ComponentContainer.ComponentDetachListener listener)
Description copied from interface: ComponentContainer
Listens the component detach events.

Specified by:
addListener in interface ComponentContainer

removeListener

public void removeListener(ComponentContainer.ComponentAttachListener listener)
Description copied from interface: ComponentContainer
Stops the listening component attach events.

Specified by:
removeListener in interface ComponentContainer
Parameters:
listener - the listener to removed.

removeListener

public void removeListener(ComponentContainer.ComponentDetachListener listener)
Description copied from interface: ComponentContainer
Stops the listening component detach events.

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 added.
See Also:
ComponentContainer.removeComponent(Component)


Copyright © 2000-2008 IT Mill Ltd. All Rights Reserved.