fr.paris.lutece.plugins.ods.ui.field
Class AbstractFieldFactory

java.lang.Object
  extended by fr.paris.lutece.plugins.ods.ui.field.AbstractFieldFactory
Direct Known Subclasses:
FieldFactory

public abstract class AbstractFieldFactory
extends java.lang.Object

Classe Factory pour la création des éléments de base d'un formulaire. De manière globale, les méthodes prennent en paramètre un id et un bean pour récupérer la valeur du formulaire. Ensuite, on peut passer en paramètre un label (ou clé i18n) afin de créer un champ et son label associé.


Constructor Summary
AbstractFieldFactory()
           
 
Method Summary
static void addJsEvent(Field field, java.util.HashMap<JsEventEnum,java.lang.String> jsEventMap)
          Ajout d'evenements javascript
static Field composeFields(Field f1, Field f2)
          Association de champs sans label
static Field composeFields(Field f1, Field f2, java.lang.String label)
          Association de champs avec label
static Field getArrondissementsField(java.lang.String id, java.util.List<? extends java.lang.Object> selectedValues, fr.paris.lutece.util.ReferenceList referenceValues)
          Affichage du formulaire de saisie des arrondissements
static java.util.List<Field> getBox(java.lang.String strStartId, java.lang.String strEndId, java.lang.String strTitle, Field... fields)
          Creation d'un element de type highlightedBox.
static Field getButton(ButtonTypeEnum buttonType)
          Creation d'un bouton avec libelle par defaut
static Field getButton(ButtonTypeEnum buttonType, java.lang.String label)
          Creation d'un bouton avec specification du label
static Field getButton(ButtonTypeEnum buttonType, java.lang.String label, java.lang.String strButtonType)
          Creation d'un bouton avec specification du label
static Field getCaptionField(java.lang.String value)
          Affichage d'une simple valeur
static Field getCaptionField(java.lang.String value, java.lang.String label)
          Affichage d'une simple valeur
static Field getComboListField(java.lang.String id, java.lang.Object formBean, java.lang.String label, fr.paris.lutece.util.ReferenceList values)
          Affichage d'une combo avec label
static Field getComboListField(java.lang.String id, java.lang.Object formBean, java.lang.String label, fr.paris.lutece.util.ReferenceList values, java.util.Map<JsEventEnum,java.lang.String> jsEventMap)
          Ajout d'une combo avec label et javascript
static Field getDateField(java.lang.String id, java.lang.Object formBean)
          Creation de champ date sans label
static Field getDateField(java.lang.String id, java.lang.Object formBean, java.lang.String label)
          Creation de champ date avec label
static Field getDirectionsCoemetricesField(java.lang.String id, java.util.List<? extends java.lang.Object> selectedValues, fr.paris.lutece.util.ReferenceList referenceValues)
          Affichage du formulaire de saisie des directions coemetrices
static Field getFichierField(java.lang.String id, java.lang.Object formBean, java.lang.String label, java.lang.String idFileItem)
          Creation d'un champ upload avec label
static Field getHiddenIntField(java.lang.String id, java.lang.Object formBean)
          Creation d'un champ hidden sur valeur numerique
static Field getHiddenStringField(java.lang.String id, java.lang.Object formBean)
          Creation d'un champ hidden sur chaine de caracteres
static Field getHorizontalLayout(java.lang.String id, Field... fields)
          Creation d'un layout horizontal.
static Field getHorizontalLayout(java.lang.String id, java.lang.String label, Field... fields)
          Creation d'un layout horizontal.
static Field getNotice(java.lang.String id)
          Récupération de l'extrait notice présent sur certains formulaires
static Field getNotice(java.lang.String id, java.lang.String strTemplatePath)
          Récupération d'une notice correpondant au template passé en paramètre.
static Field getSimpleCheckbox(java.lang.String id, java.lang.Object formBean, java.lang.String label)
          Affichage d'une checkbox simple avec label
