org.apache.cocoon.forms.formmodel
Class Repeater.RepeaterRow

java.lang.Object
  extended by org.apache.cocoon.forms.formmodel.AbstractWidget
      extended by org.apache.cocoon.forms.formmodel.AbstractContainerWidget
          extended by org.apache.cocoon.forms.formmodel.Repeater.RepeaterRow
All Implemented Interfaces:
ContainerWidget, Widget, Locatable
Enclosing class:
Repeater

public class Repeater.RepeaterRow
extends AbstractContainerWidget


Field Summary
 
Fields inherited from class org.apache.cocoon.forms.formmodel.AbstractContainerWidget
validationError, widgets
 
Fields inherited from class org.apache.cocoon.forms.formmodel.AbstractWidget
wasValid
 
Fields inherited from interface org.apache.cocoon.forms.formmodel.Widget
PATH_SEPARATOR
 
Constructor Summary
Repeater.RepeaterRow(RepeaterDefinition definition)
           
 
Method Summary
 void broadcastEvent(WidgetEvent event)
          Broadcast an event previously queued by this widget to its event listeners.
 void generateDisplayData(ContentHandler contentHandler)
          Delegates to the AbstractWidget.getDefinition() of this widget to generate a common set of 'display' data.
 void generateLabel(ContentHandler contentHandler)
          Generates SAX events for the label of this widget.
 WidgetDefinition getDefinition()
          Concrete subclasses should allow access to their underlaying Definition through this method.
 Form getForm()
           
 String getId()
          Gets the id of this widget.
 String getRequestParameterName()
           
 String getXMLElementName()
          The XML element name used in AbstractWidget.generateSaxFragment(ContentHandler, Locale) to produce the wrapping element for all the XML-instance-content of this Widget.
 void initialize()
          Called after widget's environment has been setup, to allow for any contextual initalization such as looking up case widgets for union widgets.
 boolean validate()
          Delegates the validate() down to the contained child-widgets, and validates the extra rules on this containment level regardless of children widget's validities.
 
Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractContainerWidget
addChild, generateItemSaxFragment, getChild, getChildren, getSize, hasChild, readFromRequest
 
Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractWidget
addValidator, generateSaxFragment, getAttribute, getCombinedState, getFullName, getLocation, getName, getParent, getState, getValue, getWidget, getXMLElementAttributes, isRequired, isValid, lookupWidget, removeAttribute, removeValidator, setAttribute, setParent, setState, setValue, toString, widgetNameChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.cocoon.forms.formmodel.Widget
addValidator, generateSaxFragment, getAttribute, getCombinedState, getFullName, getLocation, getName, getParent, getState, getValue, getWidget, isRequired, isValid, lookupWidget, removeAttribute, removeValidator, setAttribute, setParent, setState, setValue
 

Constructor Detail

Repeater.RepeaterRow

public Repeater.RepeaterRow(RepeaterDefinition definition)
Method Detail

getDefinition

public WidgetDefinition getDefinition()
Description copied from class: AbstractWidget
Concrete subclasses should allow access to their underlaying Definition through this method. If subclasses decide to return null they should also organize own implementations of AbstractWidget.getId(), AbstractWidget.getLocation(), AbstractWidget.validate(), AbstractWidget.generateLabel(ContentHandler) and AbstractWidget.generateDisplayData(ContentHandler) to avoid NPE's.

Specified by:
getDefinition in interface Widget
Specified by:
getDefinition in class AbstractWidget
Returns:
the widgetDefinition from which this widget was instantiated. (See WidgetDefinition.createInstance())

getId

public String getId()
Description copied from class: AbstractWidget
Gets the id of this widget.

Specified by:
getId in interface Widget
Overrides:
getId in class AbstractWidget
Returns:
the id of this widget. This should never be null Top-level container widgets (like 'form') should return ""

getRequestParameterName

public String getRequestParameterName()
Specified by:
getRequestParameterName in interface Widget
Overrides:
getRequestParameterName in class AbstractWidget
Returns:
the id prefixed with the namespace, this name should be unique accross all widgets on the form.

getForm

public Form getForm()
Specified by:
getForm in interface Widget
Overrides:
getForm in class AbstractWidget
Returns:
the form where this widget belongs to.

initialize

public void initialize()
Description copied from class: AbstractContainerWidget
Called after widget's environment has been setup, to allow for any contextual initalization such as looking up case widgets for union widgets.

Specified by:
initialize in interface Widget
Overrides:
initialize in class AbstractContainerWidget

validate

public boolean validate()
Description copied from class: AbstractContainerWidget
Delegates the validate() down to the contained child-widgets, and validates the extra rules on this containment level regardless of children widget's validities.

When overriding one should call super.validate() as the first statement to keep in sync with this behaviour.

Specified by:
validate in interface Widget
Overrides:
validate in class AbstractContainerWidget
Returns:
true only if all contained widgets are valid and the extra validation rules on this containment level are ok.
See Also:
Widget.validate()

getXMLElementName

public String getXMLElementName()
Description copied from class: AbstractWidget
The XML element name used in AbstractWidget.generateSaxFragment(ContentHandler, Locale) to produce the wrapping element for all the XML-instance-content of this Widget.

Specified by:
getXMLElementName in class AbstractWidget
Returns:
"repeater-row"

generateLabel

public void generateLabel(ContentHandler contentHandler)
                   throws SAXException
Description copied from class: AbstractWidget
Generates SAX events for the label of this widget. The label will not be wrapped inside another element. Delegates to the AbstractWidget.getDefinition() to generate the 'label' part of the display-data of this widget. Subclasses should override if the getDefinition can return null to avoid NPE's

Specified by:
generateLabel in interface Widget
Overrides:
generateLabel in class AbstractWidget
Throws:
SAXException

generateDisplayData

public void generateDisplayData(ContentHandler contentHandler)
                         throws SAXException
Description copied from class: AbstractWidget
Delegates to the AbstractWidget.getDefinition() of this widget to generate a common set of 'display' data. (i.e. help, label, hint,...) Subclasses should override if the getDefinition can return null to avoid NPE's.

Overrides:
generateDisplayData in class AbstractWidget
Parameters:
contentHandler - where to send the SAX events to.
Throws:
SAXException
See Also:
WidgetDefinition.generateDisplayData(ContentHandler)

broadcastEvent

public void broadcastEvent(WidgetEvent event)
Description copied from class: AbstractWidget
Broadcast an event previously queued by this widget to its event listeners. Abstract implementation throws a UnsupportedOperationException. Concrete subclass widgets need to override when supporting event broadcasting.

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


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