Class CalendarTag
java.lang.Object
jakarta.servlet.jsp.tagext.TagSupport
org.deltava.taglib.calendar.CalendarTag
- All Implemented Interfaces:
jakarta.servlet.jsp.tagext.IterationTag, jakarta.servlet.jsp.tagext.JspTag, jakarta.servlet.jsp.tagext.Tag, Serializable
- Direct Known Subclasses:
MonthlyCalendarTag, WeeklyCalendarTag
abstract class CalendarTag
extends jakarta.servlet.jsp.tagext.TagSupport
A JSP tag to display a calendar view table.
- Since:
- 1.0
- Version:
- 12.3
- Author:
- Luke
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected Stringprotected ZonedDateTimeprotected XMLRendererprotected Stringprotected ZonedDateTimeprotected final Collection<CalendarEntry> protected intprotected ChronoUnitprotected jakarta.servlet.jsp.JspWriterprotected booleanprotected ZonedDateTimeprotected XMLRendererprotected Stringprotected Stringprotected ZonedDateTimeprotected Stringprotected ZoneIdFields inherited from class jakarta.servlet.jsp.tagext.TagSupport
id, pageContextFields inherited from interface jakarta.servlet.jsp.tagext.IterationTag
EVAL_BODY_AGAINFields inherited from interface jakarta.servlet.jsp.tagext.Tag
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcalculateEndDate(ChronoUnit intervalType, int amount) Calculcates the end date based on the start date and a particular interval amount.intDetermines if we have further days to render in the calendar.intdoEndTag()Ends the Calendar tag by adding the scroll forward/backward link row.intStarts the Calendar tag by setting the current date to render.protected abstract StringReturns the label for the scroll backwards link.protected StringCalculates the CSS class(es) for the content table cell.(package private) Collection<CalendarEntry> Returns all Calendar entries for the currently rendered Date, from midnight to 11:59PM.protected abstract StringReturns the label for the scroll forwards linkprotected StringCalculates the CSS class(es) for the header table cell.voidrelease()voidsetBorder(int border) Sets the BORDER value for this table.voidSets the command name to use when scrolling the view.voidsetContentClass(String cName) Sets the CSS class name for the view table content bar.voidSets the request attribute name for the current date.voidsetDayBarClass(String cName) Sets the CSS class name for the view table day bar.final voidsetEntries(Collection<CalendarEntry> entries) Sets the entries to display in this calendar view table.voidsetPageContext(jakarta.servlet.jsp.PageContext ctx) Sets the page context for the tag, and sets the user's time zone.voidsetScrollClass(String cName) Sets the CSS class name for the forwad/backward scroll links.voidsetScrollTags(boolean showScroll) Sets whether to display the forward/backward scroll tags.voidsetShowDaysOfWeek(boolean showDOW) Sets whether the days of the week should be displayed below the title bar.abstract voidSets the start date of the data range.voidsetTableClass(String cName) Sets the CSS class name for the view table.voidsetTableID(String id) Sets the CSS ID for the view table.voidsetTopBarClass(String cName) Sets the CSS class name for the view table title bar.Methods inherited from class jakarta.servlet.jsp.tagext.TagSupport
findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setParent, setValue
-
Field Details
-
_out
protected jakarta.servlet.jsp.JspWriter _out -
_startDate
-
_endDate
-
_currentDate
-
_today
-
_tz
-
_entries
-
_tableID
-
_tableClass
-
_topBarClass
-
_dayBarClass
-
_contentClass
-
_border
protected int _border -
_showDaysOfWeek
protected boolean _showDaysOfWeek -
_table
-
_day
-
_intervalType
-
_intervalLength
protected int _intervalLength
-
-
Constructor Details
-
CalendarTag
CalendarTag()
-
-
Method Details
-
setStartDate
Sets the start date of the data range.- Parameters:
dt- the start date/time
-
getBackLabel
Returns the label for the scroll backwards link.- Returns:
- the link label
- See Also:
-
getForwardLabel
Returns the label for the scroll forwards link- Returns:
- the link label
- See Also:
-
getContentClass
Calculates the CSS class(es) for the content table cell.- Parameters:
dt- the cell date- Returns:
- a CSS class list
-
getHeaderClass
Calculates the CSS class(es) for the header table cell.- Parameters:
dt- the cell date- Returns:
- a CSS class list
-
calculateEndDate
Calculcates the end date based on the start date and a particular interval amount. This must be called by a subclass for the forward/backward links to work properly.- Parameters:
intervalType- the interval type (use Calendar constants)amount- the size of the interval- See Also:
-
setDate
Sets the request attribute name for the current date.- Parameters:
attrName- the request attribute name
-
setTableClass
Sets the CSS class name for the view table.- Parameters:
cName- the CSS class name
-
setTableID
-
setTopBarClass
Sets the CSS class name for the view table title bar.- Parameters:
cName- the CSS class name
-
setDayBarClass
Sets the CSS class name for the view table day bar.- Parameters:
cName- the CSS class name
-
setContentClass
Sets the CSS class name for the view table content bar.- Parameters:
cName- the CSS class name
-
setScrollClass
Sets the CSS class name for the forwad/backward scroll links.- Parameters:
cName- the CSS class name
-
setCmd
Sets the command name to use when scrolling the view.- Parameters:
cmdName- the command name
-
setShowDaysOfWeek
public void setShowDaysOfWeek(boolean showDOW) Sets whether the days of the week should be displayed below the title bar.- Parameters:
showDOW- TRUE if the days of the week should be displayed, otherwise FALSE
-
setScrollTags
public void setScrollTags(boolean showScroll) Sets whether to display the forward/backward scroll tags.- Parameters:
showScroll- TRUE if forward/back links are displayed, otherwise FALSE
-
setBorder
public void setBorder(int border) Sets the BORDER value for this table.- Parameters:
border- the border width attribute value
-
setEntries
Sets the entries to display in this calendar view table. Entries outside the table's date range will not be added.- Parameters:
entries- a Collection of CalendarEntry beans- See Also:
-
setPageContext
public void setPageContext(jakarta.servlet.jsp.PageContext ctx) Sets the page context for the tag, and sets the user's time zone.- Specified by:
setPageContextin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
setPageContextin classjakarta.servlet.jsp.tagext.TagSupport- Parameters:
ctx- the JSP page context
-
getCurrentEntries
Collection<CalendarEntry> getCurrentEntries()Returns all Calendar entries for the currently rendered Date, from midnight to 11:59PM.- Returns:
- a Collection of CalendarEntry beans
- See Also:
-
doAfterBody
public int doAfterBody() throws jakarta.servlet.jsp.JspExceptionDetermines if we have further days to render in the calendar. Subclasses are responsible for opening and closing the table cells.- Specified by:
doAfterBodyin interfacejakarta.servlet.jsp.tagext.IterationTag- Overrides:
doAfterBodyin classjakarta.servlet.jsp.tagext.TagSupport- Returns:
- EVAL_BODY_AGAIN if current date is before endDate, otherwise SKIP_BODY
- Throws:
jakarta.servlet.jsp.JspException- never
-
doStartTag
public int doStartTag() throws jakarta.servlet.jsp.JspExceptionStarts the Calendar tag by setting the current date to render. Subclasses are responsible for opening and closing the table cells.- Specified by:
doStartTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doStartTagin classjakarta.servlet.jsp.tagext.TagSupport- Returns:
- TagSupport.EVAL_BODY_INCLUDE always
- Throws:
jakarta.servlet.jsp.JspException- never
-
doEndTag
public int doEndTag() throws jakarta.servlet.jsp.JspExceptionEnds the Calendar tag by adding the scroll forward/backward link row. Subclasses are responsible for closing the current table row and closing the table.- Specified by:
doEndTagin interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
doEndTagin classjakarta.servlet.jsp.tagext.TagSupport- Returns:
- EVAL_PAGE always
- Throws:
jakarta.servlet.jsp.JspException- if an I/O error occurs
-
release
public void release()- Specified by:
releasein interfacejakarta.servlet.jsp.tagext.Tag- Overrides:
releasein classjakarta.servlet.jsp.tagext.TagSupport
-