com.ideo.sweetdevria.taglib.calendar
Class CalendarTag

java.lang.Object
  extended by javax.servlet.jsp.tagext.TagSupport
      extended by com.ideo.sweetdevria.taglib.AbstractTagDrawer
          extended by com.ideo.sweetdevria.taglib.AbstractComponentTagSupport
              extended by com.ideo.sweetdevria.taglib.BaseTagSupport
                  extended by com.ideo.sweetdevria.taglib.BaseLinkTagSupport
                      extended by com.ideo.sweetdevria.taglib.calendar.CalendarTag
All Implemented Interfaces:
Hideable, Hookable, IFrameable, IRiaTag, java.io.Serializable, javax.servlet.jsp.tagext.BodyTag, javax.servlet.jsp.tagext.IterationTag, javax.servlet.jsp.tagext.JspTag, javax.servlet.jsp.tagext.Tag

public class CalendarTag
extends BaseLinkTagSupport
implements IRiaTag, Hideable, Hookable, IFrameable

See Also:
Serialized Form

Field Summary
protected static java.lang.String BUILDER_ID
          Builder ID.
protected  java.util.List customDays
          CustomDay's list.
protected  java.util.List disabledDays
          DisabledDay's list.
protected  java.lang.Integer displayedMonths
          How many months are displayed ?
protected  java.lang.String field
          How are HTML INPUT field(s) displayed ?
static java.lang.String FIELD_EXPLODED
          Available mode for HTML INPUT fields : single : to use for simple mode only, one INPUT field is displayed, in wich user can type a date (by default), exploded : to use for simple mode only, 3 INPUT fields are displayed, 1 for month, 1 for day and 1 for year (It can be month-day-year or day-month-year according to locale), hidden : to use for simple, multiselect and range mode, a HIDDEN INPUT field is generated.
static java.lang.String FIELD_HIDDEN
          Available mode for HTML INPUT fields : single : to use for simple mode only, one INPUT field is displayed, in wich user can type a date (by default), exploded : to use for simple mode only, 3 INPUT fields are displayed, 1 for month, 1 for day and 1 for year (It can be month-day-year or day-month-year according to locale), hidden : to use for simple, multiselect and range mode, a HIDDEN INPUT field is generated.
static java.lang.String FIELD_SINGLE
          Available mode for HTML INPUT fields : single : to use for simple mode only, one INPUT field is displayed, in wich user can type a date (by default), exploded : to use for simple mode only, 3 INPUT fields are displayed, 1 for month, 1 for day and 1 for year (It can be month-day-year or day-month-year according to locale), hidden : to use for simple, multiselect and range mode, a HIDDEN INPUT field is generated.
static java.lang.String JS_PREFIX
          On HTML/JavaScript output, ID is concated with this prefix (because ID value is used for single / hidden fields).
protected  java.util.Date maxDate
          Maximal date wich can be selected.
protected  java.util.Date minDate
          Minimal date wich can be selected.
protected  java.lang.String mode
          Calendar mode.
static java.lang.String MODE_MULTISELECT
          Available mode for calendar : simple : allow user to select one date (by default), standAlone : display the calendar, whithout date selection, multiSelect : allow user to select multiple dates, range : allow user to select a period, composed of a begin date and an ending date.
static java.lang.String MODE_RANGE
          Available mode for calendar : simple : allow user to select one date (by default), standAlone : display the calendar, whithout date selection, multiSelect : allow user to select multiple dates, range : allow user to select a period, composed of a begin date and an ending date.
static java.lang.String MODE_SIMPLE
          Available mode for calendar : simple : allow user to select one date (by default), standAlone : display the calendar, whithout date selection, multiSelect : allow user to select multiple dates, range : allow user to select a period, composed of a begin date and an ending date.
static java.lang.String MODE_STANDALONE
          Available mode for calendar : simple : allow user to select one date (by default), standAlone : display the calendar, whithout date selection, multiSelect : allow user to select multiple dates, range : allow user to select a period, composed of a begin date and an ending date.
protected  java.lang.String originalId
           
protected  boolean popup
          Is the calendar displayed in a popup (DIV) ?
protected  java.util.Date[] preselect
          Preselected date(s).
protected  java.lang.String[] velocityLoopIds
          Velocity id used for multi-month loop.
 
Fields inherited from class com.ideo.sweetdevria.taglib.BaseLinkTagSupport
cancelBubble, titleLink
 
