jacquard 1.12.0 by The Web Engineering Factory and Toolworks

uk.co.weft.htform
Class DateWidget

java.lang.Object
  extended byuk.co.weft.htform.ResourceConsumerImpl
      extended byuk.co.weft.domutil.NodeGeneratorImpl
          extended byuk.co.weft.htform.Widget
              extended byuk.co.weft.htform.TimeStampWidget
                  extended byuk.co.weft.htform.DateWidget
All Implemented Interfaces:
java.lang.Cloneable, NodeGenerator, ResourceConsumer
Direct Known Subclasses:
CalendarPseudoWidget

public class DateWidget
extends TimeStampWidget
implements NodeGenerator

A composite widget set up to handle dates. Shows a typein box for day, drop-down for month, typein box for year, and (if JavaScript available) a button which pops up a little calendar view from which you can select the date by browsing. Date handling in Java is bizarrely awkward and obscure...

Version:
$Revision: 1.32.4.6 $ This revision: $Author: simon $
Author:
Simon Brooke

Field Summary
 
Fields inherited from class uk.co.weft.htform.TimeStampWidget
allowUnset, AMPMSUFFIX, DAYSUFFIX, DEFAULTSECONDS, HOURSUFFIX, maxYear, MINUTESUFFIX, minYear, monthname, MONTHSUFFIX, nullMarker, SECONDSUFFIX, showAmPm, showDayWidget, showSecWidget, showYearWidget, YEARSUFFIX
 
Fields inherited from class uk.co.weft.htform.Widget
ACTIONCSSCLASS, akprompt, attrs, CONTEXTATTRIBUTESSUFFIX, cssClass, DANGEROUSCSSCLASS, debug, DEFAULTTOKEN, dflt, form, generateAs, GENERATEASHTML, GENERATEASXFORM, GENERATEASXML, help, HELPTOKEN, immutable, ISIMMUTABLETOKEN, ISMANDATORYTOKEN, mandatory, MANDATORYCSSCLASS, maxVisibleSize, name, NAMETOKEN, OPTIONALCSSCLASS, PREVIOUSVALUESUFFIX, prompt, PROMPTTOKEN, size, SIZETOKEN, type, TYPETOKEN
 
Fields inherited from class uk.co.weft.domutil.NodeGeneratorImpl
namespaceURI
 
Fields inherited from class uk.co.weft.htform.ResourceConsumerImpl
resourceBundleName
 
Fields inherited from interface uk.co.weft.domutil.NodeGenerator
NAMESPACEURIMAGICTOKEN
 
Fields inherited from interface uk.co.weft.htform.ResourceConsumer
RESOURCEBUNDLEMAGICTOKEN
 
Constructor Summary
DateWidget()
           
DateWidget(java.lang.String name)
           
DateWidget(java.lang.String myname, java.lang.String myprompt, java.lang.String myhelp)
           
DateWidget(java.lang.String myname, java.lang.String myprompt, java.lang.String myhelp, boolean mute)
           
 
Method Summary
 Node generateInnerHTML(Document doc, Context context)
          Generate a node representing the XHTML 1.0 representation of just this widget, without prompt, helptext or any accompanying guff, but including JavaScript support if necessary (in which case the element returned will be a span).
 int getTabPlaces(Context context)
          Specialisation: I'm on the date part
 int getWidth(Context context)
          Specialisation: I'm only the date part
 void layout(Context context, int tabIndex)
          Specialisation: I'm only the date part
protected  void layoutValue(Context context)
          Specialisation: I'm only the date part
protected  void preProcess(Context context)
          Specialisation: I'm only the date part
 java.lang.String scriptRequest(Context context)
          Specialisation: I'm only the date part
 
Methods inherited from class uk.co.weft.htform.TimeStampWidget
getDateTabPlaces, getTimeTabPlaces, layoutDatePart, layoutDatePart, layoutDateValue, layoutTimePart, layoutTimePart, layoutTimeValue, onloadRequest, postProcess, preProcessDate, preProcessTime
 
Methods inherited from class uk.co.weft.htform.Widget
clone, generate, generateAttributes, generateAttributes, generateHTML, generateHTMLPrompt, generateValue, generateXML, getContextAttribute, getCssClass, getHeight, getHelp, getName, getPrompt, getType, init, layout, layout, layout, layoutAttribute, layoutAttributes, makeReady, maybeLayout, maybeLayout, onloadRequest, scriptRequest, setAttribute, setContextAttribute, setCssClass, setDebug, setDefault, setHelp, setImmutable, setMandatory, setMandatory, setName, setPrompt, setSize, setType
 
