Class Calendar
- All Implemented Interfaces:
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:
-
Field Summary
Fields inherited from class com.jbstrap.ui.Component
animation, attributes, backgroundColor, borderColor, color, defaultHotKeyHandler, handlers, hotKeys, styleClasses, textAlign, toolTip, toolTipPosition
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaddCalendar
(String name, String title, String fontColor, String backgroundColor, String borderColor) Adds a new calendar to the calendar componentfinal Calendar
addClickHandler
(CalendarClickHandler handler) Adds the specified click event handler to the componentaddComponent
(Component component) No additional component can be added to the Calendar component.final Calendar
Adds the specified double-click event handler to the componentAdds a record to the component.addSchedule
(String calendarName, Schedule schedule) Adds a new scheduled event to the calendarfinal Calendar
Adds the specified scheduled event click handler to the componentfinal Calendar
Adds the specified calendar view change event handler to the component.clear()
Clears every scheduled event from the calendarThis method implements actual data retrieval.Fetches date from the DataDescriptorGets the name of the DS column, that contains the attendees.Gets the name of the DS column, that contains the body (description) of the calendar.Gets the name of the DS column, that contains the name of the calendar.Gets the names of every calendar in the componentgetCalendarTitle
(String calenadrName) Gets the title of the specified calendarGets the name of the DS column, that contains the time it takes to get back from the event.Gets the DataDescriptor, used by the calendar componentGets the default filter criteria, used by the componentGets the last displayed dateGets the name of the DS column, that contains the scheduled event end date of the calendar.Gets the name of the DS column, that contains the type of the event.Gets the filter criteriaGets the name of the DS column, that contains the time it takes to get to the event.Gets the language code of the calendarGets the name of the DS column, that contains the location of the event.Gets the move schedule before save handler on the component.Gets the name of the DS column, that contains the private event marker.getSchedule
(String scheduleId) Gets the specified scheduled eventGets the first displayed dateGets the name of the DS column, that contains the scheduled event start date of the calendar.Gets the name of the DS column, that contains the title of the calendar.getView()
Gets the current view of the calendar componentGoes to (and displays) the specified date in the calendar.void
init()
The component initialization method.boolean
Determines if the component fetches the calendar data automatically from the database when the component is displayed.boolean
Determines if the auto pending functionality is enabled or not.boolean
isCalendarExists
(String name) Determines if the specified calendar is on the componentboolean
Determines if the view changing button is visible on the header.boolean
Determines if the daily view is selecatble for the user.boolean
Determines if the date range is visible on the component header.boolean
Determines if the calendar component header is visible on the interface.boolean
Determines if all day scheduled events are shown on the component or not.boolean
Determines if the milestones are visible in the component.boolean
Determines if the monthly view is selecatble for the user.boolean
Determines if the scheduled events can be moved around in the component.boolean
Determines if the tasks are visibleboolean
Determines if the next button is visible on the component header.boolean
Determines if the previous button is visible on the component header.boolean
Determines if the component is in read-only modeboolean
Determines if the scheduled events are visible on the componentboolean
Determines if the button, that returns the user to the current day is visible on the component header.boolean
Determines if the default detail popup window is enabled on the component.boolean
Determines if the weekly view is selecatble for the user.next()
Goes forward one step in the calendar.void
void
void
Sets the specified calendar scheduled event move event handlerprev()
Goes back one step in the calendar.removeCalendar
(String name) Removes the specified calendar from the componentsetAllDayEventVisible
(boolean visible) Sets if all day scheduled events are shown on the component or not.setAttendeesColumnName
(String columnName) Sets the name of the DS column, that contains the attendees.setAutoFetchData
(boolean autoFetc) Sets if the component fetches the calendar data automatically from the database when the component is displayed.setAutoPendingEvents
(boolean autoPending) Sets if scheduled events should be marked automatically as pending, depending on their start and end dates.setBodyColumnName
(String columnName) Sets the name of the DS column, that contains the body (description) of the calendar.setCalendarColumnName
(String columnName) Sets the name of the DS column, that contains the name of the calendar.setCalendarVisibility
(String calendarName, boolean visible) Sets the calendar visibiliy.setChangeViewButtonVisible
(boolean visible) Sets if the view changing button is visible in the header.setComingDurationColumnName
(String columnName) Sets the name of the DS column, that contains the time it takes to get back from the event.setCustomFetch
(FetchEvent fetchEvent) Sets a custom query.setDailyViewEnabled
(boolean enabled) Sets if the daily view mode is selecatble for the user.setDataDescriptor
(DataDescriptor dataDescriptor) Sets the DataDescriptor, used by the calendar componentsetDateRangeVisible
(boolean visible) Sets if the date range is visible on the component header.setDefaultFilterCriteria
(Criteria criteria) Sets the default filter criteria, used by the componentsetEndDateColumnName
(String columnName) Sets the name of the DS column, that contains the scheduled event end date of the calendar.setEventTypeColumnName
(String columnName) Sets the name of the DS column, that contains the type of the event.setFilterCriteria
(Criteria criteria) Sets the filter criteria, used when getting datasetGoingDurationColumnName
(String columnName) Sets the name of the DS column, that contains the time it takes to get to the event.setHeaderVisible
(boolean headerVisible) Sets the visibility of the calendar header.setLocationColumnName
(String columnName) Sets the name of the DS column, that contains the location of the event.setMilestoneVisible
(boolean visible) Sets if the milestone type schedule events appears in the calendar.setMonthlyViewEnabled
(boolean enabled) Sets if the monthly view mode is selecatble for the user.Sets the moved schedule before save handler on the component.setMoveEnabled
(boolean moveEnabled) Sets if the scheduled events can be moved around in the component.setNextButtonVisible
(boolean visible) Sets if the next button is visible on the component header.setPreviousButtonVisible
(boolean visible) Sets if the previous button is visible on the component header.setPrivateFlagColumnName
(String columnName) Sets the name of the DS column, that contains the private event marker.setReadOnly
(boolean readOnly) Sets the calendar component to be read only.setScheduleVisible
(boolean visible) Sets if the scheduled events are visible in the calendar or not.setStartDateColumnName
(String columnName) Sets the name of the DS column, that contains the scheduled event start date of the calendar.setTaskVisible
(boolean visible) Sets if Tasks are visible in the calendar or not.setTitleColumnName
(String columnName) Sets the name of the DS column, that contains the title of the calendar.setTodayButtonVisible
(boolean visible) Sets if the button, that returns the user to the current day is visible on the component header.setUseDetailPopup
(boolean useDetailPopup) Enables the default detail popup window.setView
(CalendarView view) Sets the view mode of the calendar.setWeeklyViewEnabled
(boolean enabled) Sets if the weekly view mode is selecatble for the user.today()
Displays the current day in the calendarboolean
writeHTML
(StringWriter writer) Creates the component's HTML equivalentMethods inherited from class com.jbstrap.ui.Component
_hide, _setAttribute, addAllowedRole, addComponent, addComponents, addDeniedRole, addHandler, addStyle, addStyleClass, addStyleClasses, afterDraw, clearfix, closeTag, combinateAccess, containsStyle, containsStyleClass, draw, drawSubComponents, error, flattendComponentTree, getAccess, getAccessMode, getAllowedRoles, getAttribute, getAttributes, getBackgroundColor, getBorderColor, getClient, getComponentById, getComponents, getComponents, getComponentsByClass, getData, getDeniedRoles, getHandlers, getId, getName, getParent, getParent, getRegisteredEvents, getStyle, getStyleClasses, getTextAlign, getTextColor, getToolTip, getToolTipPosition, getTypeName, getUI, insertComponentAfter, insertComponentBefore, isAccess, isDrawn, isEnabled, isEventBubbling, isVisible, onHide, onHotKeyEventHandler, onShow, openTag, redraw, removeAllComponents, removeAllowedRole, removeAllStyleClasses, removeAttribute, removeComponent, removeComponent, removeComponents, removeDeniedRole, removeHandler, removeStyle, removeStyle, removeStyleClass, removeStyleClasses, replaceComponent, replaceStyleClass, runAfterDraw, runJavaScript, runJavaScript, runJavaScript, runOnHide, runOnShow, say, setAttribute, setBackgroundColor, setBorder, setBorderColor, setData, setDisplayType, setEnabled, setEventBubbling, setFlex, setFloating, setHeight100, setHeight25, setHeight50, setHeight75, setHeightAuto, setLanguage, setMargin, setName, setOverflow, setPadding, setParent, setScrollable, setSelectionType, setShadow, setStyle, setTextAlign, setTextColor, setToolTip, setToolTipPosition, setVisible, setWidth100, setWidth25, setWidth50, setWidth75, setWidthAuto, showNotification, showNotification, showProcessIndicator, toggleStyleClass
Methods inherited from class com.jbstrap.core.messagebus.MessageBus
closeMessageBus, messageBusOpened, openMessageBus, renewSubscription, sendMessageToMessageBus, subscribeMessageBus, unsubscribeAllListeners, unsubscribeMessageBus
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.jbstrap.ui.Fetchable
addFetchDoneHandler, fireFetchDoneEvent
-
Constructor Details
-
Calendar
public Calendar()Creates an empty calendar component -
Calendar
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 parameterJBStrapParamType.DEFAULT_LANGUAGE
.
-
Calendar
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 parameterJBStrapParamType.DEFAULT_LANGUAGE
.
-
-
Method Details
-
init
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 classComponent<Calendar>
- Throws:
JavaScriptLoadError
- If there was a JavaScript error during the initialization.
-
setView
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 theCalendarView
enum. Ifnull
, the default view (CalendarView.WEEK
) will be used- Returns:
- The calendar component
-
getView
Gets the current view of the calendar component- Returns:
- The current view of the calendar component
-
getLanguageCode
Gets the language code of the calendar- Overrides:
getLanguageCode
in classComponent<Calendar>
- Returns:
- The language code of the calendar
-
setMilestoneVisible
Sets if the milestone type schedule events appears in the calendar. By default, this is enabled.- Parameters:
visible
- Iftrue
, 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
Sets if Tasks are visible in the calendar or not. By default, this is enabled- Parameters:
visible
- Iftrue
, 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
Sets if all day scheduled events are shown on the component or not. By default, they are.- Parameters:
visible
- Iftrue
, 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
Sets if the scheduled events are visible in the calendar or not. By default, they are visible.- Parameters:
visible
- Iftrue
, 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
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
- Iftrue
, 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
Enables the default detail popup window. By default, it is enabled.- Parameters:
useDetailPopup
- Iftrue
, 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
Sets if the scheduled events can be moved around in the component. By default, it is enabled.- Parameters:
moveEnabled
- Iftrue
, 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
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
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 componenttitle
- The title of the calendar. Ifnull
, the calendar name will be usedfontColor
- The font color used by the calendar's scheduled events. Ifnull
, a white font color will be usedbackgroundColor
- The background color of the calendar schedules. Specified using CSS3 units. Ifnull
, the schedules will use a light green color (#1AB394)borderColor
- The border color of the calendar schedules. Specified using CSS3 units. Ifnull
, the schedules will use a light green color (#1AB394)- Returns:
- The calendar component
- Throws:
NullPointerException
- If the calendar name isnull
IllegalArgumentException
- If the calendar name is already used within the component
-
removeCalendar
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
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, otherwisefalse
-
setDataDescriptor
Sets the DataDescriptor, used by the calendar component- Specified by:
setDataDescriptor
in interfaceBasedOnDataDescriptor<Calendar>
- Parameters:
dataDescriptor
- The DataDescriptor instance, from which the component will read data from- Returns:
- The calendar component
-
getDataDescriptor
Gets the DataDescriptor, used by the calendar component- Specified by:
getDataDescriptor
in interfaceBasedOnDataDescriptor<Calendar>
- Returns:
- The DataDescriptor instance, from which the component reads data from, or
null
if none was specified
-
setCalendarColumnName
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
- Iftrue
, 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, otherwisefalse
-
setAutoFetchData
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 interfaceFetchable<Calendar>
- Parameters:
autoFetc
- Iftrue
, the automatic fetch is enabled. Iffalse
, the data fetch must be done manually through code, by calling thefetchData()
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 interfaceFetchable<Calendar>
- Returns:
true
, if it is enabled, otherwisefalse
-
addRecord
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
Adds a new scheduled event to the calendar- Parameters:
calendarName
- The name of the calendar, that will have the new scheduled event added to itschedule
- The instance of the event to be added- Returns:
- The calendar component
- Throws:
IllegalArgumentException
- If the calendar is not found
-
today
Displays the current day in the calendar- Returns:
- The calendar component
-
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
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
Goes to (and displays) the specified date in the calendar.- Parameters:
date
- The date- Returns:
- The calendar component
- Throws:
NullPointerException
- If the date isnull
-
setCalendarVisibility
Sets the calendar visibiliy. By default, a calendar is visible.- Parameters:
calendarName
- The name of the calendarvisible
- Iftrue
, the specified calendar will be visible in the component. Iffalse
, the calendar will not be displayed- Returns:
- The calendar component
-
setHeaderVisible
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
- Iftrue
, the header is shown. Iffalse
, 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, otherwisefalse
-
setChangeViewButtonVisible
Sets if the view changing button is visible in the header. By default, it is visible- Parameters:
visible
- Iftrue
the button is visible. Iffalse
, 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. Iffalse
, it is not
-
setDailyViewEnabled
Sets if the daily view mode is selecatble for the user. By default, it is usable.- Parameters:
enabled
- Iftrue
, 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
Sets if the weekly view mode is selecatble for the user. By default, it is usable.- Parameters:
enabled
- Iftrue
, 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
Sets if the monthly view mode is selecatble for the user. By default, it is usable.- Parameters:
enabled
- Iftrue
, 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
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
- Iftrue
, 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
Sets if the next button is visible on the component header. By default, it is visible.- Parameters:
visible
- Iftrue
, 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
Sets if the previous button is visible on the component header. By default, it is visible.- Parameters:
visible
- Iftrue
, 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
Sets if the date range is visible on the component header. By default, it is visible.- Parameters:
visible
- Iftrue
, 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
Sets the default filter criteria, used by the component- Parameters:
criteria
- The default filter criteria. Ifnull
, no default filter criteria will be used, but other filter criteria can still be in effect- Returns:
- The calendar component
-
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
Sets the filter criteria, used when getting data- Parameters:
criteria
- The filter criteria. Ifnull
, no filter criteria will be used, but the default filter criteria can still be in effect- Returns:
- The calendar component
-
getFilterCriteria
Gets the filter criteria- Returns:
- The filter criteria or
null
, if none was specified
-
clear
Clears every scheduled event from the calendar- Returns:
- The calendar component
-
getStartDate
Gets the first displayed date- Returns:
- The first displayed date or
null
, if the component is not displayed
-
getEndDate
Gets the last displayed date- Returns:
- The last displayed date or
null
, if the component is not displayed
-
getSchedule
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
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
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
Fetches date from the DataDescriptor -
onCalendarInitDown
- Parameters:
event
- The event object
-
onCalendarViewChanged
- Parameters:
event
- The event object
-
onScheduleMove
Sets the specified calendar scheduled event move event handler- Parameters:
event
- The event object
-
addViewChangeHandler
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
Adds the specified click event handler to the component- Parameters:
handler
- The calendar click event handler implementation- Returns:
- The calendar component
- See Also:
-
addDoubleClickHandler
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
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
Description copied from class:Component
Creates the component's HTML equivalentThis 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 withfalse
. Otherwise, it must return withtrue
. -
addComponent
No additional component can be added to the Calendar component.- Overrides:
addComponent
in classComponent<Calendar>
- Parameters:
component
- The component to be added- Returns:
- The component
- Throws:
UnsupportedOperationException
- If the method is called
-
setCustomFetch
Sets a custom query. When calling the fetchData method, the specifiedFetchEvent
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. TheFetchable.fetchData()
function runs callback methods on the returned records.- Specified by:
fetch
in interfaceFetchable<Calendar>
- Parameters:
startRow
- The first row of the query that appears in the returned listendRow
- The last row of the query that appears in the returned listcriteria
- The criteria used during the query Ifnull
, no criteria will be used, every record is queried.orders
- The orderings that will be applied to the query results. Ifnull
, the data will not be ordered.client
- The client that started the query. Ifnull
, 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 queryDataAccessException
- Occurs if the user in the specified client has no access to read the data
-