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
Nested ClassesModifier and TypeInterfaceDescriptionstatic classAn event object that is fired when the user clicks backward navigation button.static classAn event object that is fired when the user clicks on a day number of the month.static classAn event object that is fired when the user clicks on an empty space in the day.static classAn event object that is fired when the user clicks on an event.static classAn event object that is fired when the user changes an event position.static classAn event object that is fired when the user changes an event duration.static classAn event object that is fired when the user clicks forward navigation button.static classAn event object that is fired when the user drag-marks day or time cells using mouse.static classAn event object that is fired when the user clicks on a week number.static enumNested 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.WrapperNested classes/interfaces inherited from interface io.jmix.ui.component.HasContextHelp
HasContextHelp.ContextHelpIconClickEvent -
Field Summary
FieldsFields 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.intintintintbooleanvoidsetDayNames(Map<DayOfWeek, String> dayNames) Sets localized Calendar day names.voidsetEndDate(V date) Set end date for the calendar's range.voidsetEventProvider(CalendarEventProvider calendarEventProvider) Set the calendar event provider.voidsetFirstDayOfWeek(Integer dayOfWeek) Allows setting first day of week independent of Locale.voidsetFirstVisibleDayOfWeek(int firstDay) Set first day of the week to show.voidsetFirstVisibleHourOfDay(int firstHour) Set first hour of the day to show.voidsetLastVisibleDayOfWeek(int lastDay) Set last day of the week to show.voidsetLastVisibleHourOfDay(int lastHour) Set last hour of the day to show.voidsetMonthNames(Map<Month, String> monthNames) Sets localized Calendar month names.voidsetNavigationButtonsVisible(boolean value) Set visibility for the backward and forward buttons.voidsetStartDate(V date) Set start date for the calendar range.voidsetTimeFormat(Calendar.TimeFormat format) Set format for time.voidsetTimeZone(TimeZone zone) Set timezone.voidsetWeeklyCaptionFormat(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, withUnwrappedCompositionMethods inherited from interface io.jmix.ui.component.Component.BelongToFrame
getFrame, setFrameMethods inherited from interface io.jmix.ui.component.Component.HasCaption
getCaption, setCaptionMethods inherited from interface io.jmix.ui.component.Component.HasDescription
getDescription, setDescriptionMethods inherited from interface io.jmix.ui.component.Component.HasIcon
getIcon, setIcon, setIconFromSetMethods inherited from interface io.jmix.ui.component.HasContextHelp
getContextHelpIconClickHandler, getContextHelpText, isContextHelpTextHtmlEnabled, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabledMethods inherited from interface io.jmix.ui.component.HasDatatype
getDatatype, setDatatypeMethods inherited from interface io.jmix.ui.component.HasHtmlCaption
isCaptionAsHtml, setCaptionAsHtmlMethods inherited from interface io.jmix.ui.component.HasHtmlDescription
isDescriptionAsHtml, setDescriptionAsHtmlMethods 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
nullto 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:
DayOfWeekvalues matched to localized day names
-
setDayNames
Sets localized Calendar day names.- Parameters:
dayNames-DayOfWeekvalues matched to localized day names
-
getMonthNames
- Returns:
Monthvalues matched to localized month names
-
setMonthNames
Sets localized Calendar month names.- Parameters:
monthNames-Monthvalues 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
-