public class Calendars
extends org.zkoss.zul.impl.XulElement
The Calendars component allows only one single toolbar as its child component, and now it can
only manipulate the calendar item by a model named CalendarModel
. And there
are three events, onItemCreate
, onItemEdit
, and
onItemUpdate
that can be listened to operate the calendar event
triggering by user action, in addition to there are two events onDayClick
and
onWeekClick
to be triggered when user clicks on the caption of
the day number and the week number within the current year. Besides,
the calendar can also support the read-only
display by invoking setReadonly(boolean)
.
Constructor and Description |
---|
Calendars() |
Modifier and Type | Method and Description |
---|---|
void |
addDayItem(CalendarItem ce) |
void |
addTimeZone(java.lang.String label,
java.lang.String timezone)
Adds the time zone to the calendar.
|
void |
addTimeZone(java.lang.String label,
java.util.TimeZone timezone)
Adds the time zone to the calendar.
|
java.lang.Object |
clone() |
java.util.Date |
getBeginDate()
Returns the beginning date, which is based on
getCurrentDate() in
the current view depended on which AbstractComponent.getMold() is using. |
int |
getBeginTime() |
CalendarItem |
getCalendarItemById(java.lang.String id) |
java.lang.String |
getCalendarItemId(CalendarItem ce) |
java.util.Date |
getCurrentDate()
Returns the current date.
|
DateFormatter |
getDateFormatter()
Returns the date formatter.
|
int |
getDays()
Returns the days.
|
java.util.TimeZone |
getDefaultTimeZone()
Returns the current time zone of the calendar.
|
java.util.Date |
getEndDate()
Returns the end date, which is based on
getCurrentDate() in the
current view depended on which AbstractComponent.getMold() is using. |
int |
getEndTime() |
int |
getFirstDayOfWeek()
Gets what the first day of the week is; e.g.,
SUNDAY in the
U.S., MONDAY in France. |
java.util.List<CalendarItem> |
getItem(java.util.Date beginDate)
Returns the unmodifiable list including all the calendar items matching
from the specified date in the same date.
|
protected java.lang.String |
getItemKey(CalendarItem evt) |
ItemRender |
getItemRender()
Deprecated.
As of release 2.0-RC
Returns the item renderer used for
CalendarItem to draw its
outline (i.e. HTML), like the DSP renderer of ZK component.
Note: never null. |
CalendarModel |
getModel()
Returns the calendar model.
|
int |
getTimeslots() |
java.util.Map<java.util.TimeZone,java.lang.String> |
getTimeZones()
Returns the unmodifiable map including all the timezone inside the
calendar.
|
org.zkoss.zul.Toolbar |
getToolbar() |
int |
getWeekOfMonth()
Returns the number of the week of the month in the current date.
|
java.lang.String |
getZclass() |
boolean |
insertBefore(org.zkoss.zk.ui.Component newChild,
org.zkoss.zk.ui.Component refChild) |
boolean |
isEscapeXML()
Return whether the item content escape XML
|
boolean |
isReadonly()
Returns whether it is readonly.
|
boolean |
isWeekOfYear()
Returns whether enable to show the week number within the current year or not.
|
void |
modifyDayItem(CalendarItem ce) |
void |
nextPage()
Navigates the current date to the next page, that is, when the
getDays()
is seven with default mold, the next page means the next week. |
void |
onAddDayItemResponse() |
void |
onInitRender() |
void |
onModifyDayItemResponse() |
void |
onRemoveDayItemResponse() |
void |
previousPage()
Navigates the current date to the previous page, that is, when the
getDays()
is seven with default mold, the previous page means the previous week. |
void |
removeDayItem(CalendarItem ce) |
boolean |
removeTimeZone(java.util.TimeZone timezone)
Removes the time zone from the calendar
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
protected void |
reSendItemGroup() |
void |
service(org.zkoss.zk.au.AuRequest request,
boolean everError) |
void |
setBeginTime(int beginTime) |
void |
setCurrentDate(java.util.Date curDate)
Sets the current date.
|
void |
setDateFormatter(DateFormatter dfmater)
Sets the date formatter.
|
void |
setDateFormatter(java.lang.String clsnm)
Sets the date formatter by a class name.
|
void |
setDays(int days)
Sets the days, that is, how many column should be displayed on the default mold.
|
void |
setEndTime(int endTime) |
void |
setEscapeXML(boolean escapeXML)
Sets whether the item content escape XML
|
void |
setFirstDayOfWeek(int value)
Sets what the first day of the week is; e.g.,
SUNDAY in the
U.S., MONDAY in France. |
void |
setFirstDayOfWeek(java.lang.String day)
Sets what the first day of the week is.
|
void |
setItemRender(ItemRender render)
Deprecated.
As of release 2.0-RC
Sets the item renderer.
|
void |
setModel(CalendarModel model)
Sets the calendar model.
|
void |
setMold(java.lang.String mold) |
void |
setReadonly(boolean readonly)
Sets whether it is readonly.
|
void |
setTimeslots(int timeslots) |
void |
setTimeZone(java.lang.String timezone)
Sets the time zone to the calendar, it is easily used for ZUL file.
|
void |
setWeekOfYear(boolean weekOfYear)
Sets whether enable to show the week number within the current year or not.
|
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize
public void setWeekOfYear(boolean weekOfYear)
public boolean isWeekOfYear()
Default: false
public void setReadonly(boolean readonly)
public boolean isReadonly()
Default: false.
public void setDateFormatter(DateFormatter dfmater)
DateFormatter
public void setDateFormatter(java.lang.String clsnm) throws java.lang.ClassNotFoundException, java.lang.NoSuchMethodException, java.lang.IllegalAccessException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException
java.lang.ClassNotFoundException
java.lang.NoSuchMethodException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
DateFormatter
,
setDateFormatter(DateFormatter)
public DateFormatter getDateFormatter()
Note: never null.
public void setDays(int days)
Default: 7. (i.e. one week), in month view, the attribute will be ignored.
public int getDays()
Default: 7
public void setFirstDayOfWeek(int value)
SUNDAY
in the
U.S., MONDAY
in France.
Default: Calendar.SUNDAY
Note: it is only allowed when days with 7 in the default mold or using the month mold.
value
- the given first day of the week.getFirstDayOfWeek()
,
Calendar.setFirstDayOfWeek(int)
public void setFirstDayOfWeek(java.lang.String day)
Note: it is only allowed when days with 7 in the default mold or using the month mold.
day
- SUNDAY
, MONDAY
,
TUESDAY
, WEDNESDAY
, THURSDAY
, FRIDAY
,
and SATURDAY
. Case insensitivepublic int getFirstDayOfWeek()
SUNDAY
in the
U.S., MONDAY
in France.
Default: Calendar.SUNDAY
setFirstDayOfWeek(int)
,
Calendar.getFirstDayOfWeek()
public void onAddDayItemResponse()
public void onRemoveDayItemResponse()
public void onModifyDayItemResponse()
public void addDayItem(CalendarItem ce)
public void modifyDayItem(CalendarItem ce)
public void removeDayItem(CalendarItem ce)
public void addTimeZone(java.lang.String label, java.util.TimeZone timezone)
Note: the first added will be the default time zone of the calendar.
label
- the description of the time zone.timezone
- a time zone. (Cannot duplicate)public void addTimeZone(java.lang.String label, java.lang.String timezone)
Note: the first added will be the default time zone of the calendar.
label
- the description of the time zone.timezone
- a id of time zone. (Cannot duplicate)TimeZone.getTimeZone(String)
,
addTimeZone(String, TimeZone)
public void setTimeZone(java.lang.String timezone)
<calendars timeZone="Taiwan=GMT+8, Sweden=GMT+1,">
timezone
- public boolean removeTimeZone(java.util.TimeZone timezone)
public java.util.TimeZone getDefaultTimeZone()
public java.util.Map<java.util.TimeZone,java.lang.String> getTimeZones()
public java.lang.String getCalendarItemId(CalendarItem ce)
public CalendarItem getCalendarItemById(java.lang.String id)
protected java.lang.String getItemKey(CalendarItem evt)
public java.util.List<CalendarItem> getItem(java.util.Date beginDate)
Note: never null.
public void previousPage()
getDays()
is seven with default mold, the previous page means the previous week.
In the month mold, it means the previous month.public void nextPage()
getDays()
is seven with default mold, the next page means the next week.
In the month mold, it means the next month.public java.util.Date getBeginDate()
getCurrentDate()
in
the current view depended on which AbstractComponent.getMold()
is using.public java.util.Date getEndDate()
getCurrentDate()
in the
current view depended on which AbstractComponent.getMold()
is using.public void setCurrentDate(java.util.Date curDate)
Default: today (depend on which timezone the system is using).
public java.util.Date getCurrentDate()
Default: today (depend on which timezone the calendar is using).
public void setBeginTime(int beginTime)
Default: 0.
public int getBeginTime()
Default: 0.
public void setEndTime(int endTime)
Default: 24.
public int getEndTime()
Default: 24.
public void setTimeslots(int timeslots)
Default: 2.
public int getTimeslots()
Default: 2.
public int getWeekOfMonth()
protected void reSendItemGroup()
public void onInitRender()
public org.zkoss.zul.Toolbar getToolbar()
public CalendarModel getModel()
public void setModel(CalendarModel model)
public void setMold(java.lang.String mold)
setMold
in interface org.zkoss.zk.ui.Component
setMold
in class org.zkoss.zk.ui.AbstractComponent
public void setEscapeXML(boolean escapeXML)
escapeXML
- public boolean isEscapeXML()
public java.lang.String getZclass()
getZclass
in class org.zkoss.zk.ui.HtmlBasedComponent
public boolean insertBefore(org.zkoss.zk.ui.Component newChild, org.zkoss.zk.ui.Component refChild)
insertBefore
in interface org.zkoss.zk.ui.Component
insertBefore
in class org.zkoss.zk.ui.AbstractComponent
public java.lang.Object clone()
clone
in interface org.zkoss.zk.ui.Component
clone
in class org.zkoss.zul.impl.XulElement
public void service(org.zkoss.zk.au.AuRequest request, boolean everError)
service
in interface org.zkoss.zk.ui.sys.ComponentCtrl
service
in class org.zkoss.zk.ui.HtmlBasedComponent
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException
renderProperties
in class org.zkoss.zul.impl.XulElement
java.io.IOException
public ItemRender getItemRender()
CalendarItem
to draw its
outline (i.e. HTML), like the DSP renderer of ZK component.
Note: never null.
public void setItemRender(ItemRender render)
Copyright © 2021. All Rights Reserved.