Fields inherited from class com.ideo.sweetdevria.taglib.BaseTagSupport
frameDisplayed, style, styleClass
 
Fields inherited from class com.ideo.sweetdevria.taglib.AbstractComponentTagSupport
bodyContent, rendered
 
Fields inherited from class com.ideo.sweetdevria.taglib.AbstractTagDrawer
builder, messageKeys, templateEnd, templateStart
 
Fields inherited from class javax.servlet.jsp.tagext.TagSupport
id, pageContext
 
Fields inherited from interface javax.servlet.jsp.tagext.BodyTag
EVAL_BODY_BUFFERED, EVAL_BODY_TAG
 
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAIN
 
Fields inherited from interface javax.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE
 
Constructor Summary
CalendarTag()
          Default constructor.
 
Method Summary
 int doStartTag()
          Default processing of the start tag.
 java.lang.String getBuilderId()
          Return the targeted builder id for this component as specified in the configuration file.
 java.util.List getCustomDays()
          Get custom days list.
 java.util.List getDisabledDays()
          Get disabled days list.
 java.lang.Integer getDisplayedMonths()
          How many month(s) should be displayed ?
 java.lang.String getField()
          Return calendar fields attribute.
 BaseTagSupport getHooker()
           
 java.util.Date getMaxDate()
          Get maximal date which can be selected.
 java.util.Date getMinDate()
          Get minimal date wich can be selected.
 java.lang.String getMode()
          Return calendar mode attribute.
 java.lang.String getOriginalId()
           
 java.util.Date[] getPreselect()
          Get preselected dates.
 java.util.Date getPreselectDate()
           
 java.lang.String getPreselectString()
           
 java.lang.String[] getPreselectStringArray()
           
 java.lang.String[] getVelocityLoopIds()
          Get an array of calendar(s) id, used by velocity.
 boolean isFrameDisplayed()
           
 boolean isPopup()
          Is the calendar displayed in a popup (DIV) ?
 void release()
          Release method which must call super.release !
 void setCustomDays(java.util.List customDays)
          Set custom days which will be displayed in a special CSS style and with a description text.
 void setDisabledDays(java.util.List disabledDays)
          Set disabled days which can't be selected in calendar.
 void setDisplayedMonths(java.lang.Integer displayedMonths)
          Set how many month(s) will be displayed.
 void setField(java.lang.String field)
          Set the field attribute from FIELD_SINGLE, FIELD_EXPLODED or FIELD_HIDDEN used to generate a single, 3 or an hidden INPUT field.
 void setFrameDisplayed(boolean toDisplay)
           
 void setId(java.lang.String id)
           
 void setMaxDate(java.util.Date maxDate)
          Set maximal date which can be selected.
 void setMinDate(java.util.Date minDate)
          Set minimal date wich can be selected.
 void setMode(java.lang.String mode)
          Set the calendar mode from MODE_SIMPLE, MODE_STANDALONE, MODE_MULTISELECT or MODE_RANGE.
 void setPageContext(javax.servlet.jsp.PageContext pageContext)
          Used by HTTP container.
 void setPopup(boolean popup)
          Open the calendar in a popup (DIV) ?
 void setPreselect(java.util.Date[] preselect)
          Set preselected dates.
 void setPreselectDate(java.util.Date preselect)
          Set preselected date.
 void setPreselectString(java.lang.String preselect)
          Set preselected date.
 void setPreselectStringArray(java.lang.String[] preselect)
          Set preselected date.
 
Methods inherited from class com.ideo.sweetdevria.taglib.BaseLinkTagSupport
getCancelBubble, getTitleLink, setCancelBubble, setTitleLink
 
Methods inherited from class com.ideo.sweetdevria.taglib.BaseTagSupport
addCssClass, addCssStyle, getStyle, getStyleClass, setStyle, setStyleClass
 
Methods inherited from class com.ideo.sweetdevria.taglib.AbstractComponentTagSupport
checkId, doAfterBody, doEndTag, doInitBody, getBodyContent, getId, isRendered, refractorContext, setBodyContent, setRendered
 
Methods inherited from class com.ideo.sweetdevria.taglib.AbstractTagDrawer
generateHtmlContent, getBuilder, getMessageKeys, getPageContext, getTemplateEnd, getTemplateStart, setTemplateEnd, setTemplateStart
 
Methods inherited from class javax.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getParent, getValue, getValues, removeValue, setParent, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ideo.sweetdevria.taglib.IRiaTag
doEndTag, getMessageKeys, getPageContext, getTemplateEnd, getTemplateStart, setTemplateEnd, setTemplateStart
 
