org.apache.cocoon.forms.formmodel
Class AbstractDatatypeWidgetDefinition

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

public abstract class AbstractDatatypeWidgetDefinition
extends AbstractWidgetDefinition
implements Serviceable

Base class for WidgetDefinitions that use a Datatype and SelectionList.

Version:
$Id: AbstractDatatypeWidgetDefinition.html 1304258 2012-03-23 10:09:27Z 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 service(ServiceManager manager)
           
 void setDatatype(Datatype datatype, Object initialValue)
           
 void setSelectionList(SelectionList selectionList)
           
 
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

service

public void service(ServiceManager manager)
             throws ServiceException
Specified by:
service in interface Serviceable
Throws:
ServiceException

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


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