Package org.zkoss.calendar.event
Class CalendarsEvent
- java.lang.Object
-
- org.zkoss.zk.ui.event.Event
-
- org.zkoss.calendar.event.CalendarsEvent
-
- All Implemented Interfaces:
Serializable
public class CalendarsEvent extends org.zkoss.zk.ui.event.EventThe event is used for Calendars when user create/update/edit the calendar item.The event is able to stop or clear the dragging ghost from server to client, that is, when application developer doesn't invoke the
stopClearGhost(), the dragging ghost will be cleared by default. Otherwise, an application developer has to responsibly invoke theclearGhost().- Author:
- jumperchen,jimmy
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringON_DAY_CLICKCalendars fires this event when you click when a user clicks on the date texts (TUE 10/3) on the top of the component.static StringON_ITEM_CREATEThis event is triggered when a user clicks an empty cell in the time cell.static StringON_ITEM_EDITThis event is triggered when a user clicks on an existing calendar item.static StringON_ITEM_TOOLTIPIt's fired when users hover a mouse on a calendar item.static StringON_ITEM_UPDATEThis event is triggered when a user drags to change a calendar item's time span or drags to move the item to a different date.static StringON_WEEK_CLICKCalendars fires this event when a user clicks the week number of the year on the left-hand side when you setweekOfYear="true".
-
Constructor Summary
Constructors Constructor Description CalendarsEvent(String name, org.zkoss.zk.ui.Component target, CalendarItem ce, Date beginDate, Date endDate, int x, int y, int dtwd, int dthgh)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearGhost()Clears the dragging ghost from server to client.DategetBeginDate()Returns the update beginning date.CalendarItemgetCalendarItem()Returns the calendar item.static org.zkoss.zk.ui.event.EventgetClickEvent(org.zkoss.zk.au.AuRequest request, String cmd)static CalendarsEventgetCreateEvent(org.zkoss.zk.au.AuRequest request)Creates an instance ofEventbased on the specified request.intgetDesktopHeight()Returns the pixel height of the client's desktop.intgetDesktopWidth()Returns the pixel width of the client's desktop.static CalendarsEventgetEditEvent(org.zkoss.zk.au.AuRequest request)DategetEndDate()Returns the update end date.static org.zkoss.zk.ui.event.EventgetTooltipEvent(org.zkoss.zk.au.AuRequest request)static CalendarsEventgetUpdateEvent(org.zkoss.zk.au.AuRequest request)intgetX()Returns the x coordination of the mouse pointer relevant to the component.intgetY()Returns the y coordination of the mouse pointer relevant to the component.voidstopClearGhost()Stops to clear the dragging ghost command from server to client.
-
-
-
Field Detail
-
ON_ITEM_CREATE
public static final String ON_ITEM_CREATE
This event is triggered when a user clicks an empty cell in the time cell.- See Also:
- Constant Field Values
-
ON_ITEM_EDIT
public static final String ON_ITEM_EDIT
This event is triggered when a user clicks on an existing calendar item.- See Also:
- Constant Field Values
-
ON_ITEM_UPDATE
public static final String ON_ITEM_UPDATE
This event is triggered when a user drags to change a calendar item's time span or drags to move the item to a different date.- See Also:
- Constant Field Values
-
ON_DAY_CLICK
public static final String ON_DAY_CLICK
Calendars fires this event when you click when a user clicks on the date texts (TUE 10/3) on the top of the component. Pass anEventwhen invoking an event listener.- See Also:
- Constant Field Values
-
ON_WEEK_CLICK
public static final String ON_WEEK_CLICK
Calendars fires this event when a user clicks the week number of the year on the left-hand side when you setweekOfYear="true". Pass anEventwhen invoking an event listener.- See Also:
- Constant Field Values
-
ON_ITEM_TOOLTIP
public static final String ON_ITEM_TOOLTIP
It's fired when users hover a mouse on a calendar item. Listen to this event to show a tooltip for an item.- Since:
- 2.1.5
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CalendarsEvent
public CalendarsEvent(String name, org.zkoss.zk.ui.Component target, CalendarItem ce, Date beginDate, Date endDate, int x, int y, int dtwd, int dthgh)
-
-
Method Detail
-
getCreateEvent
public static CalendarsEvent getCreateEvent(org.zkoss.zk.au.AuRequest request)
Creates an instance ofEventbased on the specified request.
-
getEditEvent
public static CalendarsEvent getEditEvent(org.zkoss.zk.au.AuRequest request)
-
getUpdateEvent
public static CalendarsEvent getUpdateEvent(org.zkoss.zk.au.AuRequest request)
-
getClickEvent
public static org.zkoss.zk.ui.event.Event getClickEvent(org.zkoss.zk.au.AuRequest request, String cmd)
-
getTooltipEvent
public static org.zkoss.zk.ui.event.Event getTooltipEvent(org.zkoss.zk.au.AuRequest request)
-
stopClearGhost
public void stopClearGhost()
Stops to clear the dragging ghost command from server to client.Note: If the method is invoked, application developer has to invoke
clearGhost()to clear the dragging ghost.
-
clearGhost
public void clearGhost()
Clears the dragging ghost from server to client.The CalendarsEvent will clear the ghost by default, except invoking
stopClearGhost().
-
getBeginDate
public Date getBeginDate()
Returns the update beginning date. If the event name is onItemEdit, null is assumed.
-
getEndDate
public Date getEndDate()
Returns the update end date. If the event name is onItemEdit, null is assumed.
-
getCalendarItem
public CalendarItem getCalendarItem()
Returns the calendar item. If the event name is onItemCreate, null is assumed.
-
getX
public final int getX()
Returns the x coordination of the mouse pointer relevant to the component.
-
getY
public final int getY()
Returns the y coordination of the mouse pointer relevant to the component.
-
getDesktopWidth
public int getDesktopWidth()
Returns the pixel width of the client's desktop.
-
getDesktopHeight
public int getDesktopHeight()
Returns the pixel height of the client's desktop.
-
-