org.beanfabrics.model
Class AbstractValuePM

java.lang.Object
  extended by org.beanfabrics.AbstractBean
      extended by org.beanfabrics.ValidatableBean
          extended by org.beanfabrics.model.AbstractPM
              extended by org.beanfabrics.model.AbstractValuePM
All Implemented Interfaces:
Bean, ContextOwner, HasComparable, IValuePM, PresentationModel, Supportable, Validatable
Direct Known Subclasses:
IconPM, TextPM

public abstract class AbstractValuePM
extends AbstractPM
implements IValuePM

The AbstractValuePM is the general superclass of PM components that implement the IValuePM interface and contain some 'value' and other additional attributes which are generally usefull for user interface programming, like title, description, mandatory, and editable.


Nested Class Summary
 class AbstractValuePM.MandatoryValidationRule
          This rule evaluates to invalid if the PM's "mandatory" attribute is true and the PM is empty.
 
Nested classes/interfaces inherited from class org.beanfabrics.model.AbstractPM
AbstractPM.PropertiesValidationRule
 
Field Summary
protected static java.lang.String KEY_MESSAGE_MANDATORY
           
 
Fields inherited from class org.beanfabrics.model.AbstractPM
KEY_MESSAGE_ONE_OR_MORE_INVALID
 
Constructor Summary
protected AbstractValuePM()
          Constructs a AbstractValuePM.
 
Method Summary
 java.lang.String getDescription()
          Returns the description of this PM.
 java.lang.String getTitle()
          Returns the title of this PM.
 boolean isEditable()
          Returns whether the value of this PM could be modified by the view.
 boolean isMandatory()
          Returns whether this PM requires a non-empty value.
 void revalidate()
          Updates the validation state of this object, usually by calling Validator.validate().
 void setDescription(java.lang.String description)
          Sets the description of this PM.
 void setEditable(boolean editable)
          Sets the specified boolean to indicate whether or not this PM is editable.
 void setMandatory(boolean mandatory)
          Sets whether this PM requires a non-empty value.
 void setTitle(java.lang.String title)
          Sets the title of this PM.
 
Methods inherited from class org.beanfabrics.model.AbstractPM
getComparable, getContext, getSupportMap, revalidateProperties
 
Methods inherited from class org.beanfabrics.ValidatableBean
getValidationState, getValidator, isValid, setValidationState
 
Methods inherited from class org.beanfabrics.AbstractBean
addPropertyChangeListener, addPropertyChangeListener, equals, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.beanfabrics.model.IValuePM
isEmpty
 
Methods inherited from interface org.beanfabrics.Bean
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeSupport, removePropertyChangeListener, removePropertyChangeListener
 
Methods inherited from interface org.beanfabrics.validation.Validatable
getValidationState, getValidator, isValid
 
Methods inherited from interface org.beanfabrics.support.Supportable
getSupportMap
 
Methods inherited from interface org.beanfabrics.context.ContextOwner
getContext
 
Methods inherited from interface org.beanfabrics.HasComparable
getComparable
 

Field Detail

KEY_MESSAGE_MANDATORY

protected static final java.lang.String KEY_MESSAGE_MANDATORY
See Also:
Constant Field Values
Constructor Detail

AbstractValuePM

protected AbstractValuePM()
Constructs a AbstractValuePM.

Method Detail

getDescription

public java.lang.String getDescription()
Returns the description of this PM. It contains some words for the user that describe the type of information that is represented by this PM. Usually it's displayed to the user as some kind of a tooltip.

Specified by:
getDescription in interface IValuePM
Returns:
the description of this PM

setDescription

public void setDescription(java.lang.String description)
Sets the description of this PM.

Specified by:
setDescription in interface IValuePM
See Also:
IValuePM.getDescription()

isMandatory

public boolean isMandatory()
Returns whether this PM requires a non-empty value. This PM is marked as invalid if it's empty.

Specified by:
isMandatory in interface IValuePM
Returns:
whether this PM requires a non-empty value
See Also:
IValuePM.isEmpty()

setMandatory

public void setMandatory(boolean mandatory)
Sets whether this PM requires a non-empty value.

Specified by:
setMandatory in interface IValuePM
Parameters:
mandatory - set to true if this PM requires a non-empty value
See Also:
IValuePM.isMandatory()

getTitle

public java.lang.String getTitle()
Returns the title of this PM. It contains some words for the user to identify the attribute represented by this PM in the context of a containment structure. Some view components may display this title as a field label.

Specified by:
getTitle in interface IValuePM
Returns:
the title of this PM.

setTitle

public void setTitle(java.lang.String title)
Sets the title of this PM.

Specified by:
setTitle in interface IValuePM
See Also:
IValuePM.getTitle()

isEditable

public boolean isEditable()
Returns whether the value of this PM could be modified by the view. If set to false the view must not change the value but the programmer still can do it.

Specified by:
isEditable in interface IValuePM
Returns:
whether the value of this PM could be modified by the view

setEditable

public void setEditable(boolean editable)
Sets the specified boolean to indicate whether or not this PM is editable.

Specified by:
setEditable in interface IValuePM
Parameters:
editable - the boolean to be set
See Also:
IValuePM.isEditable()

revalidate

public void revalidate()
Description copied from class: ValidatableBean
Updates the validation state of this object, usually by calling Validator.validate().

Specified by:
revalidate in interface Validatable
Overrides:
revalidate in class ValidatableBean