org.olat.core.gui.components.form.flexible.impl.elements
Class JSDateChooser

java.lang.Object
  extended by org.olat.core.gui.components.form.flexible.impl.FormItemImpl
      extended by org.olat.core.gui.components.form.flexible.impl.elements.AbstractTextElement
          extended by org.olat.core.gui.components.form.flexible.impl.elements.TextElementImpl
              extended by org.olat.core.gui.components.form.flexible.impl.elements.JSDateChooser
All Implemented Interfaces:
DateChooser, InlineElement, InlineTextElement, TextElement, FormBaseComponentIdProvider, FormItem

public class JSDateChooser
extends TextElementImpl
implements DateChooser

Description:
TODO: patrickb Class Description for JSDateChooser

Initial Date: 19.01.2007

Author:
patrickb

Field Summary
 
Fields inherited from class org.olat.core.gui.components.form.flexible.impl.elements.TextElementImpl
HTML_INPUT_TYPE_PASSWORD, HTML_INPUT_TYPE_TEXT
 
Fields inherited from interface org.olat.core.gui.components.form.flexible.FormItem
ERRORC, EXAMPLEC, LABELC
 
Fields inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider
DISPPREFIX
 
Constructor Summary
JSDateChooser(java.lang.String name, java.lang.String predefinedValue)
           
 
Method Summary
 java.util.Date getDate()
           
 java.lang.String getDateChooserDateFormat()
           
 java.lang.String getExampleDateString()
           
 boolean isDateChooserTimeEnabled()
           
 void setCustomDateFormat(java.lang.String customDateFormat)
          Set an optional date format if the default format for the current locale is not good.
 void setDate(java.util.Date date)
           
 void setDateChooserDateFormat(java.lang.String dateChooserDateFormat)
          Set an optional date chooser format if the default format for the current locale is not good.
 void setDateChooserTimeEnabled(boolean dateChooserTimeEnabled)
           
 void setDisplaySize(int dispSize)
          defines the desired display size of the element
 void setEnabled(boolean isEnabled)
          item is enabled/disabled, e.g.
 void setValidDateCheck(java.lang.String errorKey)
           
 void setVisible(boolean isVisible)
          item, label, example, error get not visible
 void showError(boolean show)
           
 void validate(java.util.List validationResults)
          validate the data in the field, create error messages or update any component.
 
Methods inherited from class org.olat.core.gui.components.form.flexible.impl.elements.TextElementImpl
evalFormRequest, setTranslator
 
Methods inherited from class org.olat.core.gui.components.form.flexible.impl.elements.AbstractTextElement
getValue, getValue, isEmpty, isEmpty, reset, setIsEqualCheck, setItemValidatorProvider, setMaxLength, setNewOriginalValue, setNotEmptyCheck, setNotLongerThanCheck, setRegexMatchCheck, setValue
 
Methods inherited from class org.olat.core.gui.components.form.flexible.impl.FormItemImpl
addActionListener, clearError, doDispatchFormRequest, getAction, getActionListenersFor, getComponent, getEmptyDisplayText, getErrorC, getErrorText, getExampleC, getExampleText, getFormDispatchId, getLabelC, getLabelText, getName, getRootForm, getTranslator, getUserObject, hasError, hasExample, hasFocus, hasLabel, isEnabled, isInlineEditingOn, isMandatory, isVisible, setEmptyDisplayText, setErrorComponent, setErrorKey, setExampleKey, setFocus, setLabel, setLabelComponent, setMandatory, setRootForm, setUserObject, showExample, showLabel, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.elements.TextElement
getValue, getValue, isEmpty, isEmpty, setIsEqualCheck, setItemValidatorProvider, setMaxLength, setNewOriginalValue, setNotEmptyCheck, setNotLongerThanCheck, setRegexMatchCheck, setValue
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.FormItem
addActionListener, clearError, doDispatchFormRequest, evalFormRequest, getAction, getActionListenersFor, getComponent, getErrorC, getErrorText, getExampleC, getExampleText, getLabelC, getLabelText, getName, getRootForm, getTranslator, getUserObject, hasError, hasExample, hasFocus, hasLabel, isEnabled, isMandatory, isVisible, reset, setErrorComponent, setErrorKey, setExampleKey, setFocus, setLabel, setLabelComponent, setMandatory, setRootForm, setTranslator, setUserObject, showExample, showLabel
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.FormBaseComponentIdProvider
getFormDispatchId
 
