Class CalendarsEvent

  • All Implemented Interfaces:
    Serializable

    public class CalendarsEvent
    extends org.zkoss.zk.ui.event.Event
    The 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 the clearGhost().

    Author:
    jumperchen,jimmy
    See Also:
    Serialized Form
    • 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 an Event when 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 set weekOfYear="true". Pass an Event when 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 of Event based 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.