com.arsdigita.formbuilder
Class PersistentWidget

java.lang.Object
  extended bycom.arsdigita.domain.DomainObject
      extended bycom.arsdigita.domain.ObservableDomainObject
          extended bycom.arsdigita.kernel.ACSObject
              extended bycom.arsdigita.auditing.AuditedACSObject
                  extended bycom.arsdigita.formbuilder.PersistentComponent
                      extended bycom.arsdigita.formbuilder.PersistentWidget
All Implemented Interfaces:
AttributeMetaDataProvider, Audited, PersistentComponentFactory
Direct Known Subclasses:
DataDrivenSelect, PersistentDate, PersistentDeditor, PersistentHidden, PersistentOptionGroup, PersistentPassword, PersistentSubmit, PersistentTextArea, PersistentTextField

public abstract class PersistentWidget
extends PersistentComponent
implements AttributeMetaDataProvider

This class is responsible for persisting attributes common to Bebop Widgets. Sub classes of this abstract class manage persistence of different Bebop Widgets (TextArea etc.).

Version:
$Id: //core-platform/dev/src/com/arsdigita/formbuilder/PersistentWidget.java#13 $
Author:
Peter Marklund

Field Summary
static String BASE_DATA_OBJECT_TYPE
          BASE_DATA_OBJECT_TYPE represents the full name of the underlying DataObject of this class.
static String DEFAULT_VALUE
           
static String versionId
           
 
Fields inherited from class com.arsdigita.formbuilder.PersistentComponent
ATTRIBUTE_STRING
 
Fields inherited from class com.arsdigita.kernel.ACSObject
CONTAINER, DEFAULT_DOMAIN_CLASS, DISPLAY_NAME, ID, OBJECT_TYPE
 
Constructor Summary
PersistentWidget(DataObject obj)
           
PersistentWidget(ObjectType type)
           
PersistentWidget(OID oID)
          Sub classes may use this constructor to retrieve an existing Widget domain object with an id and object type.
PersistentWidget(String objectType)
          Sub classes can create a new widget domain object with this constructor.
 
Method Summary
 void addValidationListener(PersistentParameterListener parameterListener)
           
 void clearValidationListeners()
          Removes all validation listeners associated with this widget
protected  void copyValuesToWidget(Widget widget)
           
 void delete()
          Deletes this object.
static Object deserializeDefaultValue(String defaultValue)
          This provides a method to take a default value and deserialize it in to its original object.
 AttributeMetaDataList getAttributeMetaData()
           
 Object getDefaultValue()
          Get the default value of the widget.
 String getParameterModel()
          Will return null if no value has been set.
 String getParameterName()
          Will return null if no value has been set.
 Collection getValidationListeners()
          Return a collection with all PersistentParameterListeners of this widget.
protected  Class getValueClass()
          Most Widgets have String as their value class which is what is returned by this default implementation.
protected  ParameterModel instantiateParameterModel()
           
 void setDefaultValue(Object defaultValue)
          You have to make sure that the defaulValue is an instance of the Class returned by the method getValueClass() (for example this is a String for TextAreas and a java.util.Date for Dates).
 void setParameterModel(String parameterModel)
          The class name of the parameter model to be used for the widget
 void setParameterName(String parameterName)
           
protected  void setup(String parameterName)
           
 
Methods inherited from class com.arsdigita.formbuilder.PersistentComponent
beforeSave, createComponent, getAdminName, getComponentAttribute, getDescription, setAdminName, setComponentAttribute, setDescription, setDomainClass
 
Methods inherited from class com.arsdigita.auditing.AuditedACSObject
getCreationDate, getCreationIP, getCreationUser, getLastModifiedDate, getLastModifiedIP, getLastModifiedUser, initialize
 
Methods inherited from class com.arsdigita.kernel.ACSObject
assertPrivilege, checkPrivilege, doCreateCheck, doWriteCheck, getBaseDataObjectType, getContainer, getDefaultDomainClass, getDisplayName, getID, getSpecificObjectType, getSpecificOID, gimmeContainer, isContainerModified, setID, setID
 
Methods inherited from class com.arsdigita.domain.ObservableDomainObject
addObserver, getObservers
 
Methods inherited from class com.arsdigita.domain.DomainObject
add, add, addToAssociation, afterDelete, afterSave, beforeDelete, clear, disconnect, equals, get, getObjectType, getOID, getSession, hashCode, isDeleted, isDisconnected, isModified, isNew, isPropertyModified, isValid, remove, remove, remove, removeFromAssociation, save, set, setAssociation, setAssociation, specializeDataObject, specializeDataObject, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.arsdigita.formbuilder.PersistentComponentFactory
getID, isNew, save
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

DEFAULT_VALUE

public static final String DEFAULT_VALUE
See Also:
Constant Field Values

BASE_DATA_OBJECT_TYPE

public static final String BASE_DATA_OBJECT_TYPE
BASE_DATA_OBJECT_TYPE represents the full name of the underlying DataObject of this class.

See Also:
Constant Field Values
Constructor Detail

PersistentWidget

public PersistentWidget(String objectType)
Sub classes can create a new widget domain object with this constructor.


PersistentWidget

public PersistentWidget(ObjectType type)

PersistentWidget

public PersistentWidget(DataObject obj)

PersistentWidget

public PersistentWidget(OID oID)
                 throws DataObjectNotFoundException
Sub classes may use this constructor to retrieve an existing Widget domain object with an id and object type.

Method Detail

setup

protected void setup(String parameterName)

delete

public void delete()
Description copied from class: DomainObject
Deletes this object.

Specified by:
delete in interface PersistentComponentFactory
Overrides:
delete in class DomainObject
See Also:
DataObject.delete()

setParameterName

public void setParameterName(String parameterName)

getParameterName

public String getParameterName()
Will return null if no value has been set.


addValidationListener

public void addValidationListener(PersistentParameterListener parameterListener)

getValidationListeners

public Collection getValidationListeners()
Return a collection with all PersistentParameterListeners of this widget.


clearValidationListeners

public void clearValidationListeners()
Removes all validation listeners associated with this widget


setParameterModel

public void setParameterModel(String parameterModel)
The class name of the parameter model to be used for the widget


getParameterModel

public String getParameterModel()
Will return null if no value has been set.


setDefaultValue

public void setDefaultValue(Object defaultValue)
You have to make sure that the defaulValue is an instance of the Class returned by the method getValueClass() (for example this is a String for TextAreas and a java.util.Date for Dates).


getDefaultValue

public Object getDefaultValue()
Get the default value of the widget. Java serialization is used to persist objects so that the default value object must implement Serializable. Will return null if no value has been set.


deserializeDefaultValue

public static Object deserializeDefaultValue(String defaultValue)
This provides a method to take a default value and deserialize it in to its original object. This is useful if the defaultValue is actually something like a serialized java.util.Date


getValueClass

protected Class getValueClass()
Most Widgets have String as their value class which is what is returned by this default implementation. The PersistentDate class has a different implementation.


getAttributeMetaData

public AttributeMetaDataList getAttributeMetaData()
Specified by:
getAttributeMetaData in interface AttributeMetaDataProvider
Overrides:
getAttributeMetaData in class PersistentComponent

instantiateParameterModel

protected ParameterModel instantiateParameterModel()

copyValuesToWidget

protected void copyValuesToWidget(Widget widget)


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC