|
||||||||||
Previous class Next class | Frames No frames | |||||||||
Overview: Nested | Field | Constructor | Method | Details: Field | Constructor | Method |
java.lang.Objectjavax.servlet.jsp.tagext.TagSupport
jp.terasoluna.fw.web.taglib.InputCalendarTag
public class InputCalendarTag
Calendar input function for entering the selected date for the specified field.
Seetings of calendar input function can be changed by describing the following items into message resource file.
Message resource file name is considered to be fixed as "calendar".
Ex: "calendar.properties". "calendar_en.properties"
Functional details | Calendar hoilidays can be specified by giving the following description in message resource file. In message resource key "calendar.holiday." part is fixed and thereafter, the serial number is assigned from "1". In parameter, "Month", "Date" and "Holiday Summary" should be separated by comma. Specify "0" in the "Year" parameter in case of the hoilday which is defined on the same date of every year. Specifying "0" in "Year" parameter is recognized as every year. |
Configuration example |
calendar.holiday.1=0,1,1,New year's Day calendar.holiday.2=0,2,11,National Foundation Day calendar.holiday.3=0,4,29,Day of Showa calendar.holiday.4=0,5,3,Constitution Memorial Day calendar.holiday.5=0,5,4,Greenery Day calendar.holiday.6=0,5,5,Children's Day calendar.holiday.7=0,11,3,Culture Day calendar.holiday.8=0,11,23,Labor Thanksgiving Day calendar.holiday.9=0,12,23,The Emperor's Birthday calendar.holiday.10=2009,1,12,Coming-of-Age Day calendar.holiday.11=2009,3,20,Vernal Equinox Day calendar.holiday.12=2009,7,20,Marine Day calendar.holiday.13=2009,9,21,Senior Citizen's Day calendar.holiday.14=2009,9,23,Autumnal Equinox Day calendar.holiday.15=2009,10,12,National Sports Day : |
Functional Details | String of button which displays the calendar can be changed by providing the following description in the message resource file. Message resource key is fixed as "calendar.button.string". Default is "Calendar". |
Configuration example | calendar.button.string=Calendar |
Functional Details |
Prefix of the style sheet used in the calendar and the prefix
of image file can be changed by providing the following description
in the message resource file.
Message resource key is considered to be fixed as "calendar.style.themeprefix". Default is "BlueStyle". |
Configuration example | calendar.style.themeprefix=BlueStyle |
Functional details |
String assigned to the current date which is displayed at the bottom
of the calendar, can be changed by providing the following
description in the message resource file.
Message resource key is considered to be fixed as "calendar.today.string". Default is "Today is". |
Configuration example | calendar.today.string=Today is |
Functional details |
The storage location of the image which is used in the calendar input function,
can be changed by providing the following description in the message
resource file.
It should end with "/".
Storgae location of image can be changed.However, the name of the image file cannot be changed.
Message resource key is considered to be fixed as "calendar.img.dir". Default is "img/calendar/". |
Configuration example | calendar.img.dir=image/ |
Functional details |
The storage location of style sheet which is used in calendar input
function, can be changed by providing the following description
in the message resource file.It should end with "/".
File name of style sheet used in this function is
" Message resource key is considered to be fixed as "calendar.stylesheet.dir". Default is "css/". |
Configuration example | calendar.stylesheet.dir=style/ |
Functional details |
The storage location of external JavaScript which is used in calendar input
function, can be changed by providing the following description
in the message resource file. It should end with "/".
The file name of JavaScript used in this function is
"InputCalendar.js".
Message resource key is considered to be fixed as "calendar.javascript.dir". Default is "js/". |
Configuration example | calendar.javascript.dir=javascript/ |
Provide the following description for the input field. Specify the name of the target input field in the "for" attribute of calendar input function. In the following example, "property" attribute of "text" element becomes the name of input field. Therefore, the value same as "property" attribute of "text" element is specified in "for" attribute.
<html:text property="value" />
<t:inputCalendar for="value" format="yyyy-MM-dd" />
Calendar input function supports the following attribute.
Attribute name | Default value | Required | Execution time format | Overview |
for |
- |
true |
true |
Specify the input field wherein selected date is entered. |
format |
yyyy/MM/dd |
false |
true |
Specify the calendar format. Date format could be specified as "y(year), "M(Month" and "d(date)" and seperator could be any among the "/", "-", "." and "half-width space". Only a single character should be used as a separator. Multiple separators cannot be used like "yyyy/MM-dd". |
formatKey |
- |
false |
true |
Specify the key value to fetch the calendar format from the message resource. |
Field Summary | |
---|---|
protected static java.lang.String |
CALENDAR_BUTTON_VALUE
Key to fetch the button display string which is used in the calendar input function, from the message resource. |
protected static java.lang.String |
CALENDAR_DEFAULT_BUTTON_VALUE
Default calendar button display string. |
protected static java.lang.String |
CALENDAR_DEFAULT_FORMAT
default format. |
protected static java.lang.String |
CALENDAR_DEFAULT_IMAGE_PATH
Default image storage location path. |
protected static java.lang.String |
CALENDAR_DEFAULT_JAVASCRIPT_DIR
Default calendar external JavaScript storage location. |
protected static java.lang.String |
CALENDAR_DEFAULT_STYLEPREFIX_NAME
Default style prefix name. |
protected static java.lang.String |
CALENDAR_DEFAULT_STYLESHEET_DIR
Default style sheet storage location. |
protected static java.lang.String |
CALENDAR_HOLIDAY_PREFIX
Key to fetch the holiday definition information which is used in calendar input function, from the mesage resource. |
protected static java.lang.String |
CALENDAR_IMG_DIR
Key to fetch the calendar image storage location which is used in calendar input function, from the message resource. |
protected static java.lang.String |
CALENDAR_JAVASCRIPT_DIR
Key to fetch the calendar external JavaScript storage location which is used in calendar input function, from message resource. |
protected static java.lang.String |
CALENDAR_JAVASCRIPT_FILE_NAME
File name of JavaScript which is used in calendar input function. |
protected static java.lang.String |
CALENDAR_STYLE_THEMEPREFIX
Key to fetch the style prefix which is used in calendar input function, from the message resource. |
protected static java.lang.String |
CALENDAR_STYLESHEET_DIR
;Key to fetch the style sheet storage location which is used in calendar input function, from the message resource. |
protected static java.lang.String |
CALENDAR_STYLESHEET_FILE_NAME
File name (without prefix) of the style sheet which is used in calendar input function. |
protected static java.lang.String |
CALENDAR_TODAY_STRING
Key to fetch the string assigned to current date which is used in calendar input function, from the message resource. |
private java.lang.String |
forId
Attribute specifying target text field. |
private java.lang.String |
format
Attribute specifying the format. |
protected static java.lang.String |
FORMAT_VALUE
Corresponding format string group. |
private java.lang.String |
formatKey
Attribute specifying format key. |
protected static java.lang.String |
INPUTCALENDAR_FLG
Output status flag key. |
private static long |
serialVersionUID
Serial version ID |
Field inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Field inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Field inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
InputCalendarTag()
|
Method Summary | |
---|---|
protected java.lang.String |
createFormat(java.lang.String format)
Thouroughly check the date format for the argument string. |
protected java.lang.String |
defineArrayVariable(java.lang.String arrayName,
java.lang.String[] array)
Converts the array, passed as an argument, to type Array of JavaScript and returns. |
protected void |
defineButton(java.util.ResourceBundle calendarBundle)
Output the button to display the calendar screen. |
protected void |
defineJavaScript(java.util.ResourceBundle calendarBundle)
Output the defined part of JavaScript. |
protected java.lang.String |
defineObjectVariable(java.lang.String name,
java.lang.String value)
Returns the value, which is passed as an argument, as the Object declaration of JavaScript . |
protected java.lang.String |
defineStringVariable(java.lang.String name,
java.lang.String value)
Returns the value, which is passed as an argument, as the String declaration of
JavaScript . |
int |
doStartTag()
Method which is called while starting the tag evaluation. |
java.lang.String |
getFor()
Return the value of attribute specifying target textfield. |
java.lang.String |
getFormat()
Return the value of attribute specifying the format. |
java.lang.String |
getFormatKey()
Return the value of attribute specifying format key. |
protected java.util.List<java.util.Map<java.lang.String,java.lang.String>> |
getHolidayList(java.util.ResourceBundle calendarBundle)
Fetch the holiday definition which is defined in message resource. |
protected boolean |
getPageContextFlg(javax.servlet.jsp.PageContext pageContext,
java.lang.String key)
Convert the value which is fetched by the specified KEY into true-value and return. |
protected java.lang.String |
getParameter(java.util.ResourceBundle calendarBundle,
java.lang.String key,
java.lang.String def)
Fetch the value based on the key from the message resource and return. |
protected java.lang.String[] |
mapMonths(java.text.DateFormatSymbols symbols)
Fetch the "Month" from the specififed date format symbol and return. |
protected java.lang.String[] |
mapWeekdays(java.text.DateFormatSymbols symbols)
Fetch the "Day" from the specified date format symbol and return. |
void |
release()
Release all allocated resources. |
void |
setFor(java.lang.String forId)
Set the value of attribute specifying target text field. |
void |
setFormat(java.lang.String format)
Set the value of attribute specifying the format. |
void |
setFormatKey(java.lang.String formatKey)
Set the value of attribute specifying format key. |
protected void |
setPageContextFlg(javax.servlet.jsp.PageContext pageContext,
java.lang.String key)
Set the flag of the specified KEY for page context. |
Method which is inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
ethod which is inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Details |
---|
private static final long serialVersionUID
private java.lang.String forId
private java.lang.String format
private java.lang.String formatKey
protected static final java.lang.String CALENDAR_IMG_DIR
protected static final java.lang.String CALENDAR_TODAY_STRING
protected static final java.lang.String CALENDAR_BUTTON_VALUE
protected static final java.lang.String CALENDAR_STYLE_THEMEPREFIX
protected static final java.lang.String CALENDAR_STYLESHEET_DIR
protected static final java.lang.String CALENDAR_JAVASCRIPT_DIR
protected static final java.lang.String CALENDAR_HOLIDAY_PREFIX
protected static final java.lang.String CALENDAR_DEFAULT_FORMAT
protected static final java.lang.String CALENDAR_DEFAULT_STYLEPREFIX_NAME
protected static final java.lang.String CALENDAR_DEFAULT_IMAGE_PATH
protected static final java.lang.String CALENDAR_DEFAULT_BUTTON_VALUE
protected static final java.lang.String CALENDAR_DEFAULT_STYLESHEET_DIR
protected static final java.lang.String CALENDAR_DEFAULT_JAVASCRIPT_DIR
protected static final java.lang.String CALENDAR_JAVASCRIPT_FILE_NAME
protected static final java.lang.String CALENDAR_STYLESHEET_FILE_NAME
protected static final java.lang.String INPUTCALENDAR_FLG
protected static final java.lang.String FORMAT_VALUE
Constructor Details |
---|
public InputCalendarTag()
Method Details |
---|
public java.lang.String getFor()
public void setFor(java.lang.String forId)
forId
- Value to be setpublic java.lang.String getFormat()
public void setFormat(java.lang.String format)
format
- Value to be setpublic java.lang.String getFormatKey()
public void setFormatKey(java.lang.String formatKey)
formatKey
- Value to be setpublic int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
- JSP exceptionprotected void defineJavaScript(java.util.ResourceBundle calendarBundle) throws javax.servlet.jsp.JspException
calendarBundle
- Resource bundle for calendar input function
javax.servlet.jsp.JspException
- JSP exceptionprotected java.util.List<java.util.Map<java.lang.String,java.lang.String>> getHolidayList(java.util.ResourceBundle calendarBundle)
calendarBundle
- Resource bundle for the calendar input function
protected void defineButton(java.util.ResourceBundle calendarBundle) throws javax.servlet.jsp.JspException
calendarBundle
- Resource bundle for calendar input function
javax.servlet.jsp.JspException
- JSP exceptonprotected java.lang.String getParameter(java.util.ResourceBundle calendarBundle, java.lang.String key, java.lang.String def)
calendarBundle
- Resource bundle for calendar input functionkey
- Key of message resourcedef
- Default value
protected java.lang.String defineStringVariable(java.lang.String name, java.lang.String value)
String
declaration of JavaScript
. kanji
", Value "Kanji"->
"var kanji = "Kanji";\n
".
name
- Variable name declared by JavaScript
value
- Value of variable
protected java.lang.String defineObjectVariable(java.lang.String name, java.lang.String value)
Object
declaration of JavaScript
.obj1
",
value "document.forms[0]
"
-> var obj1 = document.forms[0];\n
".
name
- Variable name declared by JavaScript
value
- Value of variable
protected java.lang.String defineArrayVariable(java.lang.String arrayName, java.lang.String[] array)
Array
of JavaScript
and return. array
", Value"10,20,30
"
->"var obj1 = new Array("10","20","30");\n
"
arrayName
- Variable name declared by JavaScript
array
- Array that retains the value which is created as Array
protected java.lang.String[] mapWeekdays(java.text.DateFormatSymbols symbols)
symbols
- Date format symbol (Locale settings done)
protected java.lang.String[] mapMonths(java.text.DateFormatSymbols symbols)
symbols
- Date format symbol(Locale setting done)
protected boolean getPageContextFlg(javax.servlet.jsp.PageContext pageContext, java.lang.String key)
pageContext
- Page contextkey
- KEY that fetches FLG
protected void setPageContextFlg(javax.servlet.jsp.PageContext pageContext, java.lang.String key)
pageContext
- Page contextkey
- KEY that sets FLGprotected java.lang.String createFormat(java.lang.String format)
null
or blank, return it as it is.
When the string does not correspond to date format, ignore.
format
- Date format
public void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.TagSupport
|
||||||||||
Previous class Next class | Frames No frames | |||||||||
Overview: Nested | Field | Constructor | Method | Details: Field | Constructor | Method |