Methods inherited from interface com.ideo.sweetdevria.taglib.Hideable
isRendered, setRendered
 
Methods inherited from interface javax.servlet.jsp.tagext.BodyTag
doInitBody, setBodyContent
 
Methods inherited from interface javax.servlet.jsp.tagext.IterationTag
doAfterBody
 
Methods inherited from interface javax.servlet.jsp.tagext.Tag
doEndTag, getParent, setParent
 

Field Detail

BUILDER_ID

protected static final java.lang.String BUILDER_ID
Builder ID.

See Also:
Constant Field Values

JS_PREFIX

public static final java.lang.String JS_PREFIX
On HTML/JavaScript output, ID is concated with this prefix (because ID value is used for single / hidden fields).

See Also:
Constant Field Values

MODE_SIMPLE

public static final java.lang.String MODE_SIMPLE
Available mode for calendar :

See Also:
Constant Field Values

MODE_STANDALONE

public static final java.lang.String MODE_STANDALONE
Available mode for calendar :

See Also:
Constant Field Values

MODE_MULTISELECT

public static final java.lang.String MODE_MULTISELECT
Available mode for calendar :

See Also:
Constant Field Values

MODE_RANGE

public static final java.lang.String MODE_RANGE
Available mode for calendar :

See Also:
Constant Field Values

FIELD_SINGLE

public static final java.lang.String FIELD_SINGLE
Available mode for HTML INPUT fields :

See Also:
Constant Field Values

FIELD_EXPLODED

public static final java.lang.String FIELD_EXPLODED
Available mode for HTML INPUT fields :

See Also:
Constant Field Values

FIELD_HIDDEN

public static final java.lang.String FIELD_HIDDEN
Available mode for HTML INPUT fields :

See Also:
Constant Field Values

mode

protected java.lang.String mode
Calendar mode.


popup

protected boolean popup
Is the calendar displayed in a popup (DIV) ?


field

protected java.lang.String field
How are HTML INPUT field(s) displayed ?


displayedMonths

protected java.lang.Integer displayedMonths
How many months are displayed ?


velocityLoopIds

protected java.lang.String[] velocityLoopIds
Velocity id used for multi-month loop.


preselect

protected java.util.Date[] preselect
Preselected date(s).


disabledDays

protected java.util.List disabledDays
DisabledDay's list.


customDays

protected java.util.List customDays
CustomDay's list.


minDate

protected java.util.Date minDate
Minimal date wich can be selected.


maxDate

protected java.util.Date maxDate
Maximal date wich can be selected.


originalId

protected java.lang.String originalId
Constructor Detail

CalendarTag

public CalendarTag()
Default constructor.

Method Detail

release

public void release()
Description copied from interface: IRiaTag
Release method which must call super.release !

Specified by:
release in interface IRiaTag
Specified by:
release in interface javax.servlet.jsp.tagext.Tag
Overrides:
release in class BaseLinkTagSupport
See Also:
IRiaTag.release()

setPageContext

public void setPageContext(javax.servlet.jsp.PageContext pageContext)
Description copied from interface: IRiaTag
Used by HTTP container. We should release tag here.

Specified by:
setPageContext in interface IRiaTag
Specified by:
setPageContext in interface javax.servlet.jsp.tagext.Tag
Overrides:
setPageContext in class AbstractTagDrawer
See Also:
com.ideo.sweetdevria.taglib.AbstractComponentTagSupport#setPageContext(final PageContext pageContext)

getBuilderId

public java.lang.String getBuilderId()
Description copied from interface: IRiaTag
Return the targeted builder id for this component as specified in the configuration file.

Specified by:
getBuilderId in interface IRiaTag
Specified by:
getBuilderId in class AbstractTagDrawer
Returns:
id targeted builder id
See Also:
AbstractTagDrawer.getBuilderId()

doStartTag

public int doStartTag()
               throws javax.servlet.jsp.JspException
Description copied from interface: IRiaTag
Default processing of the start tag.

Specified by:
doStartTag in interface IRiaTag
Specified by:
doStartTag in interface javax.servlet.jsp.tagext.Tag
Overrides:
doStartTag in class AbstractComponentTagSupport
Returns:
EVAL_BODY_AGAIN, EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY or SKIP_PAGE.
Throws:
javax.servlet.jsp.JspException
See Also:
IRiaTag.doStartTag()

setId

