Package io.jmix.ui.component.impl
Class CalendarImpl<V>
- All Implemented Interfaces:
AttachNotifier,Calendar<V>,Component,Component.BelongToFrame,Component.HasCaption,Component.HasDescription,Component.HasIcon,Component.HasXmlDescriptor,Component.Wrapper,HasContextHelp,HasDatatype<V>,HasDebugId,HasHtmlCaption,HasHtmlDescription,HasHtmlSanitizer,org.springframework.beans.factory.InitializingBean
public class CalendarImpl<V>
extends AbstractComponent<JmixCalendar>
implements Calendar<V>, org.springframework.beans.factory.InitializingBean
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.ui.component.Calendar
Calendar.CalendarBackwardClickEvent<V>, Calendar.CalendarDateClickEvent<V>, Calendar.CalendarDayClickEvent<V>, Calendar.CalendarEventClickEvent<V>, Calendar.CalendarEventMoveEvent<V>, Calendar.CalendarEventResizeEvent<V>, Calendar.CalendarForwardClickEvent<V>, Calendar.CalendarRangeSelectEvent<V>, Calendar.CalendarWeekClickEvent<V>, Calendar.TimeFormatNested 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
FieldsModifier and TypeFieldDescriptionprotected CalendarEventProviderprotected DatatypeRegistryprotected DateTimeTransformationsprotected booleanprotected final Stringprotected final StringFields inherited from class io.jmix.ui.component.impl.AbstractComponent
alignment, applicationContext, component, contextHelpIconClickHandler, contextHelpIconClickListener, descriptionAsHtml, element, frame, htmlSanitizerEnabled, icon, ICON_STYLE, id, parentFields inherited from interface io.jmix.ui.component.Component
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE -
Constructor Summary
Constructors -
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.voidprotected DatecalculateNewEnd(com.vaadin.v7.ui.components.calendar.event.CalendarEvent calendarEvent, Date newStart) protected voidcheckDatatypeMismatch(Datatype datatype) protected VconvertToModel(Date date) protected DateconvertToPresentation(V date) protected JmixCalendarintintintintprotected MetaPropertyprotected voidinitComponent(JmixCalendar component) protected voidinitDefaultEventProvider(JmixCalendar component) protected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidprotected voidbooleanprotected voidonBackward(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.BackwardEvent event) protected voidonDateClick(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.DateClickEvent event) protected voidprotected voidonEventClick(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.EventClick event) protected voidonEventMove(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.MoveEvent event) protected voidonEventResize(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.EventResize event) protected voidonForward(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.ForwardEvent event) protected voidonRangeSelect(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.RangeSelectEvent event) protected voidonWeekClick(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.WeekClick event) voidsetDatatype(Datatype<V> datatype) Sets the givendatatypeto the component.voidsetDatatypeRegistry(DatatypeRegistry datatypeRegistry) voidsetDateTimeTransformations(DateTimeTransformations dateTimeTransformations) voidsetDayNames(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.protected voidsetNavigationButtonsStyle(boolean value) voidsetNavigationButtonsVisible(boolean value) Set visibility for the backward and forward buttons.voidsetStartDate(V date) Set start date for the calendar range.voidsetStyleName(String name) Sets one or more style names of the component, replacing any previous styles.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 class io.jmix.ui.component.impl.AbstractComponent
addAttachListener, addDetachListener, addStyleName, assignDebugId, attached, detached, getAlignment, getCaption, getComponent, getComposition, getContextHelpIconClickHandler, getContextHelpText, getDebugId, getDescription, getEventHub, getFrame, getHeight, getHeightSizeUnit, getHtmlSanitizer, getIcon, getIconName, getIconResource, getId, getParent, getStyleName, getUiComponentProperties, getUiProperties, getWidth, getWidthSizeUnit, getXmlDescriptor, hasSubscriptions, hasValidationError, isAttached, isCaptionAsHtml, isContextHelpTextHtmlEnabled, isDescriptionAsHtml, isEnabled, isEnabledRecursive, isHtmlSanitizerEnabled, isResponsive, isVisible, isVisibleRecursive, onContextHelpIconClick, publish, removeStyleName, sanitize, setAlignment, setApplicationContext, setCaption, setCaptionAsHtml, setContextHelpIconClickHandler, setContextHelpText, setContextHelpTextHtmlEnabled, setDebugId, setDescription, setDescriptionAsHtml, setEnabled, setFrame, setHeight, setHtmlSanitizerEnabled, setIcon, setIconFromSet, setId, setParent, setResponsive, setValidationError, setVisible, setWidth, setXmlDescriptor, unsubscribe, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedCompositionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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, 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.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
-
TIME_FORMAT_12H
- See Also:
-
TIME_FORMAT_24H
- See Also:
-
calendarEventProvider
-
dateTimeTransformations
-
datatypeRegistry
-
datatype
-
-
Constructor Details
-
CalendarImpl
public CalendarImpl()
-
-
Method Details
-
createComponent
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
initComponent
-
initDefaultEventProvider
-
setDateTimeTransformations
-
setDatatypeRegistry
-
setDatatype
Description copied from interface:HasDatatypeSets the givendatatypeto the component. Its value will be formatted according to this datatype.- Specified by:
setDatatypein interfaceHasDatatype<V>- Parameters:
datatype-Datatypeinstance
-
getDatatype
- Specified by:
getDatatypein interfaceHasDatatype<V>- Returns:
- a datatype that is used by this component
-
getDefaultDatatype
-
getMetaProperty
-
checkDatatypeMismatch
-
setStartDate
Description copied from interface:CalendarSet start date for the calendar range.- Specified by:
setStartDatein interfaceCalendar<V>
-
getStartDate
- Specified by:
getStartDatein interfaceCalendar<V>- Returns:
- the start date for the calendar range.
-
setEndDate
Description copied from interface:CalendarSet end date for the calendar's range.- Specified by:
setEndDatein interfaceCalendar<V>
-
getEndDate
- Specified by:
getEndDatein interfaceCalendar<V>- Returns:
- the last date for the calendar range.
-
convertToPresentation
-
convertToModel
-
setTimeZone
Description copied from interface:CalendarSet timezone.- Specified by:
setTimeZonein interfaceCalendar<V>
-
getTimeZone
- Specified by:
getTimeZonein interfaceCalendar<V>- Returns:
- timezone.
-
setTimeFormat
Description copied from interface:CalendarSet format for time. 12H/24H.- Specified by:
setTimeFormatin interfaceCalendar<V>
-
getTimeFormat
- Specified by:
getTimeFormatin interfaceCalendar<V>- Returns:
- enumeration of ite format.
-
setFirstVisibleDayOfWeek
public void setFirstVisibleDayOfWeek(int firstDay) Description copied from interface:CalendarSet first day of the week to show.- Specified by:
setFirstVisibleDayOfWeekin interfaceCalendar<V>
-
getFirstVisibleDayOfWeek
public int getFirstVisibleDayOfWeek()- Specified by:
getFirstVisibleDayOfWeekin interfaceCalendar<V>- Returns:
- first showed day of the week.
-
setLastVisibleDayOfWeek
public void setLastVisibleDayOfWeek(int lastDay) Description copied from interface:CalendarSet last day of the week to show.- Specified by:
setLastVisibleDayOfWeekin interfaceCalendar<V>
-
getLastVisibleDayOfWeek
public int getLastVisibleDayOfWeek()- Specified by:
getLastVisibleDayOfWeekin interfaceCalendar<V>- Returns:
- last showed day of the week.
-
setFirstVisibleHourOfDay
public void setFirstVisibleHourOfDay(int firstHour) Description copied from interface:CalendarSet first hour of the day to show.- Specified by:
setFirstVisibleHourOfDayin interfaceCalendar<V>
-
getFirstVisibleHourOfDay
public int getFirstVisibleHourOfDay()- Specified by:
getFirstVisibleHourOfDayin interfaceCalendar<V>- Returns:
- first showed hour of the day.
-
setLastVisibleHourOfDay
public void setLastVisibleHourOfDay(int lastHour) Description copied from interface:CalendarSet last hour of the day to show.- Specified by:
setLastVisibleHourOfDayin interfaceCalendar<V>
-
getLastVisibleHourOfDay
public int getLastVisibleHourOfDay()- Specified by:
getLastVisibleHourOfDayin interfaceCalendar<V>- Returns:
- last showed hour of the day.
-
setFirstDayOfWeek
Description copied from interface:CalendarAllows setting first day of week independent of Locale.Pass
nullto use a day of week defined by current locale.- Specified by:
setFirstDayOfWeekin interfaceCalendar<V>- 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
Description copied from interface:CalendarSet date caption format for the weekly view.- Specified by:
setWeeklyCaptionFormatin interfaceCalendar<V>
-
getWeeklyCaptionFormat
- Specified by:
getWeeklyCaptionFormatin interfaceCalendar<V>- Returns:
- date pattern of captions.
-
setEventProvider
Description copied from interface:CalendarSet the calendar event provider. Provider can contain calendar events.- Specified by:
setEventProviderin interfaceCalendar<V>- Parameters:
calendarEventProvider- an event provider with events- See Also:
-
addDateClickListener
Description copied from interface:CalendarAdds a listener that is invoked when the user clicks on a day number of the month.- Specified by:
addDateClickListenerin interfaceCalendar<V>- Parameters:
listener- a listener to add- Returns:
- a registration object for removing an event listener
-
onDateClick
protected void onDateClick(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.DateClickEvent event) -
internalRemoveDateClickListener
protected void internalRemoveDateClickListener(Consumer<Calendar.CalendarDateClickEvent<V>> listener) -
addEventClickListener
Description copied from interface:CalendarAdds a listener that is invoked when the user clicks on an event.- Specified by:
addEventClickListenerin interfaceCalendar<V>- Parameters:
listener- a listener to add- Returns:
- a registration object for removing an event listener
-
onEventClick
protected void onEventClick(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.EventClick event) -
internalRemoveEventClickListener
protected void internalRemoveEventClickListener(Consumer<Calendar.CalendarEventClickEvent<V>> listener) -
addEventResizeListener
Description copied from interface:CalendarAdds a listener that is invoked when the user changes an event duration.- Specified by:
addEventResizeListenerin interfaceCalendar<V>- Parameters:
listener- a listener to add- Returns:
- a registration object for removing an event listener
-
onEventResize
protected void onEventResize(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.EventResize event) -
internalRemoveEventResizeListener
protected void internalRemoveEventResizeListener(Consumer<Calendar.CalendarEventResizeEvent<V>> listener) -
addEventMoveListener
Description copied from interface:CalendarAdds a listener that is invoked when the user changes an event position.- Specified by:
addEventMoveListenerin interfaceCalendar<V>- Parameters:
listener- a listener to add- Returns:
- a registration object for removing an event listener
-
onEventMove
protected void onEventMove(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.MoveEvent event) -
calculateNewEnd
-
internalRemoveEventMoveListener
protected void internalRemoveEventMoveListener(Consumer<Calendar.CalendarEventMoveEvent<V>> listener) -
addWeekClickListener
Description copied from interface:CalendarAdds a listener that is invoked when the user clicks on a week number.- Specified by:
addWeekClickListenerin interfaceCalendar<V>- Parameters:
listener- a listener to add- Returns:
- a registration object for removing an event listener
-
onWeekClick
protected void onWeekClick(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.WeekClick event) -
internalRemoveWeekClickListener
protected void internalRemoveWeekClickListener(Consumer<Calendar.CalendarWeekClickEvent<V>> listener) -
addForwardClickListener
public Subscription addForwardClickListener(Consumer<Calendar.CalendarForwardClickEvent<V>> listener) Description copied from interface:CalendarAdds a listener that is invoked when the user clicks forward navigation button.- Specified by:
addForwardClickListenerin interfaceCalendar<V>- Parameters:
listener- a listener to add- Returns:
- a registration object for removing an event listener
-
onForward
protected void onForward(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.ForwardEvent event) -
internalRemoveForwardClickListener
protected void internalRemoveForwardClickListener(Consumer<Calendar.CalendarForwardClickEvent<V>> listener) -
addBackwardClickListener
public Subscription addBackwardClickListener(Consumer<Calendar.CalendarBackwardClickEvent<V>> listener) Description copied from interface:CalendarAdds a listener that is invoked when the user clicks backward navigation button.- Specified by:
addBackwardClickListenerin interfaceCalendar<V>- Parameters:
listener- a listener to add- Returns:
- a registration object for removing an event listener
-
onBackward
protected void onBackward(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.BackwardEvent event) -
internalRemoveBackwardClickListener
protected void internalRemoveBackwardClickListener(Consumer<Calendar.CalendarBackwardClickEvent<V>> listener) -
addRangeSelectListener
Description copied from interface:CalendarAdds a listener that is invoked when the user drag-marks day or time cells using mouse.- Specified by:
addRangeSelectListenerin interfaceCalendar<V>- Parameters:
listener- a listener to add- Returns:
- a registration object for removing an event listener
-
onRangeSelect
protected void onRangeSelect(com.vaadin.v7.ui.components.calendar.CalendarComponentEvents.RangeSelectEvent event) -
internalRemoveRangeSelectListener
protected void internalRemoveRangeSelectListener(Consumer<Calendar.CalendarRangeSelectEvent<V>> listener) -
addDayClickListener
Description copied from interface:CalendarAdds a listener that is invoked when the user clicks on an empty space in the day.- Specified by:
addDayClickListenerin interfaceCalendar<V>- Parameters:
listener- a listener to add- Returns:
- a registration object for removing an event listener
-
onDayClick
-
getEventProvider
- Specified by:
getEventProviderin interfaceCalendar<V>- Returns:
- calendar event provider.
-
setStyleName
Description copied from interface:ComponentSets one or more style names of the component, replacing any previous styles. Multiple styles can be specified as a space-separated list of style names. Styles implementation is client-type-specific.- Specified by:
setStyleNamein interfaceComponent- Overrides:
setStyleNamein classAbstractComponent<JmixCalendar>- Parameters:
name- one or more style names separated by space.
-
getDayNames
- Specified by:
getDayNamesin interfaceCalendar<V>- Returns:
DayOfWeekvalues matched to localized day names
-
setDayNames
Description copied from interface:CalendarSets localized Calendar day names.- Specified by:
setDayNamesin interfaceCalendar<V>- Parameters:
dayNames-DayOfWeekvalues matched to localized day names
-
getMonthNames
- Specified by:
getMonthNamesin interfaceCalendar<V>- Returns:
Monthvalues matched to localized month names
-
setMonthNames
Description copied from interface:CalendarSets localized Calendar month names.- Specified by:
setMonthNamesin interfaceCalendar<V>- Parameters:
monthNames-Monthvalues matched to localized month names
-