org.apache.cocoon.forms.formmodel
Class AbstractDatatypeWidgetDefinition

java.lang.Object
  extended byorg.apache.cocoon.forms.formmodel.AbstractWidgetDefinition
      extended byorg.apache.cocoon.forms.formmodel.AbstractDatatypeWidgetDefinition
All Implemented Interfaces:
org.apache.cocoon.util.location.Locatable, WidgetDefinition
Direct Known Subclasses:
FieldDefinition, OutputDefinition

public abstract class AbstractDatatypeWidgetDefinition
extends AbstractWidgetDefinition

Base class for WidgetDefinitions that use a Datatype and SelectionList.

Version:
$Id: AbstractDatatypeWidgetDefinition.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Field Summary
 
Fields inherited from class org.apache.cocoon.forms.formmodel.AbstractWidgetDefinition
createListener, enclosingLibrary, parent
 
Constructor Summary
AbstractDatatypeWidgetDefinition()
           
 
Method Summary
 void addValueChangedListener(ValueChangedListener listener)
           
 SelectionList buildSelectionList(String uri)
          Builds a dynamic selection list from a source.
 SelectionList buildSelectionListFromModel(Object model, String valuePath, String labelPath)
          Builds a dynamic selection list from an in-memory collection.
 void checkCompleteness()
          checks definition's completeness
 void fireValueChangedEvent(ValueChangedEvent event)
           
 Datatype getDatatype()
           
 Object getInitialValue()
           
 SelectionList getSelectionList()
           
 ValueChangedListener getValueChangedListener()
           
 boolean hasValueChangedListeners()
           
 void initializeFrom(WidgetDefinition definition)
          initialize this definition with the other, sort of like a copy constructor
 void setDatatype(Datatype datatype, Object initialValue)
           
 void setProcessInfoProvider(org.apache.cocoon.processing.ProcessInfoProvider processInfoProvider)
           
 void setSelectionList(SelectionList selectionList)
           
 void setSourceResolver(SourceResolver sourceResolver)
           
 void setXmlizer(XMLizer xmlizer)
           
 
Methods inherited from class org.apache.cocoon.forms.formmodel.AbstractWidgetDefinition
addCreateListener, addValidator, checkMutable, fireCreateEvent, generateDisplayData, generateDisplayData, generateLabel, getAttribute, getEnclosingLibrary, getFormDefinition, getId, getLocation, getParent, getState, makeImmutable, setAttributes, setDisplayData, setEnclosingLibrary, setId, setLocation, setParent, setState, validate, widgetCreated
 
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.forms.formmodel.WidgetDefinition
createInstance
 

Constructor Detail

AbstractDatatypeWidgetDefinition

public AbstractDatatypeWidgetDefinition()
Method Detail

checkCompleteness

public void checkCompleteness()
                       throws IncompletenessException
checks definition's completeness

Specified by:
checkCompleteness in interface WidgetDefinition
Overrides:
checkCompleteness in class AbstractWidgetDefinition
Throws:
IncompletenessException

initializeFrom

public void initializeFrom(WidgetDefinition definition)
                    throws Exception
initialize this definition with the other, sort of like a copy constructor

Specified by:
initializeFrom in interface WidgetDefinition
Overrides:
initializeFrom in class AbstractWidgetDefinition
Throws:
Exception

getDatatype

public Datatype getDatatype()

getInitialValue

public Object getInitialValue()

setDatatype

public void setDatatype(Datatype datatype,
                        Object initialValue)

setSelectionList

public void setSelectionList(SelectionList selectionList)

getSelectionList

public SelectionList getSelectionList()

buildSelectionList

public SelectionList buildSelectionList(String uri)
Builds a dynamic selection list from a source. This is a helper method for widget instances whose selection list source has to be changed dynamically, and it does not modify this definition's selection list, if any.

Parameters:
uri - The URI of the source.

buildSelectionListFromModel

public SelectionList buildSelectionListFromModel(Object model,
                                                 String valuePath,
                                                 String labelPath)
Builds a dynamic selection list from an in-memory collection. This is a helper method for widget instances whose selection list has to be changed dynamically, and it does not modify this definition's selection list, if any.

Parameters:
model - The collection used as a model for the selection list.
valuePath - An XPath expression referring to the attribute used to populate the values of the list's items.
labelPath - An XPath expression referring to the attribute used to populate the labels of the list's items.
See Also:
Field.setSelectionList(Object model, String valuePath, String labelPath)

addValueChangedListener

public void addValueChangedListener(ValueChangedListener listener)

fireValueChangedEvent

public void fireValueChangedEvent(ValueChangedEvent event)

hasValueChangedListeners

public boolean hasValueChangedListeners()

getValueChangedListener

public ValueChangedListener getValueChangedListener()

setSourceResolver

public void setSourceResolver(SourceResolver sourceResolver)

setXmlizer

public void setXmlizer(XMLizer xmlizer)

setProcessInfoProvider

public void setProcessInfoProvider(org.apache.cocoon.processing.ProcessInfoProvider processInfoProvider)


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