org.alfresco.web.bean.generator
Class DatePickerGenerator

java.lang.Object
  extended by org.alfresco.web.bean.generator.BaseComponentGenerator
      extended by org.alfresco.web.bean.generator.DatePickerGenerator
All Implemented Interfaces:
IComponentGenerator
Direct Known Subclasses:
DateTimePickerGenerator

public class DatePickerGenerator
extends BaseComponentGenerator

Generates a date picker component.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.alfresco.web.bean.generator.BaseComponentGenerator
BaseComponentGenerator.ControlType
 
Constructor Summary
DatePickerGenerator()
           
 
Method Summary
 javax.faces.component.UIComponent generate(javax.faces.context.FacesContext context, java.lang.String id)
          Dynamically generates a component in a default state
protected  javax.faces.convert.Converter getDefaultConverter(javax.faces.context.FacesContext context)
          Retrieves the default converter for the date component
 java.lang.String getNoneLabel()
          Returns the label to use when there is no date set.
 int getStartYear()
           
 int getYearCount()
           
 boolean isInitialiseIfNull()
           
 void setInitialiseIfNull(boolean initialiseIfNull)
           
 void setNoneLabel(java.lang.String noneLabel)
          Sets the label to use when there is no date set.
 void setStartYear(int startYear)
           
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 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.
 void setYearCount(int yearCount)
           
 
Methods inherited from class org.alfresco.web.bean.generator.BaseComponentGenerator
addStringConstraintParam, createAndSetConverter, createComponent, createOutputTextComponent, generateAndAdd, getAssociationDefinition, getControlType, getPropertyDefinition, isEnabledInEditMode, setupAssociation, setupConstraints, setupConverter, setupMandatoryAssociationIfNecessary, setupMandatoryMarker, setupMandatoryPropertyIfNecessary, setupMultiValuePropertyIfNecessary, setupNumericRangeConstraint, setupProperty, setupRegexConstraint, setupStringLengthConstraint
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatePickerGenerator

public DatePickerGenerator()
Method Detail

getStartYear

public int getStartYear()
Returns:
Returns the year to start counting back from

setStartYear

public void setStartYear(int startYear)
Parameters:
startYear - Sets the year to start counting back from

getYearCount

public int getYearCount()
Returns:
Returns the number of years to show

setYearCount

public void setYearCount(int yearCount)
Parameters:
yearCount - Sets the number of years to show

isInitialiseIfNull

public boolean isInitialiseIfNull()
Returns:
Determines whether the control should initially show today's date if the model value is null

setInitialiseIfNull

public void setInitialiseIfNull(boolean initialiseIfNull)
Parameters:
initialiseIfNull - Determines whether the control should initially show today's date if the model value is null. This will also hide the None button thus disallowing the user to set the date back to null.

getNoneLabel

public java.lang.String getNoneLabel()
Returns the label to use when there is no date set.

Returns:
The 'None' label to use

setNoneLabel

public void setNoneLabel(java.lang.String noneLabel)
Sets the label to use when there is no date set. Setting this to null will use the default label.

Parameters:
noneLabel - The 'None' label

generate

public javax.faces.component.UIComponent generate(javax.faces.context.FacesContext context,
                                                  java.lang.String id)
Description copied from interface: IComponentGenerator
Dynamically generates a component in a default state

Parameters:
context - FacesContext
id - Optional id for the newly created component, if null is passed a unique id is generated
Returns:
The component instance

setupConverter

protected void setupConverter(javax.faces.context.FacesContext context,
                              UIPropertySheet propertySheet,
                              PropertySheetItem property,
                              org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
                              javax.faces.component.UIComponent component)
Description copied from class: BaseComponentGenerator
Sets up the appropriate converter for the given property

Overrides:
setupConverter in class BaseComponentGenerator
Parameters:
context - FacesContext
propertySheet - The property sheet being generated
property - The property being generated
propertyDef - The data dictionary definition of the property
component - The component representing the property

setupMandatoryValidation

protected void setupMandatoryValidation(javax.faces.context.FacesContext context,
                                        UIPropertySheet propertySheet,
                                        PropertySheetItem item,
                                        javax.faces.component.UIComponent component,
                                        boolean realTimeChecking,
                                        java.lang.String idSuffix)
Description copied from class: BaseComponentGenerator
Sets up a client mandatory validation rule with the property sheet for the given item.

Overrides:
setupMandatoryValidation in class BaseComponentGenerator
Parameters:
context - FacesContext
propertySheet - The property sheet to add the validation rule to
item - The item being generated
component - The component representing the item
realTimeChecking - true to make the client validate as the user types
idSuffix - An optional suffix to add to the client id

getDefaultConverter

protected javax.faces.convert.Converter getDefaultConverter(javax.faces.context.FacesContext context)
Retrieves the default converter for the date component

Parameters:
context - FacesContext
Returns:
XMLDateConverter


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.