Package muntjac :: Package ui :: Module default_field_factory :: Class DefaultFieldFactory
[hide private]
[frames] | no frames]

Class DefaultFieldFactory

source code

                            object --+    
                                     |    
  form_field_factory.IFormFieldFactory --+
                                         |
                            object --+   |
                                     |   |
table_field_factory.ITableFieldFactory --+
                                         |
                                        DefaultFieldFactory

This class contains a basic implementation for both IFormFieldFactory and ITableFieldFactory. The class is singleton, use get method to get reference to the instance.

There are also some static helper methods available for custom built field factories.

Instance Methods [hide private]
 
createField(self, *args)
Creates a field based on the item, property id and the component (most commonly Form) where the Field will be presented.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]
 
get(cls)
Singleton method to get an instance of DefaultFieldFactory.
source code
 
createCaptionByPropertyId(cls, propertyId)
If name follows method naming conventions, convert the name to spaced upper case text.
source code
 
createFieldByPropertyType(cls, typ)
Creates fields based on the property type.
source code
Class Variables [hide private]
  INSTANCE = DefaultFieldFactory()
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

get(cls)
Class Method

source code 

Singleton method to get an instance of DefaultFieldFactory.

Returns:
an instance of DefaultFieldFactory

createField(self, *args)

source code 

Creates a field based on the item, property id and the component (most commonly Form) where the Field will be presented.

Parameters:
  • item - the item where the property belongs to.
  • propertyId - the Id of the property.
  • uiContext - the component where the field is presented, most commonly this is Form. uiContext will not necessary be the parent component of the field, but the one that is responsible for creating it.
Returns:
Field the field suitable for editing the specified data.
Overrides: table_field_factory.ITableFieldFactory.createField
(inherited documentation)

createCaptionByPropertyId(cls, propertyId)
Class Method

source code 

If name follows method naming conventions, convert the name to spaced upper case text. For example, convert "firstName" to "First Name"

Returns:
the formatted caption string

createFieldByPropertyType(cls, typ)
Class Method

source code 

Creates fields based on the property type.

The default field type is TextField. Other field types generated by this method:

Parameters:
  • typ - the type of the property
Returns:
the most suitable generic Field for given type