net.sf.click.control
Interface Container

All Superinterfaces:
Control, Serializable
All Known Implementing Classes:
AbstractContainer, FieldSet

public interface Container
extends Control

Container extends Control and enables the creation of nested controls.

Container allows one to add, remove and retrieve controls.

Please note AbstractContainer provides a default implementation of the Container interface and allows easy creation of new containers.

Author:
Bob Schellink
See Also:
ContainerUtils

Field Summary
 
Fields inherited from interface net.sf.click.Control
CONTROL_MESSAGES
 
Method Summary
 Control add(Control control)
          Add the control to the container and return the added instance.
 boolean contains(Control control)
          Return true if the container contains the specified control.
 Control getControl(String controlName)
          Return the named control from the container if found or null otherwise.
 List getControls()
          Return the sequential list of controls held by the container.
 boolean hasControls()
          Returns true if this container has existing controls, false otherwise.
 Control insert(Control control, int index)
          Add the control to the container at the specified index, and return the added instance.
 boolean remove(Control control)
          Remove the given control from the container, returning true if the control was found in the container and removed, or false if the control was not found.
 
Methods inherited from interface net.sf.click.Control
getContext, getHtmlImports, getId, getMessages, getName, getParent, onDeploy, onDestroy, onInit, onProcess, onRender, render, setListener, setName, setParent
 

Method Detail

add

public Control add(Control control)
Add the control to the container and return the added instance.

Parameters:
control - the control to add to the container and return
Returns:
the control that was added to the container

insert

public Control insert(Control control,
                      int index)
Add the control to the container at the specified index, and return the added instance.

Parameters:
control - the control to add to the container and return
index - the index at which the control is to be inserted
Returns:
the control that was added to the container
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index > getControls().size()).

remove

public boolean remove(Control control)
Remove the given control from the container, returning true if the control was found in the container and removed, or false if the control was not found.

Parameters:
control - the control to remove from the container
Returns:
true if the control was removed from the container

getControls

public List getControls()
Return the sequential list of controls held by the container.

Returns:
the sequential list of controls held by the container

getControl

public Control getControl(String controlName)
Return the named control from the container if found or null otherwise.

Parameters:
controlName - the name of the control to get from the container
Returns:
the named control from the container if found or null otherwise

contains

public boolean contains(Control control)
Return true if the container contains the specified control.

Parameters:
control - the control whose presence in this container is to be tested
Returns:
true if the container contains the specified control

hasControls

public boolean hasControls()
Returns true if this container has existing controls, false otherwise.

Returns:
true if the container has existing controls, false otherwise.