Class Calendar

All Implemented Interfaces:
Fetchable<Calendar>, BasedOnDataDescriptor<Calendar>

public class Calendar extends Component<Calendar> implements Fetchable<Calendar>, BasedOnDataDescriptor<Calendar>

Calendar component

The calendar component displays a calendar on the interface. Scheduled events can also be displayed in these calendars. By default, the calendar is in a weekly view mode (the component displays one week, and lists out the events of that week). The component also supports a daily and a monthly view.

The component is able to read data from a database, through a DataDescriptor. In this case, the component provides a default event builder, which can create calendar schedule objects based on database records. This component can also implement a custom schedule builder class, with which a schedule object can be filled up from any custom data structure. The custom element builder needs the ScheduleFromRecordSettings interface to be implemented.

These scheduled events are grouped, within the component, in calendars, that can be managed together. These calendars can be displayed, and when this happens, every scheduled event in those calendars will be displayed. They can also be hidden, in a similar fashion. A new calendar can also be created, with the calendar component.

The component also allows the user to move the scheduled events to other dates. If this functionality is enabled, and the user moves a scheduled event, to another date, the scheduled even't data will be saved automatically, and the interface will refresh itself. The component can allow a move event handler, in which case the program logic decides if the user can move that specific event to another date. For more information see the description of the BeforeMoveEvent interface.

