org.hackystat.projectbrowser.page.trajectory.validator
Class ProjectRecordDateValidator

java.lang.Object
  extended by org.apache.wicket.markup.html.form.validation.AbstractFormValidator
      extended by org.hackystat.projectbrowser.page.trajectory.validator.ProjectRecordDateValidator
All Implemented Interfaces:
java.io.Serializable, org.apache.wicket.IClusterable, org.apache.wicket.markup.html.form.validation.IFormValidator

public class ProjectRecordDateValidator
extends org.apache.wicket.markup.html.form.validation.AbstractFormValidator

Provides a project date validator. This validator will work with forms that have a multiple selection menu for Projects, plus either one or two date fields. It provides two constructors: one for forms with a Project menu and one date, and one for forms with a Project menu and two dates.

Author:
Philip Johnson, Pavel Senin
See Also:
Serialized Form

Constructor Summary
ProjectRecordDateValidator(org.apache.wicket.markup.html.form.FormComponent projectMenu, org.apache.wicket.markup.html.form.FormComponent dateField)
          Takes a Project menu and a single Date field.
ProjectRecordDateValidator(org.apache.wicket.markup.html.form.FormComponent projectMenu, org.apache.wicket.markup.html.form.FormComponent startDateField, org.apache.wicket.markup.html.form.FormComponent endDateField)
          Takes a Project menu (ListMultipleChoice or ListChoice) and two Date fields (DateTextField).
ProjectRecordDateValidator(org.apache.wicket.markup.html.form.FormComponent projectMenu, org.apache.wicket.markup.html.form.FormComponent startDateField, org.apache.wicket.markup.html.form.FormComponent endDateField, org.apache.wicket.markup.html.form.FormComponent indent)
          Takes a Project menu (ListMultipleChoice or ListChoice) and two Date fields (DateTextField).
 
Method Summary
 org.apache.wicket.markup.html.form.FormComponent[] getDependentFormComponents()
          Returns the form components.
 void validate(org.apache.wicket.markup.html.form.Form projectDateForm)
          Performs the validation.
 
Methods inherited from class org.apache.wicket.markup.html.form.validation.AbstractFormValidator
error, error, error, error, messageModel, resourceKey, variablesMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectRecordDateValidator

public ProjectRecordDateValidator(org.apache.wicket.markup.html.form.FormComponent projectMenu,
                                  org.apache.wicket.markup.html.form.FormComponent dateField)
Takes a Project menu and a single Date field.

Parameters:
projectMenu - The project menu component.
dateField - The Date field component.

ProjectRecordDateValidator

public ProjectRecordDateValidator(org.apache.wicket.markup.html.form.FormComponent projectMenu,
                                  org.apache.wicket.markup.html.form.FormComponent startDateField,
                                  org.apache.wicket.markup.html.form.FormComponent endDateField)
Takes a Project menu (ListMultipleChoice or ListChoice) and two Date fields (DateTextField).

Parameters:
projectMenu - The project menu component.
startDateField - The Date field component.
endDateField - The Date field component.

ProjectRecordDateValidator

public ProjectRecordDateValidator(org.apache.wicket.markup.html.form.FormComponent projectMenu,
                                  org.apache.wicket.markup.html.form.FormComponent startDateField,
                                  org.apache.wicket.markup.html.form.FormComponent endDateField,
                                  org.apache.wicket.markup.html.form.FormComponent indent)
Takes a Project menu (ListMultipleChoice or ListChoice) and two Date fields (DateTextField).

Parameters:
projectMenu - The project menu component.
startDateField - The Date field component.
endDateField - The Date field component.
indent - The indent for the interval.
Method Detail

getDependentFormComponents

public org.apache.wicket.markup.html.form.FormComponent[] getDependentFormComponents()
Returns the form components.

Returns:
The form components.

validate

public void validate(org.apache.wicket.markup.html.form.Form projectDateForm)
Performs the validation. Note that this validation must handle a projectMenu plus a single date, or a projectMenu plus two dates (start and end date).

Parameters:
projectDateForm - The form to validate.