public void setId(java.lang.String id)
Overrides:
setId in class AbstractComponentTagSupport
See Also:
com.ideo.sweetdevria.taglib.AbstractComponentTagSupport#setId(final String id)

getOriginalId

public java.lang.String getOriginalId()

getMode

public java.lang.String getMode()
Return calendar mode attribute.

Returns:
calendar mode : MODE_SIMPLE, MODE_STANDALONE, MODE_MULTISELECT or MODE_RANGE.

setMode

public void setMode(java.lang.String mode)
Set the calendar mode from MODE_SIMPLE, MODE_STANDALONE, MODE_MULTISELECT or MODE_RANGE.

Parameters:
mode - MODE_SIMPLE, MODE_STANDALONE, MODE_MULTISELECT or MODE_RANGE

getField

public java.lang.String getField()
Return calendar fields attribute.

Returns:
FIELD_SINGLE, FIELD_EXPLODED or FIELD_HIDDEN.

setField

public void setField(java.lang.String field)
Set the field attribute from FIELD_SINGLE, FIELD_EXPLODED or FIELD_HIDDEN used to generate a single, 3 or an hidden INPUT field.

Parameters:
field - FIELD_SINGLE, FIELD_EXPLODED or FIELD_HIDDEN.

isPopup

public boolean isPopup()
Is the calendar displayed in a popup (DIV) ?

Returns:
If yes, true, else false.

setPopup

public void setPopup(boolean popup)
Open the calendar in a popup (DIV) ?

Parameters:
popup - If yes, true, else false.

getDisplayedMonths

public java.lang.Integer getDisplayedMonths()
How many month(s) should be displayed ?

Returns:
Month(s) number wich will be displayed.

setDisplayedMonths

public void setDisplayedMonths(java.lang.Integer displayedMonths)
Set how many month(s) will be displayed.

Parameters:
displayedMonths - how many month(s) will be displayed.

getPreselect

public java.util.Date[] getPreselect()
Get preselected dates.

Returns:
preselected dates.

setPreselect

public void setPreselect(java.util.Date[] preselect)
Set preselected dates.

Parameters:
preselect - preselected dates.

setPreselectDate

public void setPreselectDate(java.util.Date preselect)
Set preselected date.

Parameters:
preselect - preselected date.

getPreselectDate

public java.util.Date getPreselectDate()

setPreselectString

public void setPreselectString(java.lang.String preselect)
Set preselected date.

Parameters:
preselect - preselected date.

getPreselectString

public java.lang.String getPreselectString()

setPreselectStringArray

public void setPreselectStringArray(java.lang.String[] preselect)
Set preselected date.

Parameters:
preselect - preselected date.

getPreselectStringArray

public java.lang.String[] getPreselectStringArray()

getDisabledDays

public java.util.List getDisabledDays()
Get disabled days list.

Returns:
List of DisabledDay

setDisabledDays

public void setDisabledDays(java.util.List disabledDays)
Set disabled days which can't be selected in calendar.

Parameters:
disabledDays - DisabledDay's list.

getCustomDays

public java.util.List getCustomDays()
Get custom days list.

Returns:
List of CustomDay

setCustomDays

public void setCustomDays(java.util.List customDays)
Set custom days which will be displayed in a special CSS style and with a description text.

Parameters:
customDays - CustomDay's list.

getVelocityLoopIds

public java.lang.String[] getVelocityLoopIds()
Get an array of calendar(s) id, used by velocity.

Returns:
array of calendar(s) id.

getMaxDate

public java.util.Date getMaxDate()
Get maximal date which can be selected.

Returns:
Maximal date.

setMaxDate

public void setMaxDate(java.util.Date maxDate)
Set maximal date which can be selected.

Parameters:
maxDate - Maximal date.

getMinDate

public java.util.Date getMinDate()
Get minimal date wich can be selected.

Returns:
Minimal date.

setMinDate

public void setMinDate(java.util.Date minDate)
Set minimal date wich can be selected.

Parameters:
minDate - Minimal date.

getHooker

public BaseTagSupport getHooker()
Specified by:
getHooker in interface Hookable
Returns:
the hooker for this component

isFrameDisplayed

public boolean isFrameDisplayed()
Specified by:
isFrameDisplayed in interface IFrameable

setFrameDisplayed

public void setFrameDisplayed(boolean toDisplay)
Specified by:
setFrameDisplayed in interface IFrameable


Copyright © 2010 Ideo Technologies. All Rights Reserved.