C# Class Habanero.Faces.Base.RelationshipComboBoxMapper

An interface for a mapper that
Wraps/Decorates a ComboBox in order to display a collection of business objects in a combobox so that the user can select a business object for the purposes of setting a related Business Object. This control mapper maps the Selected business object to a single relationship etc but does not automatically load the List of Related Business Objects. AutoLoadingRelationshipComboBoxMapper
Inheritance: IComboBoxMapper
Show file Open project: Chillisoft/habanero.faces Class Usage Examples

Protected Properties

Property Type Description
_businessObject IBusinessObject
_logger IHabaneroLogger

Private Properties

Property Type Description
AddCurrentBOHandlers void
BusinessObject_OnSaved void
CheckBusinessObjectCollectionCorrectType void
CheckBusinessObjectCorrectType void
GetStackTrace string
IsRelationshipComposition bool
OnMappedRelationshipChanged void
RelatedBusinessObjectChanged_Handler void
RemoveCurrentBOHandlers void
SetupRelationshipForBO void
SetupSingleRelationship void
UpdateIsEditable void
UpdateLinkedRelationshipAndControl void

Public Methods

Method Description
ApplyChangesToBusinessObject ( ) : void

Updates the properties on the represented business object

GetErrorMessage ( ) : string

Returns the Error Provider's Error message.

RelationshipComboBoxMapper ( IComboBox comboBox, string relationshipName, bool isReadOnly, IControlFactory controlFactory ) : System

Constructs a RelationshipComboBoxMapper with the comboBox relationshipName

SetPropertyAttributes ( Hashtable attributes ) : void

A form field can have attributes defined in the class definition. These attributes are passed to the control mapper via a hashtable so that the control mapper can adjust its behaviour accordingly.

UpdateControlValueFromBusinessObject ( ) : void

Updates the value on the control from the corresponding property on the represented IControlMapper.BusinessObject

UpdateErrorProviderErrorMessage ( ) : void

Sets the Error Provider Error with the appropriate value for the property e.g. if it is invalid then sets the error provider with the invalid reason else sets the error provider with a zero length string.

Protected Methods

Method Description
GetRelatedBusinessObject ( ) : IBusinessObject

Returns the property value of the business object being mapped

InternalUpdateControlValueFromBo ( ) : void

Updates the value on the control from the corresponding property on the represented IControlMapper.BusinessObject

LoadCollectionForBusinessObject ( ) : void

Provides an overrideable method for custom Loading the collection of business objects

SetRelatedBusinessObject ( IBusinessObject value ) : void

Sets the property value to that provided. If the property value is invalid, the error provider will be given the reason why the value is invalid.

Private Methods

Method Description
AddCurrentBOHandlers ( ) : void
BusinessObject_OnSaved ( object sender, Habanero.Base.BOEventArgs e ) : void
CheckBusinessObjectCollectionCorrectType ( IBusinessObjectCollection newBusinessObjectCollection ) : void
CheckBusinessObjectCorrectType ( IBusinessObject value ) : void
GetStackTrace ( ) : string
IsRelationshipComposition ( ) : bool
OnMappedRelationshipChanged ( ) : void
RelatedBusinessObjectChanged_Handler ( object sender, EventArgs e ) : void
RemoveCurrentBOHandlers ( ) : void
SetupRelationshipForBO ( IBusinessObject businessObject ) : void
SetupSingleRelationship ( ) : void
UpdateIsEditable ( ) : void
UpdateLinkedRelationshipAndControl ( ) : void

Method Details

ApplyChangesToBusinessObject() public method

Updates the properties on the represented business object
public ApplyChangesToBusinessObject ( ) : void
return void

GetErrorMessage() public method

Returns the Error Provider's Error message.
public GetErrorMessage ( ) : string
return string

GetRelatedBusinessObject() protected method

Returns the property value of the business object being mapped
protected GetRelatedBusinessObject ( ) : IBusinessObject
return IBusinessObject

InternalUpdateControlValueFromBo() protected method

Updates the value on the control from the corresponding property on the represented IControlMapper.BusinessObject
protected InternalUpdateControlValueFromBo ( ) : void
return void

LoadCollectionForBusinessObject() protected method

Provides an overrideable method for custom Loading the collection of business objects
protected LoadCollectionForBusinessObject ( ) : void
return void

RelationshipComboBoxMapper() public method

Constructs a RelationshipComboBoxMapper with the comboBox relationshipName
public RelationshipComboBoxMapper ( IComboBox comboBox, string relationshipName, bool isReadOnly, IControlFactory controlFactory ) : System
comboBox IComboBox The combo box that is being mapped to
relationshipName string The name of the relation that is being mapped to
isReadOnly bool Whether the Combo box can be used to edit from or whether it is only viewable
controlFactory IControlFactory A control factory that is used to create control mappers etc
return System

SetPropertyAttributes() public method

A form field can have attributes defined in the class definition. These attributes are passed to the control mapper via a hashtable so that the control mapper can adjust its behaviour accordingly.
public SetPropertyAttributes ( Hashtable attributes ) : void
attributes System.Collections.Hashtable A hashtable of attributes, which consists /// of name-value pairs, where name is the attribute name. This is usually /// set in the XML definitions for the class's user interface.
return void

SetRelatedBusinessObject() protected method

Sets the property value to that provided. If the property value is invalid, the error provider will be given the reason why the value is invalid.
protected SetRelatedBusinessObject ( IBusinessObject value ) : void
value IBusinessObject
return void

UpdateControlValueFromBusinessObject() public method

Updates the value on the control from the corresponding property on the represented IControlMapper.BusinessObject
public UpdateControlValueFromBusinessObject ( ) : void
return void

UpdateErrorProviderErrorMessage() public method

Sets the Error Provider Error with the appropriate value for the property e.g. if it is invalid then sets the error provider with the invalid reason else sets the error provider with a zero length string.
public UpdateErrorProviderErrorMessage ( ) : void
return void

Property Details

_businessObject protected property

protected IBusinessObject _businessObject
return IBusinessObject

_logger protected static property

Uses for logging
protected static IHabaneroLogger _logger
return IHabaneroLogger