protected static Field getTemplateField(java.lang.String id, java.lang.String templatePath, java.util.Map<java.lang.String,java.lang.Object> model, java.lang.String templateJSPath, java.util.Map<java.lang.String,java.lang.Object> jsModel)
          Affichage d'un template freemarker personnalise
static Field getTextArea(java.lang.String id, java.lang.Object formBean, java.lang.String label)
          Affichage d'un champ textarea avec label
static Field getTextField(java.lang.String id, java.lang.Object formBean)
          Creation d'un champ texte sans label
static Field getTextField(java.lang.String id, java.lang.Object formBean, java.lang.String label)
          Creation d'un champ texte avec label
static void setReadonlyFields(java.util.List<Field> result, java.util.List<java.lang.String> readonlyFields)
          Positionne les champs dont les identifiants sont dans la liste readonlyFields en readonly
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractFieldFactory

public AbstractFieldFactory()
Method Detail

getDateField

public static Field getDateField(java.lang.String id,
                                 java.lang.Object formBean)
Creation de champ date sans label

Parameters:
id -
formBean -
Returns:

getDateField

public static Field getDateField(java.lang.String id,
                                 java.lang.Object formBean,
                                 java.lang.String label)
Creation de champ date avec label

Parameters:
id -
formBean -
label -
Returns:

composeFields

public static Field composeFields(Field f1,
                                  Field f2)
Association de champs sans label

Parameters:
f1 -
f2 -
Returns:

composeFields

public static Field composeFields(Field f1,
                                  Field f2,
                                  java.lang.String label)
Association de champs avec label

Parameters:
f1 -
f2 -
label -
Returns:

getTextField

public static Field getTextField(java.lang.String id,
                                 java.lang.Object formBean)
Creation d'un champ texte sans label

Parameters:
id -
formBean -
Returns:

getTextField

public static Field getTextField(java.lang.String id,
                                 java.lang.Object formBean,
                                 java.lang.String label)
Creation d'un champ texte avec label

Parameters:
id -
formBean -
label -
Returns:

getCaptionField

public static Field getCaptionField(java.lang.String value,
                                    java.lang.String label)
Affichage d'une simple valeur

Parameters:
value -
label -
Returns:

getCaptionField

public static Field getCaptionField(java.lang.String value)
Affichage d'une simple valeur

Parameters:
value -
Returns:

getTextArea

public static Field getTextArea(java.lang.String id,
                                java.lang.Object formBean,
                                java.lang.String label)
Affichage d'un champ textarea avec label

Parameters:
id -
formBean -
label -
Returns:

getComboListField

public static Field getComboListField(java.lang.String id,
                                      java.lang.Object formBean,
                                      java.lang.String label,
                                      fr.paris.lutece.util.ReferenceList values)
Affichage d'une combo avec label

Parameters:
id -
formBean -
label -
values -
Returns:

getSimpleCheckbox

public static Field getSimpleCheckbox(java.lang.String id,
                                      java.lang.Object formBean,
                                      java.lang.String label)
Affichage d'une checkbox simple avec label

Parameters:
id -
formBean -
label -
Returns:

getTemplateField

protected static Field getTemplateField(java.lang.String id,
                                        java.lang.String templatePath,
                                        java.util.Map<java.lang.String,java.lang.Object> model,
                                        java.lang.String templateJSPath,
                                        java.util.Map<java.lang.String,java.lang.Object> jsModel)
Affichage d'un template freemarker personnalise

Parameters:
id -
templatePath -
model -
templateJSPath -
jsModel -
Returns:

getArrondissementsField

public static Field getArrondissementsField(java.lang.String id,
                                            java.util.List<? extends java.lang.Object> selectedValues,
                                            fr.paris.lutece.util.ReferenceList referenceValues)
Affichage du formulaire de saisie des arrondissements

Parameters:
id -
model -
jsModel -
Returns:

getDirectionsCoemetricesField

public static Field getDirectionsCoemetricesField(java.lang.String id,
                                                  java.util.List<? extends java.lang.Object> selectedValues,
                                                  fr.paris.lutece.util.ReferenceList referenceValues)
Affichage du formulaire de saisie des directions coemetrices