Since:
4.0
Author:
JBStrap
See Also:
  • Constructor Details

    • Calendar

      public Calendar()
      Creates an empty calendar component
    • Calendar

      public Calendar(String languageCode)
      Creates an empty calendar component, in the specified language
      Parameters:
      languageCode - Language code according to which the component is created. If not provided or the entered value is null, the component is created using the framework’s default language. The default language of the framework is set via the JBStrap parameter JBStrapParamType.DEFAULT_LANGUAGE.
    • Calendar

      public Calendar(String id, String languageCode)
      Creates an empty calendar component, in the specified language
      Parameters:
      id - The component ID. The ID specified here will appear in the HTML tag as an ID attribute. If there are multiple components displayed, that have the same ID, the ID numbers will be numbered, in the order they are displayed. (For example, if the ID is 'COMPONENT' then it will be numbered like this: COMPONENT, COMPONENT_1, COMPONENT_2 etc.)
      languageCode - Language code according to which the component is created. If not provided or the entered value is null, the component is created using the framework’s default language. The default language of the framework is set via the JBStrap parameter JBStrapParamType.DEFAULT_LANGUAGE.
  • Method Details

    • init

      public void init() throws JavaScriptLoadError
      Description copied from class: Component
      The component initialization method.

      Empty method, only needs to be overwritten when making a custom component, that needs to call an initializing JavaScript on the client side. The method is called by the framework after the component is drawn, but before the afterDraw() method. The use of this method during application development is not allowed. This method is meant for inner use only.

      Overrides:
      init in class Component<Calendar>
      Throws:
      JavaScriptLoadError - If there was a JavaScript error during the initialization.
    • setView

      public Calendar setView(CalendarView view)
      Sets the view mode of the calendar. By default it is using the weekly (CalendarView.WEEK) view
      Parameters:
      view - The calendar view to be used. Usable values can be found in the CalendarView enum. If null, the default view (CalendarView.WEEK) will be used
      Returns:
      The calendar component
    • getView

      public CalendarView getView()
      Gets the current view of the calendar component
      Returns:
      The current view of the calendar component
    • getLanguageCode

      public String getLanguageCode()
      Gets the language code of the calendar
      Overrides:
      getLanguageCode in class Component<Calendar>
      Returns:
      The language code of the calendar
    • setMilestoneVisible

      public Calendar setMilestoneVisible(boolean visible)
      Sets if the milestone type schedule events appears in the calendar. By default, this is enabled.
      Parameters:
      visible - If true, the milestones will be displayed, otherwise, not
      Returns:
      The calendar component
    • isMilestoneVisible

      public boolean isMilestoneVisible()
      Determines if the milestones are visible in the component.
      Returns:
      If true, the milestones are visible, otherwise not.
    • setTaskVisible

      public Calendar setTaskVisible(boolean visible)
      Sets if Tasks are visible in the calendar or not. By default, this is enabled
      Parameters:
      visible - If true, the Tasks will be visible, otherwise not
      Returns:
      The calendar component
    • isMTaskVisible

      public boolean isMTaskVisible()
      Determines if the tasks are visible
      Returns:
      If true, the tasks are visible otherwise not
    • setAllDayEventVisible

      public Calendar setAllDayEventVisible(boolean visible)
      Sets if all day scheduled events are shown on the component or not. By default, they are.
      Parameters:
      visible - If true, all day events are shown, otherwise not.
      Returns:
      The calendar component
    • isMAllDayEventsVisible

      public boolean isMAllDayEventsVisible()
      Determines if all day scheduled events are shown on the component or not.
      Returns:
      If true, the all day events are shown
    • setScheduleVisible

      public Calendar setScheduleVisible(boolean visible)
      Sets if the scheduled events are visible in the calendar or not. By default, they are visible.
      Parameters:
      visible - If true, the scheduled events are visible
      Returns:
      The calendar component
    • isScheduleVisible

      public boolean isScheduleVisible()
      Determines if the scheduled events are visible on the component
      Returns:
      If true, the scheduled events are visible
    • setReadOnly

      public Calendar setReadOnly(boolean readOnly)
      Sets the calendar component to be read only. By default, the component is not in read-only mode, the user can modify the contents of the component.
      Parameters:
      readOnly - If true, the component will be in read-only mode.
      Returns:
      The calendar component
    • isReadOnly

      public boolean isReadOnly()
      Determines if the component is in read-only mode
      Returns:
      If true, the component is in read only mode.
    • setUseDetailPopup

      public Calendar setUseDetailPopup(boolean useDetailPopup)
      Enables the default detail popup window. By default, it is enabled.
      Parameters:
      useDetailPopup - If true, the default popup detail window is enabled.
      Returns:
      The calendar component
    • isUseDetailPopup

      public boolean isUseDetailPopup()
      Determines if the default detail popup window is enabled on the component.
      Returns:
      If true, the default popup detail window is enabled.
    • setMoveEnabled

      public Calendar setMoveEnabled(boolean moveEnabled)
      Sets if the scheduled events can be moved around in the component. By default, it is enabled.
      Parameters:
      moveEnabled - If true, the scheduled events can be moved.
      Returns:
      The calendar component
    • isMoveEnabled

      public boolean isMoveEnabled()
      Determines if the scheduled events can be moved around in the component.
      Returns:
      If true, the scheduled events can be moved.
    • setMovedScheduleBeforeSaveHandler

      public Calendar setMovedScheduleBeforeSaveHandler(BeforeMoveEvent handler)
      Sets the moved schedule before save handler on the component. The event is called before the moved schedule event is saved. Provides a way to cancel the saving operation
      Parameters:
      handler - The handler implementation, called before a moved scheduled event is saved
      Returns:
      The calendar component
      See Also:
    • getMovedScheduleBeforeSaveHandler

      public BeforeMoveEvent getMovedScheduleBeforeSaveHandler()
      Gets the move schedule before save handler on the component.
      Returns:
      The used handler instance, or null, if none was set
    • addCalendar

      public Calendar addCalendar(String name, String title, String fontColor, String backgroundColor, String borderColor)
      Adds a new calendar to the calendar component
      Parameters:
      name - Name of the calendar, must be unique within the component
      title - The title of the calendar. If null, the calendar name will be used
      fontColor - The font color used by the calendar's scheduled events. If null, a white font color will be used
      backgroundColor - The background color of the calendar schedules. Specified using CSS3 units. If null, the schedules will use a light green color (#1AB394)
      borderColor - The border color of the calendar schedules. Specified using CSS3 units. If null, the schedules will use a light green color (#1AB394)
      Returns:
      The calendar component
      Throws:
      NullPointerException - If the calendar name is null
      IllegalArgumentException - If the calendar name is already used within the component
    • removeCalendar

      public Calendar removeCalendar(String name)
      Removes the specified calendar from the component
      Parameters:
      name - The name of the calendar that is to be removed. If the name is not found, the method won't do anything
      Returns:
      The calendar component
    • isCalendarExists

      public boolean isCalendarExists(String name)
      Determines if the specified calendar is on the component
      Parameters:
      name - The name of the calendar
      Returns:
      If true, the specified calendar is on the component, otherwise false
    • setDataDescriptor

      public Calendar setDataDescriptor(DataDescriptor dataDescriptor)
      Sets the DataDescriptor, used by the calendar component
      Specified by:
      setDataDescriptor in interface BasedOnDataDescriptor<Calendar>
      Parameters:
      dataDescriptor - The DataDescriptor instance, from which the component will read data from
      Returns:
      The calendar component
    • getDataDescriptor

      public DataDescriptor getDataDescriptor()
      Gets the DataDescriptor, used by the calendar component
      Specified by:
      getDataDescriptor in interface BasedOnDataDescriptor<Calendar>
      Returns:
      The DataDescriptor instance, from which the component reads data from, or null if none was specified
    • setCalendarColumnName

      public Calendar setCalendarColumnName(String columnName)
      Sets the name of the DS column, that contains the name of the calendar. By default this is "calendar"
      Parameters:
      columnName - The name of the DataDescriptor column, that contains the calendar name
      Returns:
      The calendar component
    • getCalendarColumnName

      public String getCalendarColumnName()
      Gets the name of the DS column, that contains the name of the calendar.
      Returns:
      The name of the DataDescriptor column, that contains the calendar name or null, if not specified
    • setTitleColumnName

      public Calendar setTitleColumnName(String columnName)
      Sets the name of the DS column, that contains the title of the calendar. By default this is "title"
      Parameters:
      columnName - The name of the DataDescriptor column, that contains the calendar title
      Returns:
      The calendar component
    • getTitleColumnName

      public String getTitleColumnName()
      Gets the name of the DS column, that contains the title of the calendar.
      Returns:
      The name of the DataDescriptor column, that contains the calendar title or null, if not specified
    • setBodyColumnName

      public Calendar setBodyColumnName(String columnName)
      Sets the name of the DS column, that contains the body (description) of the calendar. By default this is "body"
      Parameters:
      columnName - The name of the DataDescriptor column, that contains the calendar body (description)
      Returns:
      The calendar component
    • getBodyColumnName

      public String getBodyColumnName()
      Gets the name of the DS column, that contains the body (description) of the calendar.
      Returns:
      The name of the DataDescriptor column, that contains the calendar body (description) or null if not specified
    • setStartDateColumnName

      public Calendar setStartDateColumnName(String columnName)
      Sets the name of the DS column, that contains the scheduled event start date of the calendar. By default this is "startDate"
      Parameters:
      columnName - The name of the DataDescriptor column, that contains the scheduled event start date of the calendar.
      Returns:
      The calendar component
    • getStartDateColumnName

      public String getStartDateColumnName()
      Gets the name of the DS column, that contains the scheduled event start date of the calendar.
      Returns:
      The name of the DataDescriptor column, that contains the scheduled event start date of the calendar or null if not specified
    • setEndDateColumnName

      public Calendar setEndDateColumnName(String columnName)
      Sets the name of the DS column, that contains the scheduled event end date of the calendar. By default this is "endDate"
      Parameters:
      columnName - The name of the DataDescriptor column, that contains the scheduled event end date of the calendar.
      Returns:
      The calendar component
    • getEndDateColumnName

      public String getEndDateColumnName()
      Gets the name of the DS column, that contains the scheduled event end date of the calendar.
      Returns:
      The name of the DataDescriptor column, that contains the scheduled event end date of the calendar, or null if not specified
    • setGoingDurationColumnName

      public Calendar setGoingDurationColumnName(String columnName)
      Sets the name of the DS column, that contains the time it takes to get to the event. By default this is "goingDuration"
      Parameters:
      columnName - The name of the DataDescriptor column, that contains the time it takes to get to the event.
      Returns:
      The calendar component
    • getGoingDurationColumnName

      public String getGoingDurationColumnName()
      Gets the name of the DS column, that contains the time it takes to get to the event.
      Returns:
      The name of the DataDescriptor column, that contains the time it takes to get to the event or null if not specified
    • setComingDurationColumnName

      public Calendar setComingDurationColumnName(String columnName)
      Sets the name of the DS column, that contains the time it takes to get back from the event. By default this is "comingDuration"
      Parameters:
      columnName - The name of the DS column, that contains the time it takes to get back from the event.
      Returns:
      The calendar component
    • getComingDurationColumnName

      public String getComingDurationColumnName()
      Gets the name of the DS column, that contains the time it takes to get back from the event.
      Returns:
      The name of the DS column, that contains the time it takes to get back from the event, or null if not specified
    • setLocationColumnName

      public Calendar setLocationColumnName(String columnName)
      Sets the name of the DS column, that contains the location of the event. By default this is "location"
      Parameters:
      columnName - The name of the DS column, that contains the location of the event.
      Returns:
      The calendar component
    • getLocationColumnName

      public String getLocationColumnName()
      Gets the name of the DS column, that contains the location of the event.
      Returns:
      The name of the DS column, that contains the location of the event or null if not specified
    • setEventTypeColumnName

      public Calendar setEventTypeColumnName(String columnName)
      Sets the name of the DS column, that contains the type of the event. By default this is "eventType"
      Parameters:
      columnName - The name of the DS column, that contains the type of the event
      Returns:
      The calendar component
    • getEventTypeColumnName

      public String getEventTypeColumnName()
      Gets the name of the DS column, that contains the type of the event.
      Returns:
      The name of the DS column, that contains the type of the event or null if not specified
    • setPrivateFlagColumnName

      public Calendar setPrivateFlagColumnName(String columnName)
      Sets the name of the DS column, that contains the private event marker. By default this is "isPrivate"
      Parameters:
      columnName - The name of the DS column, that contains the private event marker.
      Returns:
      The calendar component
    • getPrivateFlagColumnName

      public String getPrivateFlagColumnName()
      Gets the name of the DS column, that contains the private event marker.
      Returns:
      The name of the DS column, that contains the private event marker, or null if not specified
    • setAttendeesColumnName

      public Calendar setAttendeesColumnName(String columnName)
      Sets the name of the DS column, that contains the attendees. By default this is "attendees"
      Parameters:
      columnName - The name of the DS column, that contains the attendees.
      Returns:
      The calendar component
    • getAttendeesColumnName

      public String getAttendeesColumnName()
      Gets the name of the DS column, that contains the attendees.
      Returns:
      The name of the DS column, that contains the attendees or null, if not specified
    • setAutoPendingEvents

      public Calendar setAutoPendingEvents(boolean autoPending)
      Sets if scheduled events should be marked automatically as pending, depending on their start and end dates. By default, this is enabled. E.g. if a scheduled event's start date is before the current date, it will be marked as pending.
      Parameters:
      autoPending - If true, this functionality is enabled
      Returns:
      The calendar component
    • isAutoPending

      public boolean isAutoPending()
      Determines if the auto pending functionality is enabled or not.
      Returns:
      If true, the functionality is enabled, otherwise false
    • setAutoFetchData

      public Calendar setAutoFetchData(boolean autoFetc)
      Sets if the component fetches the calendar data automatically from the database when the component is displayed. By default, this is enabled.
      Specified by:
      setAutoFetchData in interface Fetchable<Calendar>
      Parameters:
      autoFetc - If true, the automatic fetch is enabled. If false, the data fetch must be done manually through code, by calling the fetchData() method
      Returns:
      The calendar component
    • isAutoFetchData

      public boolean isAutoFetchData()
      Determines if the component fetches the calendar data automatically from the database when the component is displayed.
      Specified by:
      isAutoFetchData in interface Fetchable<Calendar>
      Returns:
      true, if it is enabled, otherwise false
    • addRecord

      public Calendar addRecord(Record record)
      Adds a record to the component. This record must contain the necessary attributes, that are needed to create scheduled events
      Parameters:
      record - The record instance
      Returns:
      The calendar component
    • addSchedule

      public Calendar addSchedule(String calendarName, Schedule schedule)
      Adds a new scheduled event to the calendar
      Parameters:
      calendarName - The name of the calendar, that will have the new scheduled event added to it
      schedule - The instance of the event to be added
      Returns:
      The calendar component
      Throws:
      IllegalArgumentException - If the calendar is not found
    • today

      public Calendar today()
      Displays the current day in the calendar
      Returns:
      The calendar component
    • prev

      public Calendar prev()
      Goes back one step in the calendar. The step is the increment of the current view (ie, if the component is in a WEEKLY view mode, it will go back with one week)
      Returns:
      The calendar component
    • next

      public Calendar next()
      Goes forward one step in the calendar. The step is the increment of the current view (ie, if the component is in a WEEKLY view mode, it will go forward with one week)
      Returns:
      The calendar component
    • gotoDate

      public Calendar gotoDate(Date date)
      Goes to (and displays) the specified date in the calendar.
      Parameters:
      date - The date
      Returns:
      The calendar component
      Throws:
      NullPointerException - If the date is null
    • setCalendarVisibility

      public Calendar setCalendarVisibility(String calendarName, boolean visible)
      Sets the calendar visibiliy. By default, a calendar is visible.
      Parameters:
      calendarName - The name of the calendar
      visible - If true, the specified calendar will be visible in the component. If false, the calendar will not be displayed
      Returns:
      The calendar component
    • setHeaderVisible

      public Calendar setHeaderVisible(boolean headerVisible)
      Sets the visibility of the calendar header. By default, it is visible. Note: If the header is hidden, the user won't be able to use the buttons on the header (won't be able to change views, go forward or backwards, etc).
      Parameters:
      headerVisible - If true, the header is shown. If false, the header will be hidden
      Returns:
      The calendar component
    • isHeaderVisible

      public boolean isHeaderVisible()
      Determines if the calendar component header is visible on the interface.
      Returns:
      If true, it is visible, otherwise false
    • setChangeViewButtonVisible

      public Calendar setChangeViewButtonVisible(boolean visible)
      Sets if the view changing button is visible in the header. By default, it is visible
      Parameters:
      visible - If true the button is visible. If false, it is not
      Returns:
      The calendar component
    • isChangeViewButtonVisible

      public boolean isChangeViewButtonVisible()
      Determines if the view changing button is visible on the header.
      Returns:
      If true the button is visible. If false, it is not
    • setDailyViewEnabled

      public Calendar setDailyViewEnabled(boolean enabled)
      Sets if the daily view mode is selecatble for the user. By default, it is usable.
      Parameters:
      enabled - If true, the user can select it, otherwise not
      Returns:
      The calendar component
    • isDailyViewEnabled

      public boolean isDailyViewEnabled()
      Determines if the daily view is selecatble for the user.
      Returns:
      If true, the user can select it, otherwise not
    • setWeeklyViewEnabled

      public Calendar setWeeklyViewEnabled(boolean enabled)
      Sets if the weekly view mode is selecatble for the user. By default, it is usable.
      Parameters:
      enabled - If true, the user can select it, otherwise not
      Returns:
      The calendar component
    • isWeeklyViewEnabled

      public boolean isWeeklyViewEnabled()
      Determines if the weekly view is selecatble for the user.
      Returns:
      If true, the user can select it, otherwise not
    • setMonthlyViewEnabled

      public Calendar setMonthlyViewEnabled(boolean enabled)
      Sets if the monthly view mode is selecatble for the user. By default, it is usable.
      Parameters:
      enabled - If true, the user can select it, otherwise not
      Returns:
      The calendar component
    • isMonthlyViewEnabled

      public boolean isMonthlyViewEnabled()
      Determines if the monthly view is selecatble for the user.
      Returns:
      If true, the user can select it, otherwise not
    • setTodayButtonVisible

      public Calendar setTodayButtonVisible(boolean visible)
      Sets if the button, that returns the user to the current day is visible on the component header. By default, it is visible.
      Parameters:
      visible - If true, the button is visible, otherwise, not.
      Returns:
      The calendar component
    • isTodayButtonVisible

      public boolean isTodayButtonVisible()
      Determines if the button, that returns the user to the current day is visible on the component header.
      Returns:
      If true, the button is visible, otherwise, not.
    • setNextButtonVisible

      public Calendar setNextButtonVisible(boolean visible)
      Sets if the next button is visible on the component header. By default, it is visible.
      Parameters:
      visible - If true, the button is visible, otherwise, not.
      Returns:
      The calendar component
    • isNextButtonVisible

      public boolean isNextButtonVisible()
      Determines if the next button is visible on the component header.
      Returns:
      If true, the button is visible, otherwise, not.
    • setPreviousButtonVisible

      public Calendar setPreviousButtonVisible(boolean visible)
      Sets if the previous button is visible on the component header. By default, it is visible.
      Parameters:
      visible - If true, the button is visible, otherwise, not.
      Returns:
      The calendar component
    • isPreviousButtonVisible

      public boolean isPreviousButtonVisible()
      Determines if the previous button is visible on the component header.
      Returns:
      If true, the button is visible, otherwise, not.
    • setDateRangeVisible

      public Calendar setDateRangeVisible(boolean visible)
      Sets if the date range is visible on the component header. By default, it is visible.
      Parameters:
      visible - If true, the date range is visible, otherwise, not.
      Returns:
      The calendar component
    • isDateRangeVisible

      public boolean isDateRangeVisible()
      Determines if the date range is visible on the component header.
      Returns:
      If true, the date range is visible, otherwise, not.
    • setDefaultFilterCriteria

      public Calendar setDefaultFilterCriteria(Criteria criteria)
      Sets the default filter criteria, used by the component
      Parameters:
      criteria - The default filter criteria. If null, no default filter criteria will be used, but other filter criteria can still be in effect
      Returns:
      The calendar component
    • getDefaultFilterCriteria

      public Criteria getDefaultFilterCriteria()
      Gets the default filter criteria, used by the component
      Returns:
      The default filter criteria or null, if no default filter criteria was set
    • setFilterCriteria

      public Calendar setFilterCriteria(Criteria criteria)
      Sets the filter criteria, used when getting data
      Parameters:
      criteria - The filter criteria. If null, no filter criteria will be used, but the default filter criteria can still be in effect
      Returns:
      The calendar component
    • getFilterCriteria

      public Criteria getFilterCriteria()
      Gets the filter criteria
      Returns:
      The filter criteria or null, if none was specified
    • clear

      public Calendar clear()
      Clears every scheduled event from the calendar
      Returns:
      The calendar component
    • getStartDate

      public Date getStartDate()
      Gets the first displayed date
      Returns:
      The first displayed date or null, if the component is not displayed
    • getEndDate

      public Date getEndDate()
      Gets the last displayed date
      Returns:
      The last displayed date or null, if the component is not displayed
    • getSchedule

      public Schedule getSchedule(String scheduleId)
      Gets the specified scheduled event
      Parameters:
      scheduleId - The ID of the scheduled event
      Returns:
      The scheduled event with the specified ID or null, if not found
    • getCalendarTitle

      public String getCalendarTitle(String calenadrName)
      Gets the title of the specified calendar
      Parameters:
      calenadrName - The name of the calendar
      Returns:
      The title of the specified calendar or null, if not found, or if it had no title specified
    • getCalendarNames

      public List<String> getCalendarNames()
      Gets the names of every calendar in the component
      Returns:
      A list containing the names of the calendars in the component. If there are none in the component, the list will be empty
    • fetchData

      public Calendar fetchData()
      Fetches date from the DataDescriptor
      Specified by:
      fetchData in interface Fetchable<Calendar>
      Returns:
      The calendar component
    • onCalendarInitDown

      public void onCalendarInitDown(CalendarInitDoneEvent event)
      Parameters:
      event - The event object
    • onCalendarViewChanged

      public void onCalendarViewChanged(CalendarChangeViewEvent event)
      Parameters:
      event - The event object
    • onScheduleMove

      public void onScheduleMove(CalendarMoveScheduleEvent event)
      Sets the specified calendar scheduled event move event handler
      Parameters:
      event - The event object
    • addViewChangeHandler

      public final Calendar addViewChangeHandler(CalendarViewChangeEventHandler handler)
      Adds the specified calendar view change event handler to the component.
      Parameters:
      handler - The calendar view change event handler implementation
      Returns:
      The calendar component
      See Also:
    • addClickHandler

      public final Calendar addClickHandler(CalendarClickHandler handler)
      Adds the specified click event handler to the component
      Parameters:
      handler - The calendar click event handler implementation
      Returns:
      The calendar component
      See Also:
    • addDoubleClickHandler

      public final Calendar addDoubleClickHandler(CalendarDoubleClickHandler handler)
      Adds the specified double-click event handler to the component
      Parameters:
      handler - The calendar double-click event handler implementation
      Returns:
      The calendar component
      See Also:
    • addScheduleClickHandler

      public final Calendar addScheduleClickHandler(CalendarScheduleClickHandler handler)
      Adds the specified scheduled event click handler to the component
      Parameters:
      handler - The scheduled event click handler implementation
      Returns:
      The calendar component
      See Also:
    • writeHTML

      public boolean writeHTML(StringWriter writer)
      Description copied from class: Component
      Creates the component's HTML equivalent

      This method doesn't need to be used during application development. This method is used when developing a custom component. When creating a custom component, this method needs to be implemented. In the parameter (StringWriter class) the component's HTML equivalent must be specified, and the method has to return with a Boolean value. This boolean value determines if the component was drawn. If the user doesn't have access right to the component, or if the component couldn't be drawn, it should return with false. Otherwise, it must return with true.

      Specified by:
      writeHTML in class Component<Calendar>
      Returns:
      If the componentwas drawn, true, otherwise false
    • addComponent

      public Calendar addComponent(Component component)
      No additional component can be added to the Calendar component.
      Overrides:
      addComponent in class Component<Calendar>
      Parameters:
      component - The component to be added
      Returns:
      The component
      Throws:
      UnsupportedOperationException - If the method is called
    • setCustomFetch

      public Calendar setCustomFetch(FetchEvent fetchEvent)
      Sets a custom query. When calling the fetchData method, the specified FetchEvent implementation is called, then callback methods are run on records returned by the onFetch method.
      Parameters:
      fetchEvent - Custom query implementation
    • fetch

      public List<Record> fetch(int startRow, int endRow, Criteria criteria, List<Order> orders, Client client) throws FindException, DataAccessException
      Description copied from interface: Fetchable
      This method implements actual data retrieval. The Fetchable.fetchData() function runs callback methods on the returned records.
      Specified by:
      fetch in interface Fetchable<Calendar>
      Parameters:
      startRow - The first row of the query that appears in the returned list
      endRow - The last row of the query that appears in the returned list
      criteria - The criteria used during the query If null, no criteria will be used, every record is queried.
      orders - The orderings that will be applied to the query results. If null, the data will not be ordered.
      client - The client that started the query. If null, the query will happen without checking for access rights.
      Returns:
      The list of records that meet the specified filter criteria.
      Throws:
      FindException - Occurs if an error was encountered during the query
      DataAccessException - Occurs if the user in the specified client has no access to read the data