Methods inherited from class uk.co.weft.domutil.NodeGeneratorImpl
getNamespaceURI, setNamespaceURI
 
Methods inherited from class uk.co.weft.htform.ResourceConsumerImpl
getContextOrResource, getResource, getResourceOrContext, getResourceString, grs, grs
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.co.weft.domutil.NodeGenerator
generate, getName, getNamespaceURI, init, setDebug
 

Constructor Detail

DateWidget

public DateWidget()

DateWidget

public DateWidget(java.lang.String myname,
                  java.lang.String myprompt,
                  java.lang.String myhelp,
                  boolean mute)
Parameters:
myname -
myprompt -
myhelp -
mute -

DateWidget

public DateWidget(java.lang.String myname,
                  java.lang.String myprompt,
                  java.lang.String myhelp)
Parameters:
myname -
myprompt -
myhelp -

DateWidget

public DateWidget(java.lang.String name)
Parameters:
name -
Method Detail

generateInnerHTML

public Node generateInnerHTML(Document doc,
                              Context context)
                       throws GenerationException
Generate a node representing the XHTML 1.0 representation of just this widget, without prompt, helptext or any accompanying guff, but including JavaScript support if necessary (in which case the element returned will be a span). Essentially this method is the Jacquard 2 replacement for Widget.layout(), q.v. When specialising you almost certainly want to specialise this and not generateHTML, q.v.

Overrides:
generateInnerHTML in class Widget
Parameters:
doc - the document whithin which I am to be created
context - the context in which I am to be created.
Returns:
an element representing either the INPUT element itself or a SPAN element containing the INPUT element and any other functionally supporting stuff (SCRIPTs, other INPUTs, APPLETs etc
Throws:
GenerationException
See Also:
layout(uk.co.weft.dbutil.Context, int), Widget.generateHTML(org.w3c.dom.Document, uk.co.weft.dbutil.Context)

getTabPlaces

public int getTabPlaces(Context context)
Specialisation: I'm on the date part

Overrides:
getTabPlaces in class TimeStampWidget
Parameters:
context - the service context
Returns:
the number of tab places I occupy
See Also:
TimeStampWidget.getTabPlaces(uk.co.weft.dbutil.Context)

getWidth

public int getWidth(Context context)
Specialisation: I'm only the date part

Overrides:
getWidth in class TimeStampWidget
Parameters:
context - the service context
Returns:
my desired width in characters
See Also:
TimeStampWidget.getWidth(uk.co.weft.dbutil.Context)

layout

public void layout(Context context,
                   int tabIndex)
            throws java.io.IOException,
                   DataStoreException
Specialisation: I'm only the date part

Overrides:
layout in class TimeStampWidget
Parameters:
context - the service context
tabIndex - the tabindex to use, ot the tab index of my first sub-widget if I have more than one
Throws:
DataStoreException - I don't, but things which specialise me may
javax.servlet.ServletException - I don't, but things which specialise me may
java.io.IOException - if can't write to the output stream
See Also:
TimeStampWidget.layout(uk.co.weft.dbutil.Context,int)

layoutValue

protected void layoutValue(Context context)
                    throws DataFormatException,
                           javax.servlet.ServletException,
                           java.io.IOException
Specialisation: I'm only the date part

Overrides:
layoutValue in class TimeStampWidget
Parameters:
context - the service context
Throws:
DataFormatException
javax.servlet.ServletException
java.io.IOException
See Also:
TimeStampWidget.layoutValue(uk.co.weft.dbutil.Context)

preProcess

protected void preProcess(Context context)
                   throws DataStoreException,
                          javax.servlet.ServletException
Specialisation: I'm only the date part

Overrides:
preProcess in class TimeStampWidget
Parameters:
context - the service context
Throws:
DataStoreException
javax.servlet.ServletException
See Also:
TimeStampWidget.preProcess(uk.co.weft.dbutil.Context)

scriptRequest

public java.lang.String scriptRequest(Context context)
                               throws java.lang.Exception
Specialisation: I'm only the date part

Overrides:
scriptRequest in class TimeStampWidget
Parameters:
context - the service context
Returns:
Throws:
java.lang.Exception
See Also:
TimeStampWidget.scriptRequest(uk.co.weft.dbutil.Context)

jacquard 1.12.0 by The Web Engineering Factory and Toolworks