org.jwarp.flow.form.model
Interface IContainer

All Superinterfaces:
IComponent
All Known Subinterfaces:
IForm, INavigation, IScreen, ITableModel
All Known Implementing Classes:
Container

public interface IContainer
extends IComponent

A generic JWeb container object is a component that can contain other element components.

Components added to a container are tracked in a list. The order of the list will define the components' front-to-back stacking order within the container. If no index is specified when adding a component to a container, it will be added to the end of the list (and hence to the bottom of the stacking order).

Version:
1.0, 02/01/01
Author:
Anatole Tresch
See Also:
Container

Method Summary
 void add(IComponent comp)
          Adds the specified component to the end of this container.
 void add(IComponent comp, int index)
          Adds the specified component to this container at the given position.
 void addContainerListener(IContainerListener l)
          Adds the specified container listener to receive container events from this container.
 boolean contains(IComponent c)
          Checks if the component is contained in the component hierarchy of this container.
 IComponent getComponent(int n)
          Gets the nth component in this container.
 int getComponentCount()
          Gets the number of components in this panel.
 java.util.Iterator getComponents()
          Gets all the components in this container.
 void remove(IComponent comp)
          Removes the specified component from this container.
 IComponent remove(int index)
          Removes the component, specified by index, from this container.
 void removeAll()
          Removes all the components from this container.
 void removeContainerListener(IContainerListener l)
          Removes the specified container listener so it no longer receives container events from this container.
 
Methods inherited from interface org.jwarp.flow.form.model.IComponent
addComponentListener, getDescription, getFullName, getID, getListeners, getLocale, getName, getParent, getXMLTree, handleEvent, isEnabled, removeComponentListener, setEnabled, setFlowData, setLocale
 

Method Detail

getComponentCount

public int getComponentCount()
Gets the number of components in this panel.
Returns:
the number of components in this panel.
Since:
JDK1.1
See Also:
Container.getComponent(int)

getComponent

public IComponent getComponent(int n)
Gets the nth component in this container.
Parameters:
n - the index of the component to get.
Returns:
the nth component in this container.
Throws:
ArrayIndexOutOfBoundsException - if the nth value does not exist.

getComponents

public java.util.Iterator getComponents()
Gets all the components in this container.
Returns:
an array of all the components in this container.

add

public void add(IComponent comp)
Adds the specified component to the end of this container.
Parameters:
comp - the component to be added.
Returns:
the component argument.

add

public void add(IComponent comp,
                int index)
Adds the specified component to this container at the given position.
Parameters:
comp - the component to be added.
index - the position at which to insert the component, or -1 to insert the component at the end.
Returns:
the component comp
See Also:
remove(int)

remove

public IComponent remove(int index)
Removes the component, specified by index, from this container.
Parameters:
index - the index of the component to be removed.
See Also:
add(org.jwarp.flow.form.model.IComponent)

remove

public void remove(IComponent comp)
Removes the specified component from this container.
Parameters:
comp - the component to be removed
See Also:
add(org.jwarp.flow.form.model.IComponent)

removeAll

public void removeAll()
Removes all the components from this container.
See Also:
add(org.jwarp.flow.form.model.IComponent), remove(int)

addContainerListener

public void addContainerListener(IContainerListener l)
Adds the specified container listener to receive container events from this container.
Parameters:
l - the container listener

removeContainerListener

public void removeContainerListener(IContainerListener l)
Removes the specified container listener so it no longer receives container events from this container. If l is null, no exception is thrown and no action is performed.
Parameters:
l - the container listener

contains

public boolean contains(IComponent c)
Checks if the component is contained in the component hierarchy of this container.
Parameters:
c - the component
Returns:
true if it is an ancestor; false otherwise.
Since:
JDK1.1

©   O R C A   S y s t e m s