Class SimpleCalendarEvent

java.lang.Object
io.jmix.fullcalendarflowui.component.data.SimpleCalendarEvent
All Implemented Interfaces:
CalendarEvent

public class SimpleCalendarEvent extends Object implements CalendarEvent
Non JPA implementation of calendar event.
  • Field Details

    • id

      protected final Object id
    • groupId

      protected Object groupId
    • constraint

      protected Object constraint
    • allDay

      protected Boolean allDay
    • startDateTime

      protected LocalDateTime startDateTime
    • endDateTime

      protected LocalDateTime endDateTime
    • title

      protected String title
    • description

      protected String description
    • interactive

      protected Boolean interactive
    • classNames

      protected String classNames
    • startEditable

      protected Boolean startEditable
    • durationEditable

      protected Boolean durationEditable
    • display

      protected Display display
    • overlap

      protected Boolean overlap
    • backgroundColor

      protected String backgroundColor
    • borderColor

      protected String borderColor
    • textColor

      protected String textColor
    • additionalProperties

      protected Map<String,Object> additionalProperties
    • recurringDaysOfWeek

      protected DaysOfWeek recurringDaysOfWeek
    • recurringStartDate

      protected LocalDate recurringStartDate
    • recurringEndDate

      protected LocalDate recurringEndDate
    • recurringStartTime

      protected LocalTime recurringStartTime
    • recurringEndTime

      protected LocalTime recurringEndTime
  • Constructor Details

    • SimpleCalendarEvent

      public SimpleCalendarEvent()
    • SimpleCalendarEvent

      public SimpleCalendarEvent(Object id)
  • Method Details

    • getId

      public Object getId()
      Description copied from interface: CalendarEvent
      Returns a unique ID of calendar event, that will be used for identification on client-side.
      Specified by:
      getId in interface CalendarEvent
      Returns:
      ID of calendar event
    • getGroupId

      public Object getGroupId()
      Description copied from interface: CalendarEvent
      Returns a group object that is shared between other evens. Events with the same group ID will be dragged and resized together automatically.
      Specified by:
      getGroupId in interface CalendarEvent
      Returns:
      group ID object or null if not set
    • setGroupId

      public void setGroupId(Object groupId)
      Sets group ID.

      See full description here: CalendarEvent.getGroupId().

      Parameters:
      groupId - group ID to set.
    • getAllDay

      @Nullable public Boolean getAllDay()
      Description copied from interface: CalendarEvent
      Determines if the event is shown in the “all-day” section of relevant CalendarDisplayModes. The default value is false.

      Note, the null value means not all day event.

      Specified by:
      getAllDay in interface CalendarEvent
      Returns:
      {true} if the event is shown in the “all-day” section or null if not set
    • setAllDay

      public void setAllDay(@Nullable Boolean allDay)
      Description copied from interface: CalendarEvent
      Sets whether the event should be shown in the "all-day" section of relevant CalendarDisplayModes. In addition, if true the time text is not displayed with the event. The default value is false.

      Note, the null value means not all-day event.

      Specified by:
      setAllDay in interface CalendarEvent
      Parameters:
      allDay - allDay option
    • getStartDateTime

      public LocalDateTime getStartDateTime()
      Description copied from interface: CalendarEvent
      Returns the start date time object that corresponds to system default time zone: TimeZone.getDefault().

      For EntityCalendarEvent value automatically transformed from supported by entity date-time object to LocalDateTime.

      Specified by:
      getStartDateTime in interface CalendarEvent
      Returns:
      start date time object that corresponds to system default time zone or null if not set
    • setStartDateTime

      public void setStartDateTime(@Nullable LocalDateTime start)
      Description copied from interface: CalendarEvent
      Sets start date time value that corresponds to system default time zone: TimeZone.getDefault().

      For EntityCalendarEvent value automatically transformed from LocalDateTime to supported by entity date-time object to.

      Specified by:
      setStartDateTime in interface CalendarEvent
      Parameters:
      start - start date-time
    • getEndDateTime

      public LocalDateTime getEndDateTime()
      Description copied from interface: CalendarEvent
      Returns the end date time object that corresponds to system default time zone: TimeZone.getDefault().

      For EntityCalendarEvent value automatically transformed from supported by entity date-time object to LocalDateTime.

      Specified by:
      getEndDateTime in interface CalendarEvent
      Returns:
      end date time value that corresponds to system default time zone or null if not set
    • setEndDateTime

      public void setEndDateTime(@Nullable LocalDateTime end)
      Description copied from interface: CalendarEvent
      Sets end date time value that corresponds to system default time zone: TimeZone.getDefault().

      Note that this value is exclusive. For instance, an event with end property - 2024-09-03 will appear to span through {code 2024-09-02} but before the start of 2024-09-03.

      For EntityCalendarEvent value automatically transformed from LocalDateTime to supported by entity date-time object to.

      Specified by:
      setEndDateTime in interface CalendarEvent
      Parameters:
      end - end date-time
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface CalendarEvent
      Returns:
      a text that will appear on an event
    • setTitle

      public void setTitle(@Nullable String title)
      Sets event title.

      See full description here: CalendarEvent.getTitle().

      Parameters:
      title - title to set
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface CalendarEvent
      Returns:
      an event description
    • setDescription

      public void setDescription(@Nullable String description)
      Sets event description.

      See full description here: CalendarEvent.getDescription().

      Parameters:
      description - description to set
    • getInteractive

      public Boolean getInteractive()
      Description copied from interface: CalendarEvent
      Defines whether events can be navigated by TAB key.

      If value is null, the event interactivity will be managed by JmixFullCalendar.isEventInteractive().

      Specified by:
      getInteractive in interface CalendarEvent
      Returns:
      true if the event should be navigable by TAB key or null if not set
    • setInteractive

      public void setInteractive(@Nullable Boolean interactive)
      Sets event interactivity.

      See full description here: CalendarEvent.getInteractive().

      Parameters:
      interactive - whether events can be navigated by TAB key
    • getClassNames

      public String getClassNames()
      Specified by:
      getClassNames in interface CalendarEvent
      Returns:
      a class name or class names separated by space that should be attached to the rendered event
    • setClassNames

      public void setClassNames(@Nullable String classNames)
      Sets event class names.

      See full description here: CalendarEvent.getClassNames().

      Parameters:
      classNames - class names to set
    • getStartEditable

      @Nullable public Boolean getStartEditable()
      Description copied from interface: CalendarEvent
      Determines whether an event can be dragged in the calendar component. This value override the JmixFullCalendar.setEventStartEditable(boolean) property.

      Note, null value means that the ability of editing start position will be managed by component's property.

      For instance, for calendar eventStartEditable=true:

      • and event's startEditable=true - event start is editable
      • and event's startEditable=false - event start is not editable
      • and event's startEditable=null - event start is editable
      For calendar eventStartEditable=false:
      • and event's startEditable=true - event start is editable
      • and event's startEditable=false - event start is not editable
      • and event's startEditable=null - event start is not editable
      Specified by:
      getStartEditable in interface CalendarEvent
      Returns:
      false if an event should not provide the ability to edit event start position
    • setStartEditable

      public void setStartEditable(@Nullable Boolean startEditable)
      Sets whether an event can be dragged in the calendar component.

      See full description here: CalendarEvent.getStartEditable().

      Parameters:
      startEditable - startEditable option
    • getDurationEditable

      @Nullable public Boolean getDurationEditable()
      Description copied from interface: CalendarEvent
      Determines whether an event can be resized in the calendar component. This value override the JmixFullCalendar.setEventDurationEditable(boolean) property.

      Note, null value means that the ability of event resizing will be managed by component's property.

      For instance, for calendar eventDurationEditable=true:

      • and event's durationEditable=true - event duration is editable
      • and event's durationEditable=false - event duration is not editable
      • and event's durationEditable=null - event duration is editable
      For calendar eventStartEditable=false:
      • and event's durationEditable=true - event duration is editable
      • and event's durationEditable=false - event duration is not editable
      • and event's durationEditable=null - event duration is not editable
      Specified by:
      getDurationEditable in interface CalendarEvent
      Returns:
      false if an event should not be resized
    • setDurationEditable

      public void setDurationEditable(@Nullable Boolean durationEditable)
      Sets whether an event can be resized in the calendar component.

      See full description here: CalendarEvent.getDurationEditable().

      Parameters:
      durationEditable - durationEditable option
    • getDisplay

      public Display getDisplay()
      Description copied from interface: CalendarEvent
      Defines the type of event rendering. If not specified, the Display.AUTO will be used by default.
      Specified by:
      getDisplay in interface CalendarEvent
      Returns:
      the type of event rendering or null if not set
    • setDisplay

      public void setDisplay(@Nullable Display display)
      Sets the type of event rendering.

      See full description here: CalendarEvent.getDisplay().

      Parameters:
      display - the type of event rendering
    • getOverlap

      public Boolean getOverlap()
      Description copied from interface: CalendarEvent
      Defines whether the event can be dragged/resized over other events and prevents other events from being dragged/resized over this event.

      Note if value is null, the ability of overlapping will be managed by JmixFullCalendar.isEventOverlap() or JmixFullCalendar.getEventOverlapJsFunction().

      For instance, for calendar's eventOverlap=true:

      • and event's overlap=true - event can be overlapped
      • and event's overlap=false - event cannot be overlapped
      • and event's overlap=null - event can be overlapped
      For calendar eventOverlap=false:
      • and event's overlap=true - event can be overlapped
      • and event's overlap=false - event cannot be overlapped
      • and event's overlap=null - event cannot be overlapped
      Specified by:
      getOverlap in interface CalendarEvent
      Returns:
      true if event should be overlapped
    • setOverlap

      public void setOverlap(@Nullable Boolean overlap)
      Sets whether the event can be dragged/ resized over other events and prevents other events from being dragged/ resized over this event

      See full description here: CalendarEvent.getOverlap().

      Parameters:
      overlap - overlap option
    • getConstraint

      @Nullable public Object getConstraint()
      Description copied from interface: CalendarEvent
      A group ID of other events. This property limits dragging and resizing to a certain cells in component.

      If value is null, the event constraints will be managed by component's FullCalendar.getEventConstraintGroupId() and FullCalendar.getEventConstraintBusinessHours()

      Specified by:
      getConstraint in interface CalendarEvent
      Returns:
      a constraint object or null if not set
    • setConstraint

      public void setConstraint(@Nullable Object constraint)
      Sets an event constraint.

      See full description here: CalendarEvent.getConstraint().

      Parameters:
      constraint - constraint to set
    • getBackgroundColor

      public String getBackgroundColor()
      Description copied from interface: CalendarEvent
      Specifies the background color for event. Supported values are:
      • #f00
      • #ff0000
      • rgb(255,0,0)
      • Color name - red
      Note, if the background color is null, color will be managed by component's JmixFullCalendar.getEventBackgroundColor().
      Specified by:
      getBackgroundColor in interface CalendarEvent
      Returns:
      background color or null if not set
    • setBackgroundColor

      public void setBackgroundColor(@Nullable String backgroundColor)
      Sets the background color for event.

      See full description here: CalendarEvent.getBackgroundColor().

      Parameters:
      backgroundColor - background color
    • getBorderColor

      public String getBorderColor()
      Description copied from interface: CalendarEvent
      Specifies the border color for event. Supported values are:
      • #f00
      • #ff0000
      • rgb(255,0,0)
      • Color name - red
      Note, if the border color is null, color will be managed by component's JmixFullCalendar.getEventBorderColor().
      Specified by:
      getBorderColor in interface CalendarEvent
      Returns:
      border color or null if not set
    • setBorderColor

      public void setBorderColor(@Nullable String borderColor)
      Sets an event border color.

      See full description here: CalendarEvent.getBorderColor().

      Parameters:
      borderColor - border color
    • getTextColor

      public String getTextColor()
      Description copied from interface: CalendarEvent
      Specifies the text color for event. Supported values are:
      • #f00
      • #ff0000
      • rgb(255,0,0)
      • Color name - red
      Note, if the text color is null, color will be managed by component's JmixFullCalendar.getEventTextColor(). The color applies in time-grid display modes and for all-day events in day-grid display modes.
      Specified by:
      getTextColor in interface CalendarEvent
      Returns:
      text color or null if not set
    • setTextColor

      public void setTextColor(@Nullable String textColor)
      Sets an event text color.

      See full description here: CalendarEvent.getTextColor().

      Parameters:
      textColor - text color
    • getAdditionalProperties

      @Nullable public Map<String,Object> getAdditionalProperties()
      Description copied from interface: CalendarEvent
      Defines additional properties and their values that will be available in various JavaScript functions that takes an event as parameter. For instance, see JmixFullCalendar.setEventOrderJsFunction(JsFunction).
      Specified by:
      getAdditionalProperties in interface CalendarEvent
      Returns:
      map of additional properties and their values
    • setAdditionalProperties

      public void setAdditionalProperties(@Nullable Map<String,Object> additionalProperties)
      Sets additional properties and their values.

      See full description here: CalendarEvent.getAdditionalProperties().

      Parameters:
      additionalProperties - additional properties
    • getRecurringDaysOfWeek

      public DaysOfWeek getRecurringDaysOfWeek()
      Description copied from interface: CalendarEvent
      Specifies the days of the week this event repeats. If omitted, the event is assumed to repeat every day.
      Specified by:
      getRecurringDaysOfWeek in interface CalendarEvent
      Returns:
      the days of the week this event repeats or null if not set
    • setRecurringDaysOfWeek

      public void setRecurringDaysOfWeek(@Nullable DaysOfWeek recurringDaysOfWeek)
      Sets recurring days of week.

      See full description here: CalendarEvent.getRecurringDaysOfWeek().

      Parameters:
      recurringDaysOfWeek - recurring days of week
    • getRecurringStartDate

      public LocalDate getRecurringStartDate()
      Description copied from interface: CalendarEvent
      Returns the date when the recurrences of this event start. If not specified, the recurrences will extend infinitely into the past.
      Specified by:
      getRecurringStartDate in interface CalendarEvent
      Returns:
      the start date of recurring event or null if not set
    • setRecurringStartDate

      public void setRecurringStartDate(@Nullable LocalDate recurringStartDate)
      Sets recurring start date.

      See full description here: CalendarEvent.getRecurringStartDate().

      Parameters:
      recurringStartDate - recurring start date
    • getRecurringEndDate

      public LocalDate getRecurringEndDate()
      Description copied from interface: CalendarEvent
      Returns the date when the recurrences of this event end. If not specified, the recurrences will extend infinitely into the future.

      Note that this value is exclusive. For all-day recurring events, set the end date to the day after your desired last recurrence.

      Specified by:
      getRecurringEndDate in interface CalendarEvent
      Returns:
      the end date of recurring event or null if not set
    • setRecurringEndDate

      public void setRecurringEndDate(@Nullable LocalDate recurringEndDate)
      Sets recurring end date.

      See full description here: CalendarEvent.getRecurringEndDate().

      Parameters:
      recurringEndDate - recurring end date
    • getRecurringStartTime

      public LocalTime getRecurringStartTime()
      Description copied from interface: CalendarEvent
      Returns the start time of a recurring event. If this is not defined, the event is considered an all-day event.

      Note that the calendar does not apply time zone conversion for this property. If the OffsetTime datatype is used in the entity, it will be transformed to the system's default time zone.

      Specified by:
      getRecurringStartTime in interface CalendarEvent
      Returns:
      the start time of recurring event or null if not set
    • setRecurringStartTime

      public void setRecurringStartTime(@Nullable LocalTime recurringStartTime)
      Sets recurring start time.

      See full description here: CalendarEvent.getRecurringStartDate().

      Parameters:
      recurringStartTime - recurring start time
    • getRecurringEndTime

      public LocalTime getRecurringEndTime()
      Description copied from interface: CalendarEvent
      Returns the end time of a recurring event. If this is not defined, the event will appear to have the default duration as configured in JmixFullCalendar.getDefaultTimedEventDuration() property.

      Note that the calendar does not apply time zone conversion for this property. If the OffsetTime datatype is used in the entity, it will be transformed to the system's default time zone.

      Specified by:
      getRecurringEndTime in interface CalendarEvent
      Returns:
      the end time of recurring event or null if not set
    • setRecurringEndTime

      public void setRecurringEndTime(@Nullable LocalTime recurringEndTime)
      Sets recurring end time.

      See full description here: CalendarEvent.getRecurringEndTime().

      Parameters:
      recurringEndTime - recurring end time
    • create

      public static SimpleCalendarEvent.Builder create()
      Creates a builder for convenient event creation. Generates UUID as an event ID.
      Returns:
      a builder
    • create

      public static SimpleCalendarEvent.Builder create(Object id)
      Creates a builder for convenient event creation.
      Parameters:
      id - event ID
      Returns:
      a builder
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object