Parameters:
id -
selectedValues -
referenceValues -
Returns:

addJsEvent

public static void addJsEvent(Field field,
                              java.util.HashMap<JsEventEnum,java.lang.String> jsEventMap)
Ajout d'evenements javascript

Parameters:
field -
jsEventMap -

getComboListField

public static Field getComboListField(java.lang.String id,
                                      java.lang.Object formBean,
                                      java.lang.String label,
                                      fr.paris.lutece.util.ReferenceList values,
                                      java.util.Map<JsEventEnum,java.lang.String> jsEventMap)
Ajout d'une combo avec label et javascript

Parameters:
id -
formBean -
label -
values -
jsEventMap -
Returns:

getHiddenIntField

public static Field getHiddenIntField(java.lang.String id,
                                      java.lang.Object formBean)
Creation d'un champ hidden sur valeur numerique

Parameters:
id -
formBean -
Returns:

getHiddenStringField

public static Field getHiddenStringField(java.lang.String id,
                                         java.lang.Object formBean)
Creation d'un champ hidden sur chaine de caracteres

Parameters:
id -
formBean -
Returns:

getButton

public static Field getButton(ButtonTypeEnum buttonType)
Creation d'un bouton avec libelle par defaut

Parameters:
buttonType - ButtonTypeEnum
Returns:

getButton

public static Field getButton(ButtonTypeEnum buttonType,
                              java.lang.String label)
Creation d'un bouton avec specification du label

Parameters:
buttonType - ButtonTypeEnum
label - cle i18n
Returns:

getButton

public static Field getButton(ButtonTypeEnum buttonType,
                              java.lang.String label,
                              java.lang.String strButtonType)
Creation d'un bouton avec specification du label

Parameters:
buttonType - ButtonTypeEnum
label - cle i18n
Returns:

getFichierField

public static Field getFichierField(java.lang.String id,
                                    java.lang.Object formBean,
                                    java.lang.String label,
                                    java.lang.String idFileItem)
Creation d'un champ upload avec label

Parameters:
id - l'id du champ de type Fichier dans le bean
formBean -
label -
idFileItem - l'id du champ de type FileItem dans le bean (pour la gestion de l'upload)
Returns:

setReadonlyFields

public static void setReadonlyFields(java.util.List<Field> result,
                                     java.util.List<java.lang.String> readonlyFields)
Positionne les champs dont les identifiants sont dans la liste readonlyFields en readonly

Parameters:
result -
readonlyFields -

getBox

public static java.util.List<Field> getBox(java.lang.String strStartId,
                                           java.lang.String strEndId,
                                           java.lang.String strTitle,
                                           Field... fields)
Creation d'un element de type highlightedBox.

Parameters:
strStartId - identifiant du debut de la box
strEndId - identifiant de la fin de la box
strTitle - clé i18n du titre à afficher dans la box
fields - champs à inclure
Returns:
une liste de Field

getHorizontalLayout

public static Field getHorizontalLayout(java.lang.String id,
                                        Field... fields)
Creation d'un layout horizontal. Cet élément est utilisé par exemple pour placer les boutons d'un formulaire sur une même ligne

Parameters:
id - identifiant du layout
fields - champs contenus dans le layout
Returns:

getHorizontalLayout

public static Field getHorizontalLayout(java.lang.String id,
                                        java.lang.String label,
                                        Field... fields)
Creation d'un layout horizontal. Cet élément est utilisé par exemple pour placer les boutons d'un formulaire sur une même ligne

Parameters:
id - identifiant du layout
label -
fields - champs contenus dans le layout
Returns:

getNotice

public static Field getNotice(java.lang.String id)
Récupération de l'extrait notice présent sur certains formulaires

Parameters:
id - identifiant du champ
Returns:

getNotice

public static Field getNotice(java.lang.String id,
                              java.lang.String strTemplatePath)
Récupération d'une notice correpondant au template passé en paramètre.

Parameters:
id - identifiant du champ
Returns:


Copyright © 2010 Mairie de Paris. All Rights Reserved.