com.arsdigita.bebop.form
Class Date

java.lang.Object
  extended bycom.arsdigita.bebop.Completable
      extended bycom.arsdigita.bebop.SimpleComponent
          extended bycom.arsdigita.bebop.TextStylable
              extended bycom.arsdigita.bebop.BlockStylable
                  extended bycom.arsdigita.bebop.form.Widget
                      extended bycom.arsdigita.bebop.form.Date
All Implemented Interfaces:
BebopConstants, Cloneable, Component, Lockable

public class Date
extends Widget
implements BebopConstants

A class representing a date field in an HTML form.

Version:
$Id: //core-platform/dev/src/com/arsdigita/bebop/form/Date.java#11 $
Author:
Karl Goldstein, Uday Mathur, Michael Pih

Nested Class Summary
protected  class Date.DayFragment
           
protected  class Date.MonthFragment
           
protected  class Date.YearFragment
           
 
Nested classes inherited from class com.arsdigita.bebop.form.Widget
Widget.ValidationGuard
 
Field Summary
protected  TextField m_day
           
protected  OptionGroup m_month
           
protected  OptionGroup m_year
           
static String versionId
           
 
Fields inherited from class com.arsdigita.bebop.BlockStylable
ABSBOTTOM, ABSMIDDLE, BASELINE, BOTTOM, CENTER, FULL_WIDTH, INSERT, LEFT, MIDDLE, RIGHT, TEXTTOP, TOP
 
Fields inherited from class com.arsdigita.bebop.SimpleComponent
m_attr
 
Fields inherited from interface com.arsdigita.bebop.util.BebopConstants
BEBOP_BORDER, BEBOP_BOXPANEL, BEBOP_CELL, BEBOP_CHECKBOX, BEBOP_CHECKBOXGROUP, BEBOP_COLUMNPANEL, BEBOP_DATE, BEBOP_DATETIME, BEBOP_DHTMLEDITOR, BEBOP_FORMERRORS, BEBOP_FORMWIDGET, BEBOP_GRIDPANEL, BEBOP_LIST, BEBOP_MULTISELECT, BEBOP_OPTION, BEBOP_PAD, BEBOP_PADFRAME, BEBOP_PANELROW, BEBOP_PORTAL, BEBOP_PORTLET, BEBOP_RADIO, BEBOP_RADIOGROUP, BEBOP_SEG_BODY, BEBOP_SEG_HEADER, BEBOP_SEG_PANEL, BEBOP_SEGMENT, BEBOP_SELECT, BEBOP_TABLE, BEBOP_TABLEBODY, BEBOP_TABLEROW, BEBOP_TEXTAREA
 
Fields inherited from interface com.arsdigita.bebop.Component
BEBOP_XML_NS, CLASS, ID, ON_CLICK, STYLE
 
Constructor Summary
Date(ParameterModel model)
          Construct a new Date.
Date(String name)
           
 
Method Summary
 void generateWidget(PageState ps, Element parent)
          Generates the DOM for the given widget
protected  String getElementTag()
          The XML tag for this derived class of Widget.
 Object getFragmentValue(PageState ps, int field)
           
 String getType()
          Returns a string naming the type of this widget.
 boolean isCompound()
          Returns true if the widget consists of multiple HTML elements.
 void setClassAttr(String at)
          Sets the class attribute.
 void setDisabled()
          Marks this widget as disabled, which has the effect of preventing the widget's value being submitted with the form, and will typically cause the widget to be 'grayed out' on the form.
 void setForm(Form f)
          Sets the Form Object for this Widget.
 void setMaxLength(int length)
          Sets the MAXLENGTH attribute for the INPUT tag used to render this form element.
 void setReadOnly()
          Marks this widget as readonly, which has the effect of preventing the user from modifying the widget's contents.
 void setYearRange(int startYear, int endYear)
           
 
Methods inherited from class com.arsdigita.bebop.form.Widget
addError, addError, addPrintListener, addValidationListener, clone, createParameterListener, firePrintEvent, fireValidation, generateErrors, generateXML, getDefaultValue, getErrors, getForm, getName, getParameterData, getParameterModel, getValue, isPassIn, register, removePrintListener, removeValidationListener, respond, setDefaultValue, setHint, setOnBlur, setOnChange, setOnFocus, setOnKeyUp, setOnSelect, setParameterModel, setPassIn, setPrintListener, setValidateInvisible, setValidationGuard, setValue, toString, validateInvisible
 
Methods inherited from class com.arsdigita.bebop.BlockStylable
setBorder, setBorder, setBorderColor, setHorizontalAlignment, setMargin, setMargin, setPadding, setPadding, setVerticalAlignment
 
Methods inherited from class com.arsdigita.bebop.TextStylable
setBackgroundColor, setColor
 
Methods inherited from class com.arsdigita.bebop.SimpleComponent
children, exportAttributes, getAttribute, getClassAttr, getIdAttr, getKey, getMetaDataAttribute, getStyleAttr, hasAttributes, isLocked, isVisible, lock, register, setAttribute, setIdAttr, setKey, setMetaDataAttribute, setStyleAttr, setVisible
 
Methods inherited from class com.arsdigita.bebop.Completable
addCompletionListener, fireCompletionEvent
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionId

public static final String versionId
See Also:
Constant Field Values

m_year

protected OptionGroup m_year

m_month

protected OptionGroup m_month

m_day

protected TextField m_day
Constructor Detail

Date

public Date(ParameterModel model)
Construct a new Date. The model must be a DateParameter


Date

public Date(String name)
Method Detail

setYearRange

public void setYearRange(int startYear,
                         int endYear)

getType

public String getType()
Returns a string naming the type of this widget.

Specified by:
getType in class Widget

setMaxLength

public void setMaxLength(int length)
Sets the MAXLENGTH attribute for the INPUT tag used to render this form element.


isCompound

public boolean isCompound()
Description copied from class: Widget
Returns true if the widget consists of multiple HTML elements.

Specified by:
isCompound in class Widget

getElementTag

protected String getElementTag()
The XML tag for this derived class of Widget.

Overrides:
getElementTag in class Widget
Returns:
The tag to be used for the top level DOM element generated for this type of Widget.

generateWidget

public void generateWidget(PageState ps,
                           Element parent)
Description copied from class: Widget
Generates the DOM for the given widget

Generates DOM fragment:

<bebop:formWidget name=... type=... value=... [onXXX=...]> </bebop:formWidget>

Overrides:
generateWidget in class Widget

setDisabled

public void setDisabled()
Description copied from class: Widget
Marks this widget as disabled, which has the effect of preventing the widget's value being submitted with the form, and will typically cause the widget to be 'grayed out' on the form. This method can only be called on unlocked widgets.

Overrides:
setDisabled in class Widget

setReadOnly

public void setReadOnly()
Description copied from class: Widget
Marks this widget as readonly, which has the effect of preventing the user from modifying the widget's contents. This method can only be called on unlocked widgets.

Overrides:
setReadOnly in class Widget

setForm

public void setForm(Form f)
Sets the Form Object for this Widget. This method will throw an exception if the _form pointer is already set. To explicity change the _form pointer the developer must first call setForm(null)

Overrides:
setForm in class Widget
Parameters:
f - The Form Object for this Widget
Throws:
IllegalStateException - if form already set.

getFragmentValue

public Object getFragmentValue(PageState ps,
                               int field)

setClassAttr

public void setClassAttr(String at)
Description copied from class: SimpleComponent
Sets the class attribute.

Specified by:
setClassAttr in interface Component
Overrides:
setClassAttr in class SimpleComponent
Parameters:
at - a valid XML name


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 20 2004:2337 UTC