com.softwareag.centrasite.appl.framework.validation.impl
Class DefaultControl

java.lang.Object
  extended by com.softwareag.centrasite.appl.framework.validation.impl.DefaultValidatable
      extended by com.softwareag.centrasite.appl.framework.validation.impl.DefaultControl
All Implemented Interfaces:
Constrained, Control, ValueProvider, NamedObject, Validatable

public class DefaultControl
extends DefaultValidatable
implements Control, ValueProvider

Default implementation of Control. The default implementation assumes, that there is an embedded instance of Validatable, which is responsible for the data transfer. The control, on the other hand, is responsible for the GUI representation. In other words, it takes care of the


Nested Class Summary
static interface DefaultControl.ValueHandler
          The value handler is responsible for fetching or setting the controls values.
 
Nested classes/interfaces inherited from interface com.softwareag.centrasite.appl.framework.validation.Control
Control.ChangeListener
 
Field Summary
static DefaultControl.ValueHandler DEFAULT_VALUE_HANDLER
          The default implementation of DefaultControl.ValueHandler.
 
Constructor Summary
DefaultControl()
           
 
Method Summary
 void addChangeListener(Control.ChangeListener pListener)
          Adds a new change listener.
protected  void fireChangedEvent(java.lang.Object pOldValue, java.lang.Object pNewValue)
          Fires a change event.
protected  java.lang.String[] getConfigurationDetails()
          Returns the controls configuration details.
protected  java.lang.String getConfigurationParameter(java.lang.String pParam)
          Returns the value of the configuration parameter "param".
protected  boolean getConfigurationParameter(java.lang.String pParam, boolean pDefault)
          Returns the integer value of the given configuration parameter.
protected  java.lang.Class<?> getConfigurationParameter(java.lang.String pParam, java.lang.ClassLoader pClassLoader)
          Returns the class, which is given by the configuration parameter.
protected  int getConfigurationParameter(java.lang.String pParam, int pDefault)
          Returns the integer value of the given configuration parameter.
protected  java.lang.String getConfigurationParameter(java.lang.String pParam, java.lang.String pDefault)
          Returns the integer value of the given configuration parameter.
 ValidatableProperty getValidatableProperty()
          Returns the embedded Validatable.
 DefaultControl.ValueHandler getValueHandler()
          Returns the controls value handler.
 java.lang.Object getValueObject()
          Returns the value providers value object.
 boolean hasErrors()
          Returns, whether the object contains errors.
 boolean isReadOnly()
          Returns, whether the object is read-only.
 void removeChangeListener(Control.ChangeListener pListener)
          Removes a change listener.
 void setErrors(boolean pErrors)
          Sets, whether the object contains errors.
 void setReadOnly(boolean pReadOnly)
          Sets, whether the object is read-only.
 void setValueHandler(DefaultControl.ValueHandler pValueHandler)
          Sets the controls value handler.
protected  void setValueObject(java.lang.Object pValue)
          Called to change the controls value.
 
Methods inherited from class com.softwareag.centrasite.appl.framework.validation.impl.DefaultValidatable
add, addConstraint, getConstraints, getName, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.softwareag.centrasite.appl.framework.validation.Validatable
addConstraint, getConstraints
 

Field Detail

DEFAULT_VALUE_HANDLER

public static DefaultControl.ValueHandler DEFAULT_VALUE_HANDLER
The default implementation of DefaultControl.ValueHandler.

Constructor Detail

DefaultControl

public DefaultControl()
Method Detail

getValueObject

public java.lang.Object getValueObject()
                                throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Description copied from interface: ValueProvider
Returns the value providers value object.

Specified by:
getValueObject in interface ValueProvider
Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

fireChangedEvent

protected void fireChangedEvent(java.lang.Object pOldValue,
                                java.lang.Object pNewValue)
Fires a change event.


setValueObject

protected void setValueObject(java.lang.Object pValue)
                       throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Called to change the controls value.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

getValidatableProperty

public ValidatableProperty getValidatableProperty()
Returns the embedded Validatable.


hasErrors

public boolean hasErrors()
Description copied from interface: Constrained
Returns, whether the object contains errors.

Specified by:
hasErrors in interface Constrained

isReadOnly

public boolean isReadOnly()
Description copied from interface: Constrained
Returns, whether the object is read-only.

Specified by:
isReadOnly in interface Constrained

setErrors

public void setErrors(boolean pErrors)
Description copied from interface: Constrained
Sets, whether the object contains errors.

Specified by:
setErrors in interface Constrained

setReadOnly

public void setReadOnly(boolean pReadOnly)
Description copied from interface: Constrained
Sets, whether the object is read-only.

Specified by:
setReadOnly in interface Constrained

getConfigurationDetails

protected java.lang.String[] getConfigurationDetails()
Returns the controls configuration details.


getConfigurationParameter

protected java.lang.String getConfigurationParameter(java.lang.String pParam)
Returns the value of the configuration parameter "param".


getConfigurationParameter

protected int getConfigurationParameter(java.lang.String pParam,
                                        int pDefault)
                                 throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Returns the integer value of the given configuration parameter.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

getConfigurationParameter

protected boolean getConfigurationParameter(java.lang.String pParam,
                                            boolean pDefault)
                                     throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Returns the integer value of the given configuration parameter.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

getConfigurationParameter

protected java.lang.String getConfigurationParameter(java.lang.String pParam,
                                                     java.lang.String pDefault)
                                              throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Returns the integer value of the given configuration parameter.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

getConfigurationParameter

protected java.lang.Class<?> getConfigurationParameter(java.lang.String pParam,
                                                       java.lang.ClassLoader pClassLoader)
                                                throws com.softwareag.centrasite.appl.framework.CSAppFrameworkException
Returns the class, which is given by the configuration parameter.

Throws:
com.softwareag.centrasite.appl.framework.CSAppFrameworkException

addChangeListener

public void addChangeListener(Control.ChangeListener pListener)
Description copied from interface: Control
Adds a new change listener.

Specified by:
addChangeListener in interface Control

removeChangeListener

public void removeChangeListener(Control.ChangeListener pListener)
Description copied from interface: Control
Removes a change listener.

Specified by:
removeChangeListener in interface Control

getValueHandler

public DefaultControl.ValueHandler getValueHandler()
Returns the controls value handler.


setValueHandler

public void setValueHandler(DefaultControl.ValueHandler pValueHandler)
Sets the controls value handler.