Class BasicEvent

    • Constructor Detail

      • BasicEvent

        public BasicEvent()
        Default constructor
      • BasicEvent

        public BasicEvent​(String caption,
                          String description,
                          Date date)
        Constructor for creating an event with the same start and end date
        Parameters:
        caption - The caption for the event
        description - The description for the event
        date - The date the event occurred
      • BasicEvent

        public BasicEvent​(String caption,
                          String description,
                          Date startDate,
                          Date endDate)
        Constructor for creating an event with a start date and an end date. Start date should be before the end date
        Parameters:
        caption - The caption for the event
        description - The description for the event
        startDate - The start date of the event
        endDate - The end date of the event
    • Method Detail

      • getDescription

        public String getDescription()
        Description copied from interface: CalendarEvent
        Gets description of event. Shown as a tooltip over the event.
        Specified by:
        getDescription in interface CalendarEvent
        Returns:
        Description text.
      • getStyleName

        public String getStyleName()
        Description copied from interface: CalendarEvent

        Gets style name of event. In the client, style name will be set to the event's element class name and can be styled by CSS

        Styling example:
        Java code:
        event.setStyleName("color1");

        CSS:
        .v-calendar-event-color1 {
           background-color: #9effae;
        }
        Specified by:
        getStyleName in interface CalendarEvent
        Returns:
        Style name.
      • isAllDay

        public boolean isAllDay()
        Description copied from interface: CalendarEvent
        An all-day event typically does not occur at a specific time but targets a whole day or days. The rendering of all-day events differs from normal events.
        Specified by:
        isAllDay in interface CalendarEvent
        Returns:
        true if this event is an all-day event, false otherwise
      • setDescription

        public void setDescription​(String description)
        Description copied from interface: EditableCalendarEvent
        Set the description of the event. This is shown in the calendar when hoovering over the event.
        Specified by:
        setDescription in interface EditableCalendarEvent
        Parameters:
        description - The text which describes the event
      • setStart

        public void setStart​(Date start)
        Description copied from interface: EditableCalendarEvent
        Set the start date for the event. Must be before the end date
        Specified by:
        setStart in interface EditableCalendarEvent
        Parameters:
        start - The start date of the event
      • setAllDay

        public void setAllDay​(boolean isAllDay)
        Description copied from interface: EditableCalendarEvent
        Does the event span the whole day. If so then set this to true
        Specified by:
        setAllDay in interface EditableCalendarEvent
        Parameters:
        isAllDay - True if the event spans the whole day. In this case the start and end times are ignored.
      • fireEventChange

        protected void fireEventChange()
        Fires an event change event to the listeners. Should be triggered when some property of the event changes.