org.millstone.base.ui
Class AbstractComponentContainer

java.lang.Object
  |
  +--org.millstone.base.ui.AbstractComponent
        |
        +--org.millstone.base.ui.AbstractComponentContainer
All Implemented Interfaces:
Component, ComponentContainer, java.util.EventListener, MethodEventSource, Paintable, VariableOwner
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 MillStone component container.

Since:
3.0
Version:
3.0.3
Author:
IT Mill Ltd

Nested Class Summary
 
Nested classes inherited from class org.millstone.base.ui.ComponentContainer
ComponentContainer.ComponentAttachEvent, ComponentContainer.ComponentAttachListener, ComponentContainer.ComponentDetachEvent, ComponentContainer.ComponentDetachListener
 
Nested classes inherited from class org.millstone.base.ui.Component
Component.Event, Component.Listener
 
Nested classes inherited from class org.millstone.base.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)
          Listen component attach events
 void addListener(ComponentContainer.ComponentDetachListener listener)
          Listen 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)
          Fire component attached event.
protected  void fireComponentDetachEvent(Component component)
          Fire 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)
          Stop listening component attach events
 void removeListener(ComponentContainer.ComponentDetachListener listener)
          Stop listening component detach events
 
Methods inherited from class org.millstone.base.ui.AbstractComponent
addListener, addListener, addListener, addListener, changeVariables, childRequestedRepaint, dependsOn, fireComponentEvent, fireEvent, getApplication, getCaption, getComponentError, 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, setDescription, setEnabled, setIcon, setImmediate, setLocale, setParent, setReadOnly, setStyle, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.millstone.base.ui.ComponentContainer
getComponentIterator, replaceComponent
 
Methods inherited from interface org.millstone.base.ui.Component
addListener, childRequestedRepaint, getApplication, getCaption, getIcon, getLocale, getParent, getStyle, getWindow, isEnabled, isImmediate, isReadOnly, isVisible, removeListener, setEnabled, setParent, setReadOnly, setStyle, setVisible
 
Methods inherited from interface org.millstone.base.terminal.Paintable
addListener, paint, removeListener, requestRepaint, requestRepaintRequests
 
Methods inherited from interface org.millstone.base.terminal.VariableOwner
changeVariables, dependsOn, getDirectDependencies, 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 powerfu 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
Listen component attach events

Specified by:
addListener in interface ComponentContainer

addListener

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

Specified by:
addListener in interface ComponentContainer

removeListener

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

Specified by:
removeListener in interface ComponentContainer

removeListener

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

Specified by:
removeListener in interface ComponentContainer

fireComponentAttachEvent

protected void fireComponentAttachEvent(Component component)
Fire 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)
Fire 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,2001,2002 IT Mill Ltd. All Rights Reserved.