public abstract class BaseComponentGenerator extends java.lang.Object implements IComponentGenerator
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BaseComponentGenerator.ControlType |
| Constructor and Description |
|---|
BaseComponentGenerator() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addStringConstraintParam(java.util.List params,
java.lang.String param)
Adds the given string parameter to the list of parameters to be used for
validating constraints on the client.
|
protected void |
createAndSetConverter(javax.faces.context.FacesContext context,
java.lang.String converterId,
javax.faces.component.UIComponent component)
Creates the converter with the given id and adds it to the component.
|
protected javax.faces.component.UIComponent |
createComponent(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item)
Creates the component for the given proerty sheet item.
|
protected javax.faces.component.UIOutput |
createOutputTextComponent(javax.faces.context.FacesContext context,
java.lang.String id)
Creates an output text component.
|
javax.faces.component.UIComponent |
generateAndAdd(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item)
Dynamically generates a component for the given property sheet item.
|
protected org.alfresco.service.cmr.dictionary.AssociationDefinition |
getAssociationDefinition(javax.faces.context.FacesContext context,
Node node,
java.lang.String associationName)
Retrieve the AssociationDefinition for the given property name on the given node
|
protected BaseComponentGenerator.ControlType |
getControlType()
Returns the type of the control being generated
|
protected org.alfresco.service.cmr.dictionary.PropertyDefinition |
getPropertyDefinition(javax.faces.context.FacesContext context,
Node node,
java.lang.String propertyName)
Retrieve the PropertyDefinition for the given property name on the given node
|
boolean |
isEnabledInEditMode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent control,
org.alfresco.service.cmr.dictionary.PropertyDefinition propDef)
Determines whether the component will be enabled when rendered.
|
protected void |
setupAssociation(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
javax.faces.component.UIComponent component)
Sets up the association component i.e.
|
protected void |
setupConstraints(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Sets up client validation rules for any constraints the property has.
|
protected void |
setupConverter(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem association,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
javax.faces.component.UIComponent component)
Sets up the appropriate converter for the given association
|
protected void |
setupConverter(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Sets up the appropriate converter for the given property
|
protected void |
setupMandatoryAssociationIfNecessary(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem association,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
javax.faces.component.UIComponent component)
Sets up a mandatory validation rule for the given association.
|
protected void |
setupMandatoryMarker(javax.faces.context.FacesContext context,
PropertySheetItem item)
Sets up the marker to show that the item is mandatory.
|
protected void |
setupMandatoryPropertyIfNecessary(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Sets up a mandatory validation rule for the given property.
|
protected void |
setupMandatoryValidation(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
javax.faces.component.UIComponent component,
boolean realTimeChecking,
java.lang.String idSuffix)
Sets up a client mandatory validation rule with the property
sheet for the given item.
|
protected javax.faces.component.UIComponent |
setupMultiValuePropertyIfNecessary(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Creates a wrapper component around the given component to enable the user
to edit multiple values.
|
protected void |
setupNumericRangeConstraint(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
javax.faces.component.UIComponent component,
org.alfresco.repo.dictionary.constraint.NumericRangeConstraint constraint,
boolean realTimeChecking)
Sets up a default validation rule for the numeric range constraint
|
protected void |
setupProperty(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Sets up the property component i.e.
|
protected void |
setupRegexConstraint(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
javax.faces.component.UIComponent component,
org.alfresco.repo.dictionary.constraint.RegexConstraint constraint,
boolean realTimeChecking)
Sets up a default validation rule for the regular expression constraint
|
protected void |
setupStringLengthConstraint(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
javax.faces.component.UIComponent component,
org.alfresco.repo.dictionary.constraint.StringLengthConstraint constraint,
boolean realTimeChecking)
Sets up a default validation rule for the string length constraint
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgeneratepublic javax.faces.component.UIComponent generateAndAdd(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item)
IComponentGeneratorgenerateAndAdd in interface IComponentGeneratorcontext - FacesContextpropertySheet - The property sheet componentitem - The wrappper component representing the item to generate,
either a property, association or child associationprotected javax.faces.component.UIComponent createComponent(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item)
context - FacesContextpropertySheet - The property sheet being generateditem - The property or association being generatedprotected void createAndSetConverter(javax.faces.context.FacesContext context,
java.lang.String converterId,
javax.faces.component.UIComponent component)
context - FacesContextconverterId - The name of the converter to createcomponent - The component to add the converter toprotected javax.faces.component.UIOutput createOutputTextComponent(javax.faces.context.FacesContext context,
java.lang.String id)
context - FacesContextid - Optional id to setprotected void setupProperty(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
context - FacesContextpropertySheet - The property sheetitem - The parent componentpropertyDef - The property definitioncomponent - The component representing the propertyprotected void setupAssociation(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
javax.faces.component.UIComponent component)
context - FacesContextpropertySheet - The property sheetitem - The parent componentassociationDef - The association definitioncomponent - The component representing the associationprotected javax.faces.component.UIComponent setupMultiValuePropertyIfNecessary(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
context - FacesContextpropertySheet - The property sheet being generatedproperty - The property being generatedpropertyDef - The data dictionary definition for the propertycomponent - The component representing the propertyprotected void setupMandatoryPropertyIfNecessary(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
context - FacesContextpropertySheet - The property sheet being generatedproperty - The property being generatedpropertyDef - The data dictionary definition of the propertycomponent - The component representing the propertyprotected void setupMandatoryAssociationIfNecessary(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem association,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
javax.faces.component.UIComponent component)
context - FacesContextpropertySheet - The property sheet being generatedassociation - The association being generatedassociationDef - The data dictionary definition of the associationcomponent - The component representing the associationprotected void setupMandatoryValidation(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
javax.faces.component.UIComponent component,
boolean realTimeChecking,
java.lang.String idSuffix)
context - FacesContextpropertySheet - The property sheet to add the validation rule toitem - The item being generatedcomponent - The component representing the itemrealTimeChecking - true to make the client validate as the user typesidSuffix - An optional suffix to add to the client idprotected void setupMandatoryMarker(javax.faces.context.FacesContext context,
PropertySheetItem item)
context - FacesContextitem - The item being generatedprotected void setupConstraints(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
context - FacesContext
propertySheet The property sheet being generatedproperty - The property being generatedpropertyDef - The data dictionary definition of the propertycomponent - The component representing the propertyprotected void setupRegexConstraint(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
javax.faces.component.UIComponent component,
org.alfresco.repo.dictionary.constraint.RegexConstraint constraint,
boolean realTimeChecking)
context - FacesContextpropertySheet - The property sheet to add the validation rule toproperty - The property being generatedcomponent - The component representing the propertyconstraint - The constraint to setuprealTimeChecking - true to make the client validate as the user typesprotected void setupStringLengthConstraint(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
javax.faces.component.UIComponent component,
org.alfresco.repo.dictionary.constraint.StringLengthConstraint constraint,
boolean realTimeChecking)
context - FacesContextpropertySheet - The property sheet to add the validation rule toproperty - The property being generatedcomponent - The component representing the propertyconstraint - The constraint to setuprealTimeChecking - true to make the client validate as the user typesprotected void setupNumericRangeConstraint(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
javax.faces.component.UIComponent component,
org.alfresco.repo.dictionary.constraint.NumericRangeConstraint constraint,
boolean realTimeChecking)
context - FacesContextpropertySheet - The property sheet to add the validation rule toproperty - The property being generatedcomponent - The component representing the propertyconstraint - The constraint to setuprealTimeChecking - true to make the client validate as the user typesprotected void setupConverter(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
context - FacesContextpropertySheet - The property sheet being generatedproperty - The property being generatedpropertyDef - The data dictionary definition of the propertycomponent - The component representing the propertyprotected void setupConverter(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem association,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
javax.faces.component.UIComponent component)
context - FacesContextpropertySheet - The property sheet being generatedassociation - The association being generatedassociationDef - The data dictionary definition of the propertycomponent - The component representing the associationprotected BaseComponentGenerator.ControlType getControlType()
protected org.alfresco.service.cmr.dictionary.PropertyDefinition getPropertyDefinition(javax.faces.context.FacesContext context,
Node node,
java.lang.String propertyName)
node - The node to get the property definition frompropertyName - The name of the propertyprotected org.alfresco.service.cmr.dictionary.AssociationDefinition getAssociationDefinition(javax.faces.context.FacesContext context,
Node node,
java.lang.String associationName)
node - The node to get the association definition fromassociationName - The name of the propertyprotected void addStringConstraintParam(java.util.List params,
java.lang.String param)
params - The list of parameters for the constraintparam - The string parameter to addpublic boolean isEnabledInEditMode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent control,
org.alfresco.service.cmr.dictionary.PropertyDefinition propDef)
IComponentGeneratorisEnabledInEditMode in interface IComponentGeneratorcontext - FacesContextcontrol - The control being renderedpropDef - The definition of the propertyCopyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.