Methods inherited from interface org.olat.core.gui.components.form.flexible.elements.InlineElement
getEmptyDisplayText, isInlineEditingOn, setEmptyDisplayText
 

Constructor Detail

JSDateChooser

public JSDateChooser(java.lang.String name,
                     java.lang.String predefinedValue)
Method Detail

setDisplaySize

public void setDisplaySize(int dispSize)
Description copied from interface: TextElement
defines the desired display size of the element

Specified by:
setDisplaySize in interface TextElement
Overrides:
setDisplaySize in class AbstractTextElement
See Also:
TextElement.setDisplaySize(int)

validate

public void validate(java.util.List validationResults)
Description copied from interface: FormItem
validate the data in the field, create error messages or update any component.

This method must be implemented by a specialised form item provider.

Specified by:
validate in interface FormItem
Overrides:
validate in class AbstractTextElement
See Also:
org.olat.core.gui.components.form.flexible.elements.AbstractTextElement#validate(java.util.List)

showError

public void showError(boolean show)
Specified by:
showError in interface FormItem
Overrides:
showError in class FormItemImpl
See Also:
org.olat.core.gui.components.form.flexible.FormItemImpl#showError(boolean)

getDate

public java.util.Date getDate()
Specified by:
getDate in interface DateChooser
Returns:
the date or null if the value is not valid (parsed with DateFormat.getDateInstance(DateFormat.SHORT, locale), or with new SimpleDateFormat(customDataFormat))

setDate

public void setDate(java.util.Date date)
Specified by:
setDate in interface DateChooser

isDateChooserTimeEnabled

public boolean isDateChooserTimeEnabled()
Specified by:
isDateChooserTimeEnabled in interface DateChooser
Returns:

setDateChooserTimeEnabled

public void setDateChooserTimeEnabled(boolean dateChooserTimeEnabled)
Specified by:
setDateChooserTimeEnabled in interface DateChooser

getDateChooserDateFormat

public java.lang.String getDateChooserDateFormat()
Specified by:
getDateChooserDateFormat in interface DateChooser
Returns:

setDateChooserDateFormat

public void setDateChooserDateFormat(java.lang.String dateChooserDateFormat)
Description copied from interface: DateChooser
Set an optional date chooser format if the default format for the current locale is not good. It is recommended to use the locale dependent format when possible. (e.g. 22.02.99 for DE and 99/22/92 for EN)
Use a pattern that corresponds to the SimpleDateFormat patterns.

Specified by:
setDateChooserDateFormat in interface DateChooser

setCustomDateFormat

public void setCustomDateFormat(java.lang.String customDateFormat)
Description copied from interface: DateChooser
Set an optional date format if the default format for the current locale is not good. It is recommended to use the locale dependent format when possible. (e.g. 22.02.99 for DE and 99/22/92 for EN)
Together with setDateChooserDateFormat!! One has to set the format of the js datechoose which is differently specified, then the date formatting string of java.
Use a pattern that corresponds to the SimpleDateFormat patterns.

Specified by:
setCustomDateFormat in interface DateChooser

setValidDateCheck

public void setValidDateCheck(java.lang.String errorKey)
Specified by:
setValidDateCheck in interface DateChooser

setVisible

public void setVisible(boolean isVisible)
Description copied from interface: FormItem
item, label, example, error get not visible

Specified by:
setVisible in interface FormItem
Overrides:
setVisible in class FormItemImpl

setEnabled

public void setEnabled(boolean isEnabled)
Description copied from interface: FormItem
item is enabled/disabled, e.g. editable/read only in contrast to setVisible this does NOT DISABLE label, example, error!

Specified by:
setEnabled in interface FormItem
Overrides:
setEnabled in class FormItemImpl

getExampleDateString

public java.lang.String getExampleDateString()
Specified by:
getExampleDateString in interface DateChooser