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 event by a model named CalendarModel
. And there
are three events, onEventCreate
, onEventEdit
, and
onEventUpdate
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 |
addDayEvent(CalendarEvent ce) |
void |
addTimeZone(String label,
String timezone)
Adds the time zone to the calendar.
|
void |
addTimeZone(String label,
TimeZone timezone)
Adds the time zone to the calendar.
|
Object |
clone() |
Date |
getBeginDate()
Returns the beginning date, which is based on
getCurrentDate() in
the current view depended on which AbstractComponent.getMold() is using. |
int |
getBeginTime() |
CalendarEvent |
getCalendarEventById(String id) |
String |
getCalendarEventId(CalendarEvent ce) |
Date |
getCurrentDate()
Returns the current date.
|
DateFormatter |
getDateFormatter()
Returns the date formatter.
|
int |
getDays()
Returns the days.
|
TimeZone |
getDefaultTimeZone()
Returns the current time zone of the calendar.
|
Date |
getEndDate()
Returns the end date, which is based on
getCurrentDate() in the
current view depended on which AbstractComponent.getMold() is using. |
int |
getEndTime() |
List<CalendarEvent> |
getEvent(Date beginDate)
Returns the unmodifiable list including all the calendar events matching
from the specified date in the same date.
|
protected String |
getEventKey(CalendarEvent evt) |
EventRender |
getEventRender()
Deprecated.
As of release 2.0-RC
Returns the event renderer used for
CalendarEvent to draw its
outline (i.e. HTML), like the DSP renderer of ZK component.
Note: never null. |
int |
getFirstDayOfWeek()
Gets what the first day of the week is; e.g.,
SUNDAY in the
U.S., MONDAY in France. |
CalendarModel |
getModel()
Returns the calendar model.
|
int |
getTimeslots() |
Map<TimeZone,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.
|
String |
getZclass() |
boolean |
insertBefore(org.zkoss.zk.ui.Component newChild,
org.zkoss.zk.ui.Component refChild) |
boolean |
isEscapeXML()
Return whether the event 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 |
modifyDayEvent(CalendarEvent 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 |
onAddDayEventResponse() |
void |
onInitRender() |
void |
onModifyDayEventResponse() |
void |
onRemoveDayEventResponse() |
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 |
removeDayEvent(CalendarEvent ce) |
boolean |
removeTimeZone(TimeZone timezone)
Removes the time zone from the calendar
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
protected void |
reSendEventGroup() |
void |
service(org.zkoss.zk.au.AuRequest request,
boolean everError) |
void |
setBeginTime(int beginTime) |
void |
setCurrentDate(Date curDate)
Sets the current date.
|
void |
setDateFormatter(DateFormatter dfmater)
Sets the date formatter.
|
void |
setDateFormatter(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 event content escape XML
|
void |
setEventRender(EventRender render)
Deprecated.
As of release 2.0-RC
Sets the event renderer.
|
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(String day)
Sets what the first day of the week is.
|
void |
setModel(CalendarModel model)
Sets the calendar model.
|
void |
setMold(String mold) |
void |
setReadonly(boolean readonly)
Sets whether it is readonly.
|
void |
setTimeslots(int timeslots) |
void |
setTimeZone(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(String clsnm) throws ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException
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(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 onAddDayEventResponse()
public void onRemoveDayEventResponse()
public void onModifyDayEventResponse()
public void addDayEvent(CalendarEvent ce)
public void modifyDayEvent(CalendarEvent ce)
public void removeDayEvent(CalendarEvent ce)
public void addTimeZone(String label, 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(String label, 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(String timezone)
<calendars timeZone="Taiwan=GMT+8, Sweden=GMT+1,">
timezone
- public boolean removeTimeZone(TimeZone timezone)
public TimeZone getDefaultTimeZone()
public Map<TimeZone,String> getTimeZones()
public String getCalendarEventId(CalendarEvent ce)
public CalendarEvent getCalendarEventById(String id)
protected String getEventKey(CalendarEvent evt)
public List<CalendarEvent> getEvent(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 Date getBeginDate()
getCurrentDate()
in
the current view depended on which AbstractComponent.getMold()
is using.public Date getEndDate()
getCurrentDate()
in the
current view depended on which AbstractComponent.getMold()
is using.public void setCurrentDate(Date curDate)
Default: today (depend on which timezone the system is using).
public 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 reSendEventGroup()
public void onInitRender()
public org.zkoss.zul.Toolbar getToolbar()
public CalendarModel getModel()
public void setModel(CalendarModel model)
public void setMold(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 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 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 IOException
renderProperties
in class org.zkoss.zul.impl.XulElement
IOException
public EventRender getEventRender()
CalendarEvent
to draw its
outline (i.e. HTML), like the DSP renderer of ZK component.
Note: never null.
public void setEventRender(EventRender render)
Copyright © 2015. All Rights Reserved.