org.apache.click.control
Interface Container

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

public interface Container
extends Control

Provides the interface for a container which holds a list of child controls.

Container extends Control and enables the creation of nested controls.

Container allows one to add, remove and retrieve child controls.

Please note AbstractContainer provides a default implementation of the Container interface to make it easier for developers to create their own containers.

See Also:
ContainerUtils

Field Summary
 
Fields inherited from interface org.apache.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<Control> 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.
 Control replace(Control currentControl, Control newControl)
          Deprecated. this method was used for stateful pages, which have been deprecated
 
Methods inherited from interface org.apache.click.Control
getBehaviors, getContext, getHeadElements, getId, getMessages, getName, getParent, hasBehaviors, isAjaxTarget, onDeploy, onDestroy, onInit, onProcess, onRender, render, setListener, setName, setParent
 

Method Detail

add

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

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()).

replace

Control replace(Control currentControl,
                Control newControl)
Deprecated. this method was used for stateful pages, which have been deprecated

Replace the current control with the new control, and return the newly added control.

Parameters:
currentControl - the control currently contained in the container
newControl - the control to replace the current control contained in the container
Returns:
the new control that replaced the current control

remove

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

List<Control> getControls()
Return the sequential list of controls held by the container.

Returns:
the sequential list of controls held by the container

getControl

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

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

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

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