Package io.jmix.ui.component
Interface Calendar<V>
- Type Parameters:
V
- type of value
- All Superinterfaces:
Component
,Component.BelongToFrame
,Component.HasCaption
,Component.HasDescription
,Component.HasIcon
,HasContextHelp
,HasDatatype<V>
,HasHtmlCaption
,HasHtmlDescription
,HasHtmlSanitizer
- All Known Implementing Classes:
CalendarImpl
@StudioComponent(caption="Calendar",
category="Components",
xmlElement="calendar",
icon="io/jmix/ui/icon/component/calendar.svg",
canvasBehaviour=CALENDAR,
documentationURL="https://docs.jmix.io/jmix/%VERSION%/ui/vcl/components/calendar.html")
public interface Calendar<V>
extends Component.BelongToFrame, Component.HasCaption, Component.HasIcon, HasContextHelp, HasHtmlCaption, HasHtmlDescription, HasDatatype<V>, HasHtmlSanitizer
Calendar is used for visualizing events in a calendar using week or month view.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
An event object that is fired when the user clicks backward navigation button.static class
An event object that is fired when the user clicks on a day number of the month.static class
An event object that is fired when the user clicks on an empty space in the day.static class
An event object that is fired when the user clicks on an event.static class
An event object that is fired when the user changes an event position.static class
An event object that is fired when the user changes an event duration.static class
An event object that is fired when the user clicks forward navigation button.static class
An event object that is fired when the user drag-marks day or time cells using mouse.static class
An event object that is fired when the user clicks on a week number.static enum
Nested classes/interfaces inherited from interface io.jmix.ui.component.Component
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
Nested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent
-
Field Summary
Fields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE
-
Method Summary
Modifier and TypeMethodDescriptionAdds a listener that is invoked when the user clicks backward navigation button.addDateClickListener
(Consumer<Calendar.CalendarDateClickEvent<V>> listener) Adds a listener that is invoked when the user clicks on a day number of the month.addDayClickListener
(Consumer<Calendar.CalendarDayClickEvent<V>> listener) Adds a listener that is invoked when the user clicks on an empty space in the day.Adds a listener that is invoked when the user clicks on an event.addEventMoveListener
(Consumer<Calendar.CalendarEventMoveEvent<V>> listener) Adds a listener that is invoked when the user changes an event position.Adds a listener that is invoked when the user changes an event duration.Adds a listener that is invoked when the user clicks forward navigation button.Adds a listener that is invoked when the user drag-marks day or time cells using mouse.addWeekClickListener
(Consumer<Calendar.CalendarWeekClickEvent<V>> listener) Adds a listener that is invoked when the user clicks on a week number.int
int
int
int
boolean
void
setDayNames
(Map<DayOfWeek, String> dayNames) Sets localized Calendar day names.void
setEndDate
(V date) Set end date for the calendar's range.void
setEventProvider
(CalendarEventProvider calendarEventProvider) Set the calendar event provider.void
setFirstDayOfWeek
(Integer dayOfWeek) Allows setting first day of week independent of Locale.void
setFirstVisibleDayOfWeek
(int firstDay) Set first day of the week to show.void
setFirstVisibleHourOfDay
(int firstHour) Set first hour of the day to show.void
setLastVisibleDayOfWeek
(int lastDay) Set last day of the week to show.void
setLastVisibleHourOfDay
(int lastHour) Set last hour of the day to show.void
setMonthNames
(Map<Month, String> monthNames) Sets localized Calendar month names.void
setNavigationButtonsVisible
(boolean value) Set visibility for the backward and forward buttons.void
setStartDate
(V date) Set start date for the calendar range.void
setTimeFormat
(Calendar.TimeFormat format) Set format for time.void
setTimeZone
(TimeZone zone) Set timezone.void
setWeeklyCaptionFormat
(String dateFormatPattern) Set date caption format for the weekly view.Methods inherited from interface io.jmix.ui.component.Component
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, isEnabled, isEnabledRecursive, isResponsive, isVisible, isVisibleRecursive, removeStyleName, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
Methods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrame
Methods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaption
Methods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescription
Methods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSet
Methods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled
Methods inherited from interface io.jmix.ui.component.HasDatatype
getDatatype, setDatatype
Methods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtml
Methods inherited from interface io.jmix.ui.component.HasHtmlSanitizer
isHtmlSanitizerEnabled, setHtmlSanitizerEnabled
-
Field Details
-
NAME
- See Also:
-
-
Method Details
-
setStartDate
Set start date for the calendar range. -
getStartDate
- Returns:
- the start date for the calendar range.
-
setEndDate
Set end date for the calendar's range. -
getEndDate
- Returns:
- the last date for the calendar range.
-
setTimeZone
Set timezone. -
getTimeZone
TimeZone getTimeZone()- Returns:
- timezone.
-
setTimeFormat
@StudioProperty(name="timeFormat", type=ENUMERATION, defaultValue="24H", options={"12H","24H"}) void setTimeFormat(Calendar.TimeFormat format) Set format for time. 12H/24H. -
getTimeFormat
Calendar.TimeFormat getTimeFormat()- Returns:
- enumeration of ite format.
-
setFirstVisibleDayOfWeek
@StudioProperty(name="firstVisibleDayOfWeek", defaultValue="1") @Min(1L) @Max(7L) void setFirstVisibleDayOfWeek(int firstDay) Set first day of the week to show. -
getFirstVisibleDayOfWeek
int getFirstVisibleDayOfWeek()- Returns:
- first showed day of the week.
-
setLastVisibleDayOfWeek
@StudioProperty(name="lastVisibleDayOfWeek", defaultValue="7") @Min(1L) @Max(7L) void setLastVisibleDayOfWeek(int lastDay) Set last day of the week to show. -
getLastVisibleDayOfWeek
int getLastVisibleDayOfWeek()- Returns:
- last showed day of the week.
-
setFirstVisibleHourOfDay
@StudioProperty(name="firstVisibleHourOfDay", defaultValue="0") @Min(0L) @Max(23L) void setFirstVisibleHourOfDay(int firstHour) Set first hour of the day to show. -
getFirstVisibleHourOfDay
int getFirstVisibleHourOfDay()- Returns:
- first showed hour of the day.
-
setLastVisibleHourOfDay
@StudioProperty(name="lastVisibleHourOfDay", defaultValue="23") @Min(0L) @Max(23L) void setLastVisibleHourOfDay(int lastHour) Set last hour of the day to show. -
getLastVisibleHourOfDay
int getLastVisibleHourOfDay()- Returns:
- last showed hour of the day.
-
setFirstDayOfWeek
Allows setting first day of week independent of Locale.Pass
null
to use a day of week defined by current locale.- Parameters:
dayOfWeek
- any of java.util.Calendar.SUNDAY ... java.util.Calendar.SATURDAY or null to revert to default first day of week by locale
-
setWeeklyCaptionFormat
@StudioProperty(name="weeklyCaptionFormat", type=DATE_FORMAT) void setWeeklyCaptionFormat(String dateFormatPattern) Set date caption format for the weekly view. -
getWeeklyCaptionFormat
String getWeeklyCaptionFormat()- Returns:
- date pattern of captions.
-
setEventProvider
Set the calendar event provider. Provider can contain calendar events.- Parameters:
calendarEventProvider
- an event provider with events- See Also:
-
getEventProvider
CalendarEventProvider getEventProvider()- Returns:
- calendar event provider.
-
getDayNames
- Returns:
DayOfWeek
values matched to localized day names
-
setDayNames
Sets localized Calendar day names.- Parameters:
dayNames
-DayOfWeek
values matched to localized day names
-
getMonthNames
- Returns:
Month
values matched to localized month names
-
setMonthNames
Sets localized Calendar month names.- Parameters:
monthNames
-Month
values matched to localized month names
-
addDateClickListener
Adds a listener that is invoked when the user clicks on a day number of the month.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
addEventClickListener
Adds a listener that is invoked when the user clicks on an event.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
addEventResizeListener
Adds a listener that is invoked when the user changes an event duration.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
addEventMoveListener
Adds a listener that is invoked when the user changes an event position.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
addWeekClickListener
Adds a listener that is invoked when the user clicks on a week number.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
addForwardClickListener
Adds a listener that is invoked when the user clicks forward navigation button.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
addBackwardClickListener
Adds a listener that is invoked when the user clicks backward navigation button.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
addRangeSelectListener
Adds a listener that is invoked when the user drag-marks day or time cells using mouse.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-
addDayClickListener
Adds a listener that is invoked when the user clicks on an empty space in the day.- Parameters:
listener
- a listener to add- Returns:
- a registration object for removing an event listener
-