org.apache.cocoon.woody.formmodel
Class AbstractContainerWidget

java.lang.Object
  extended by org.apache.cocoon.woody.formmodel.AbstractWidget
      extended by org.apache.cocoon.woody.formmodel.AbstractContainerWidget
All Implemented Interfaces:
ContainerWidget, Widget
Direct Known Subclasses:
Form, Repeater.RepeaterRow, Struct, Union

public abstract class AbstractContainerWidget
extends AbstractWidget
implements ContainerWidget

A general-purpose abstract Widget which can hold zero or more widgets.

Version:
$Id: AbstractContainerWidget.html 1304258 2012-03-23 10:09:27Z ilgrosso $
Author:
Timothy Larson

Field Summary
protected  ContainerDelegate widgets
           
 
Fields inherited from class org.apache.cocoon.woody.formmodel.AbstractWidget
definition
 
Constructor Summary
AbstractContainerWidget(AbstractWidgetDefinition definition)
           
 
Method Summary
 void addWidget(Widget widget)
          Adds a child widget.
 void generateSaxFragment(ContentHandler contentHandler, Locale locale, String element)
           
 Iterator getChildren()
          Returns an iterator over the widgets this object contains
 Widget getWidget(String id)
          Gets the child widget of this widget with the given id, or null if there isn't such a child.
 boolean hasWidget(String id)
          Checks if there is a child widget with the given id.
 void readFromRequest(FormContext formContext)
          Lets this widget read its data from a request.
 boolean validate(FormContext formContext)
          Validates this widget and returns the outcome.
 
Methods inherited from class org.apache.cocoon.woody.formmodel.AbstractWidget
addValidator, broadcastEvent, generateItemSaxFragment, generateLabel, generateSaxFragment, getForm, getFullyQualifiedId, getId, getLocation, getNamespace, getParent, getValue, isRequired, removeValidator, setDefinition, setLocation, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.woody.formmodel.Widget
broadcastEvent, generateLabel, generateSaxFragment, getForm, getFullyQualifiedId, getId, getLocation, getNamespace, getParent, getValue, isRequired, setParent, setValue
 

Field Detail

widgets

protected ContainerDelegate widgets
Constructor Detail

AbstractContainerWidget

public AbstractContainerWidget(AbstractWidgetDefinition definition)
Method Detail

addWidget

public void addWidget(Widget widget)
Description copied from interface: ContainerWidget
Adds a child widget.

Specified by:
addWidget in interface ContainerWidget

hasWidget

public boolean hasWidget(String id)
Description copied from interface: ContainerWidget
Checks if there is a child widget with the given id.

Specified by:
hasWidget in interface ContainerWidget

getWidget

public Widget getWidget(String id)
Description copied from interface: Widget
Gets the child widget of this widget with the given id, or null if there isn't such a child.

Specified by:
getWidget in interface ContainerWidget
Specified by:
getWidget in interface Widget
Overrides:
getWidget in class AbstractWidget

getChildren

public Iterator getChildren()
Description copied from interface: ContainerWidget
Returns an iterator over the widgets this object contains

Specified by:
getChildren in interface ContainerWidget

readFromRequest

public void readFromRequest(FormContext formContext)
Description copied from interface: Widget
Lets this widget read its data from a request. At this point the Widget may try to convert the request parameter to its native datatype (if it is not a string), but it should not yet generate any validation errors.

Specified by:
readFromRequest in interface Widget

validate

public boolean validate(FormContext formContext)
Description copied from interface: Widget
Validates this widget and returns the outcome. Possible error messages are remembered by the widget itself and will be part of the XML produced by this widget in its Widget.generateSaxFragment(ContentHandler, Locale) method.

Specified by:
validate in interface Widget
Overrides:
validate in class AbstractWidget

generateSaxFragment

public void generateSaxFragment(ContentHandler contentHandler,
                                Locale locale,
                                String element)
                         throws SAXException
Throws:
SAXException


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.