Class FullCalendarSettings.Builder

java.lang.Object
com.jalios.jcms.calendar.fullcalendar.FullCalendarSettings.Builder
Enclosing class:
FullCalendarSettings

public static class FullCalendarSettings.Builder extends Object
  • Method Details

    • initialView

      public FullCalendarSettings.Builder initialView(String initialView)
      Sets the FullCalendar initial view name.

      This value is required but defaults to FullCalendarSettings.View.DAY_GRID_MONTH. The legacy timeGridWeek5 value is automatically converted to FullCalendarSettings.View.FIVE_DAYS.

      Parameters:
      initialView - FullCalendar view name, for example dayGridMonth
      Returns:
      this builder
    • initialView

      public FullCalendarSettings.Builder initialView(FullCalendarSettings.View initialView)
      Sets the initial view using a view provided by the core component.
      Parameters:
      initialView - core calendar view
      Returns:
      this builder
    • option

      public FullCalendarSettings.Builder option(String name, Object value)
      Adds an option explicitly supported by the core calendar API.
      Parameters:
      name - FullCalendar option name
      value - FullCalendar option value
      Returns:
      this builder
    • locale

      public FullCalendarSettings.Builder locale(String locale)
      Sets the FullCalendar locale option, overriding the current navigation language.
      Parameters:
      locale - FullCalendar locale code
      Returns:
      this builder
    • timeZone

      public FullCalendarSettings.Builder timeZone(String timeZone)
      Sets the FullCalendar timeZone option, overriding the member time zone when the builder was created with a member.
      Parameters:
      timeZone - FullCalendar time zone value
      Returns:
      this builder
    • height

      public FullCalendarSettings.Builder height(Object height)
      Sets the FullCalendar height option.

      The default value is FullCalendarSettings.DEFAULT_HEIGHT.

      Parameters:
      height - FullCalendar height value, such as "auto" or a number
      Returns:
      this builder
    • minHeight

      public FullCalendarSettings.Builder minHeight(int minHeight)
      Sets the minimum rendered calendar height.

      The default value is FullCalendarSettings.DEFAULT_MIN_HEIGHT.

      Parameters:
      minHeight - minimum height in CSS pixels
      Returns:
      this builder
    • editable

      public FullCalendarSettings.Builder editable(boolean editable)
      Enables or disables drag/drop and resize editing. The default value is false.
      Parameters:
      editable - whether events can be edited by FullCalendar interactions
      Returns:
      this builder
    • selectable

      public FullCalendarSettings.Builder selectable(boolean selectable)
      Enables or disables range selection in the calendar. The default value is false.
      Parameters:
      selectable - whether users can select a date/time range
      Returns:
      this builder
    • nowIndicator

      public FullCalendarSettings.Builder nowIndicator(boolean nowIndicator)
      Enables or disables the current time indicator. The default value is true.
      Parameters:
      nowIndicator - whether FullCalendar should display the current time indicator
      Returns:
      this builder
    • eventLimit

      public FullCalendarSettings.Builder eventLimit(Object eventLimit)
      Sets the FullCalendar dayMaxEvents option.

      This method keeps the historical eventLimit builder name but maps it to the FullCalendar v7 option. The default value is true, which lets FullCalendar calculate the number of visible events from the available cell height.

      Parameters:
      eventLimit - FullCalendar dayMaxEvents value
      Returns:
      this builder
    • allDayDefault

      public FullCalendarSettings.Builder allDayDefault(boolean allDayDefault)
      Sets whether newly created events are all-day by default. The default value is true.
      Parameters:
      allDayDefault - whether events without explicit times are all-day
      Returns:
      this builder
    • eventDurationEditable

      public FullCalendarSettings.Builder eventDurationEditable(boolean eventDurationEditable)
      Enables or disables event duration editing by resize.
      Parameters:
      eventDurationEditable - whether event duration can be changed
      Returns:
      this builder
    • eventResizableFromStart

      public FullCalendarSettings.Builder eventResizableFromStart(boolean eventResizableFromStart)
      Enables or disables resizing events from their start edge.
      Parameters:
      eventResizableFromStart - whether events can be resized from their start
      Returns:
      this builder
    • eventStartEditable

      public FullCalendarSettings.Builder eventStartEditable(boolean eventStartEditable)
      Enables or disables event start editing by drag and drop.
      Parameters:
      eventStartEditable - whether event start can be changed
      Returns:
      this builder
    • fixedWeekCount

      public FullCalendarSettings.Builder fixedWeekCount(boolean fixedWeekCount)
      Sets whether month views always render six weeks. The default value is false.
      Parameters:
      fixedWeekCount - whether month views keep a fixed week count
      Returns:
      this builder
    • slotMinTime

      public FullCalendarSettings.Builder slotMinTime(String slotMinTime)
      Sets the minimum time displayed by time grid views. The default value is "00:00:00" so all hours remain available.
      Parameters:
      slotMinTime - FullCalendar duration string, for example "08:00:00"
      Returns:
      this builder
    • slotMaxTime

      public FullCalendarSettings.Builder slotMaxTime(String slotMaxTime)
      Sets the maximum time displayed by time grid views. The default value is "24:00:00" so all hours remain available.
      Parameters:
      slotMaxTime - FullCalendar duration string, for example "19:00:00"
      Returns:
      this builder
    • slotMinHeight

      public FullCalendarSettings.Builder slotMinHeight(int slotMinHeight)
      Sets the minimum pixel height of a time grid slot. The default value is FullCalendarSettings.DEFAULT_SLOT_MIN_HEIGHT.
      Parameters:
      slotMinHeight - minimum slot height in pixels
      Returns:
      this builder
    • slotHeaderFormat

      public FullCalendarSettings.Builder slotHeaderFormat(Object slotHeaderFormat)
      Sets the time format displayed in the time grid axis.
      Parameters:
      slotHeaderFormat - FullCalendar slotHeaderFormat native format object
      Returns:
      this builder
    • moreLinkText

      public FullCalendarSettings.Builder moreLinkText(String moreLinkText)
      Sets the text displayed after the hidden event count in a more link.
      Parameters:
      moreLinkText - localized text appended after the event count
      Returns:
      this builder
    • eventTimeFormat

      public FullCalendarSettings.Builder eventTimeFormat(Object eventTimeFormat)
      Sets the time format displayed for events.
      Parameters:
      eventTimeFormat - FullCalendar eventTimeFormat native format object
      Returns:
      this builder
    • businessHours

      public FullCalendarSettings.Builder businessHours(Object businessHours)
      Sets FullCalendar business hours.
      Parameters:
      businessHours - boolean, object, or list accepted by FullCalendar
      Returns:
      this builder
    • options

      public FullCalendarSettings.Builder options(Map<String,Object> options)
      Adds several explicitly supported FullCalendar options.
      Parameters:
      options - option map merged into supported options
      Returns:
      this builder
    • additionalOption

      public FullCalendarSettings.Builder additionalOption(String name, Object value)
      Adds a raw FullCalendar option not explicitly wrapped by this API.

      Additional options are merged after supported options and can therefore override them when needed by a module.

      Parameters:
      name - FullCalendar option name
      value - FullCalendar option value
      Returns:
      this builder
    • additionalOptions

      public FullCalendarSettings.Builder additionalOptions(Map<String,Object> options)
      Adds raw FullCalendar options not explicitly wrapped by this API.
      Parameters:
      options - option map merged into additional options
      Returns:
      this builder
    • displayHeaderRight

      public FullCalendarSettings.Builder displayHeaderRight(boolean displayHeaderRight)
      Shows or hides the right side of the generic calendar body header. The default value is true.
      Parameters:
      displayHeaderRight - whether the view dropdown should be displayed
      Returns:
      this builder
    • showToday

      public FullCalendarSettings.Builder showToday(boolean showToday)
      Shows or hides the generic "today" button in the calendar body header.

      This only controls the generated toolbar button. External buttons can still trigger the same action with data-j-fullcalendar-action="today". The default value is true.

      Parameters:
      showToday - whether the generic today button should be displayed
      Returns:
      this builder
    • showDatePicker

      public FullCalendarSettings.Builder showDatePicker(boolean showDatePicker)
      Enables or disables the generic date picker attached to the center date label.

      When disabled, the current date/range label is still displayed but no hidden date input and no picker-opening button are rendered. The default value is true.

      Parameters:
      showDatePicker - whether the center date label should open a date picker
      Returns:
      this builder
    • actionsJsp

      public FullCalendarSettings.Builder actionsJsp(String actionsJsp)
      Sets the module action JSP used by the component.

      The generic JavaScript calls this JSP for event list requests with opEventList=true and for event updates with opUpdateEvent=true.

      Parameters:
      actionsJsp - webapp-relative JSP path
      Returns:
      this builder
    • createEventJsp

      public FullCalendarSettings.Builder createEventJsp(String createEventJsp)
      Sets the JSP opened when users select a date/time range.
      Parameters:
      createEventJsp - webapp-relative JSP path used to create an event
      Returns:
      this builder
    • actionFormSelector

      public FullCalendarSettings.Builder actionFormSelector(String actionFormSelector)
      Sets a jQuery selector used to find the form serialized for action JSP calls.

      The selector can target the form itself or any element inside it. When the selected element is not a form, the generic JavaScript uses its closest("form") ancestor.

      Parameters:
      actionFormSelector - jQuery selector targeting a form or an element inside a form
      Returns:
      this builder
    • actionParam

      public FullCalendarSettings.Builder actionParam(String name, Object value)
      Adds a static parameter sent to action JSP calls.
      Parameters:
      name - request parameter name
      value - request parameter value
      Returns:
      this builder
    • actionParams

      public FullCalendarSettings.Builder actionParams(Map<String,Object> actionParams)
      Adds static parameters sent to action JSP calls.
      Parameters:
      actionParams - request parameters
      Returns:
      this builder
    • wrapperCss

      public FullCalendarSettings.Builder wrapperCss(String wrapperCss)
      Adds CSS classes to the generated calendar wrapper.
      Parameters:
      wrapperCss - additional CSS classes
      Returns:
      this builder
    • eventsUrl

      public FullCalendarSettings.Builder eventsUrl(String eventsUrl)
      Sets a FullCalendar events URL.
      Parameters:
      eventsUrl - URL used by FullCalendar to load events
      Returns:
      this builder
    • eventSource

      public FullCalendarSettings.Builder eventSource(Object eventSource)
      Adds a FullCalendar event source.
      Parameters:
      eventSource - event source object accepted by FullCalendar
      Returns:
      this builder
    • eventSources

      public FullCalendarSettings.Builder eventSources(List<Object> eventSources)
      Adds FullCalendar event sources.
      Parameters:
      eventSources - event source objects accepted by FullCalendar
      Returns:
      this builder
    • callbackEvent

      public FullCalendarSettings.Builder callbackEvent(String callbackName, String eventName)
      Overrides the DOM event name emitted for a FullCalendar callback.
      Parameters:
      callbackName - FullCalendar callback key, for example eventClick
      eventName - DOM event name emitted on the calendar wrapper
      Returns:
      this builder
    • renderingOption

      public FullCalendarSettings.Builder renderingOption(String name, Object value)
      Adds a generic rendering option for the calendar JavaScript.
      Parameters:
      name - rendering option name
      value - rendering option value
      Returns:
      this builder
    • clearViews

      public FullCalendarSettings.Builder clearViews()
      Removes all default items from the generic view dropdown.
      Returns:
      this builder
    • view

      public FullCalendarSettings.Builder view(String viewName, String label)
      Adds an item to the generic view dropdown.
      Parameters:
      viewName - FullCalendar view name
      label - label text or i18n property key
      Returns:
      this builder
    • view

      Adds a core view to the generic view dropdown with its default i18n label.
      Parameters:
      view - core calendar view
      Returns:
      this builder
    • view

      Adds a core view to the generic view dropdown.
      Parameters:
      view - core calendar view
      label - label text or i18n property key
      Returns:
      this builder
    • removeView

      public FullCalendarSettings.Builder removeView(String viewName)
      Removes an item from the generic view dropdown.
      Parameters:
      viewName - FullCalendar view name
      Returns:
      this builder
    • removeView

      Removes a core view from the generic view dropdown.
      Parameters:
      view - core calendar view
      Returns:
      this builder
    • removeFiveDaysView

      public FullCalendarSettings.Builder removeFiveDaysView()
      Removes the default five days view from the generic view dropdown.
      Returns:
      this builder
    • removeDayGridMonthView

      public FullCalendarSettings.Builder removeDayGridMonthView()
      Removes the default month view from the generic view dropdown.
      Returns:
      this builder
    • removeTimeGridWeekView

      public FullCalendarSettings.Builder removeTimeGridWeekView()
      Removes the default week view from the generic view dropdown.
      Returns:
      this builder
    • removeTimeGridDayView

      public FullCalendarSettings.Builder removeTimeGridDayView()
      Removes the default day view from the generic view dropdown.
      Returns:
      this builder
    • removeListWeekView

      public FullCalendarSettings.Builder removeListWeekView()
      Removes the default planning view from the generic view dropdown.
      Returns:
      this builder
    • icon

      Adds an icon to preload when the calendar is rendered.

      Use this for icons later returned by AJAX events so their SVG symbol is already present in the page.

      Parameters:
      icon - Jalios icon key or icon source resolved by IconManager
      Returns:
      this builder
    • icons

      public FullCalendarSettings.Builder icons(String... icons)
      Adds icons to preload when the calendar is rendered.
      Parameters:
      icons - Jalios icon keys or icon sources
      Returns:
      this builder
    • icons

      public FullCalendarSettings.Builder icons(List<String> icons)
      Adds icons to preload when the calendar is rendered.
      Parameters:
      icons - Jalios icon keys or icon sources
      Returns:
      this builder
    • build

      public FullCalendarSettings build()
      Builds immutable calendar settings.
      Returns:
      full calendar settings
      Throws:
      IllegalStateException - if the required initial view is missing