Class Calendar
java.lang.Object
org.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
com.googlecode.wicket.jquery.core.JQueryContainer
com.googlecode.wicket.jquery.ui.calendar.Calendar
- All Implemented Interfaces:
com.googlecode.wicket.jquery.core.IJQueryWidget,ICalendarListener,Serializable,Iterable<org.apache.wicket.Component>,org.apache.wicket.event.IEventSink,org.apache.wicket.event.IEventSource,org.apache.wicket.feedback.IFeedbackContributor,org.apache.wicket.IConverterLocator,org.apache.wicket.IMetadataContext<Serializable,,org.apache.wicket.Component> org.apache.wicket.markup.html.IHeaderContributor,org.apache.wicket.request.component.IRequestableComponent,org.apache.wicket.util.IHierarchical<org.apache.wicket.Component>,org.apache.wicket.util.io.IClusterable
public class Calendar
extends com.googlecode.wicket.jquery.core.JQueryContainer
implements ICalendarListener
Provides calendar widget, based on the jQuery fullcalendar plugin.
- Author:
- Sebastien Briquet - sebfz1, Martin Grigorov - martin-g
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.googlecode.wicket.jquery.core.IJQueryWidget
com.googlecode.wicket.jquery.core.IJQueryWidget.JQueryWidget -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final com.googlecode.wicket.jquery.core.OptionsFields inherited from class com.googlecode.wicket.jquery.core.JQueryContainer
widgetBehaviorFields inherited from class org.apache.wicket.Component
ENABLE, FLAG_INITIALIZED, FLAG_RESERVED1, FLAG_RESERVED2, FLAG_RESERVED3, FLAG_RESERVED4, FLAG_RESERVED5, FLAG_RESERVED8, PARENT_PATH, PATH_SEPARATOR, RENDER, RFLAG_CONTAINER_DEQUEING, RFLAG_CONTAINER_HAS_REMOVALS -
Constructor Summary
ConstructorsConstructorDescriptionConstructorCalendar(String id, CalendarModel model) ConstructorCalendar(String id, CalendarModel model, com.googlecode.wicket.jquery.core.Options options) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSource(EventSource source) Adds aEventSource, can be aEventSource.GoogleCalendarGets the javascript statement which will be executed beforeICalendarListener.onEventDrop(AjaxRequestTarget, String, long, boolean)event is triggered
A common use case is to call therevertFunccallback to cancel the event.Gets the javascript statement which will be executed beforeICalendarListener.onEventResize(AjaxRequestTarget, String, long)event is triggered
A common use case is to call therevertFunccallback to cancel the event.getModel()Gets the calendar's modelbooleanIndicates whether a day can be clicked.
If true, theICalendarListener.onDayClick(AjaxRequestTarget, CalendarView, LocalDateTime, boolean)event will be triggered
Note:truewill enable the global 'editable' option totrue.booleanIndicates whether an event can be clicked.
If true, theICalendarListener.onEventClick(AjaxRequestTarget, CalendarView, String)event will be triggered
Note:truewill enable the global 'editable' option totrue.booleanIndicates whether the event can be dragged & dropped.booleanIndicates whether the event can be resized.booleanIndicates whether theICalendarListener.onObjectDrop(AjaxRequestTarget, String, LocalDateTime, boolean)event will be triggeredbooleanIndicates whether a cell can be selected.
If true, theICalendarListener.onSelect(AjaxRequestTarget, CalendarView, LocalDateTime, LocalDateTime, boolean)event will be triggeredbooleanIndicates whether theICalendarListener.onViewRender(AjaxRequestTarget, CalendarView, LocalDate, LocalDate)event will be triggeredprotected CalendarModelBehaviorGets a newCalendarModelBehaviorcom.googlecode.wicket.jquery.core.JQueryBehaviornewWidgetBehavior(String selector) seeIJQueryWidget.newWidgetBehavior(String)voidonConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior) voidonDayClick(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, LocalDateTime date, boolean allDay) Triggered when a calendar day is clicked
ICalendarListener.isDayClickEnabled()should return true for this event to be triggered.voidonEventClick(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, String eventId) Triggered when an event is clicked.
ICalendarListener.isEventClickEnabled()should return true for this event to be triggered.voidonEventDrop(org.apache.wicket.ajax.AjaxRequestTarget target, String eventId, long delta, boolean allDay) Triggered when an event is dropped (after being dragged).
ICalendarListener.isEventDropEnabled()should return true for this event to be triggered.voidonEventResize(org.apache.wicket.ajax.AjaxRequestTarget target, String eventId, long delta) Triggered when an event is dropped (after being dragged).
ICalendarListener.isEventResizeEnabled()should return true for this event to be triggered.protected voidvoidonObjectDrop(org.apache.wicket.ajax.AjaxRequestTarget target, String title, LocalDateTime date, boolean allDay) Triggered when an event-object is dropped.
ICalendarListener.isObjectDropEnabled()should return true for this event to be triggered.voidonSelect(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, LocalDateTime start, LocalDateTime end, boolean allDay) Triggered when an cell is selected.
ICalendarListener.isSelectable()should return true for this event to be triggered.voidonViewRender(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, LocalDate start, LocalDate end) Triggered when the calendar loads and every time a different date-range is displayed.
ICalendarListener.isViewRenderEnabled()should return true for this event to be triggered.voidrefresh(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler) Re-fetches and refreshes the events currently available in the selected view.Methods inherited from class com.googlecode.wicket.jquery.core.JQueryContainer
onBeforeRenderMethods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSessionMethods inherited from class org.apache.wicket.MarkupContainer
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, getRegionMarkup, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onComponentTagBody, onDetach, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, setDefaultModel, size, stream, streamChildren, toString, toString, visitChildren, visitChildrenMethods inherited from class org.apache.wicket.Component
add, addStateChange, beforeRender, canCallListener, canCallListenerAfterExpiry, checkComponentTag, checkComponentTagAttribute, checkHierarchyChange, clearOriginalDestination, configure, continueToOriginalDestination, createConverter, debug, detach, detachModel, detachModels, determineVisibility, error, exceptionMessage, fatal, findMarkupStream, findPage, findParent, findParentWithAssociatedMarkup, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getId, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMarkupTag, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSession, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, getVariation, hasBeenRendered, hasErrorMessage, hasFeedbackMessage, info, initModel, internalOnModelChanged, internalRenderComponent, internalRenderHead, isActionAuthorized, isAuto, isBehaviorAccepted, isEnableAllowed, isEnabled, isEnabledInHierarchy, isIgnoreAttributeModifier, isInitialized, isRenderAllowed, isRendering, isStateless, isVersioned, isVisibilityAllowed, isVisible, isVisibleInHierarchy, markRendering, modelChanged, modelChanging, newMarkupSourcingStrategy, onAfterRender, onBeforeRender, onComponentTag, onConfigure, onEvent, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderHead, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrapMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
options
protected final com.googlecode.wicket.jquery.core.Options options
-
-
Constructor Details
-
Calendar
Constructor- Parameters:
id- the markup idoptions- theOptions. Note that 'selectable' and 'selectHelper' options are set by overridingisSelectable()(default is false)
-
Calendar
Constructor- Parameters:
id- the markup idmodel- theCalendarModel
-
Calendar
Constructor- Parameters:
id- the markup idmodel- theCalendarModeloptions- theOptions. Note that 'selectable' and 'selectHelper' options are set by overridingisSelectable()(default is false)
-
-
Method Details
-
getModel
Gets the calendar's model- Returns:
- a
CalendarModel
-
addSource
Adds aEventSource, can be aEventSource.GoogleCalendar- Parameters:
source- theEventSource,
-
refresh
public void refresh(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler) Re-fetches and refreshes the events currently available in the selected view.- Parameters:
handler- theIPartialPageRequestHandler
-
isSelectable
public boolean isSelectable()Description copied from interface:ICalendarListenerIndicates whether a cell can be selected.
If true, theICalendarListener.onSelect(AjaxRequestTarget, CalendarView, LocalDateTime, LocalDateTime, boolean)event will be triggered- Specified by:
isSelectablein interfaceICalendarListener- Returns:
- false by default
-
isDayClickEnabled
public boolean isDayClickEnabled()Description copied from interface:ICalendarListenerIndicates whether a day can be clicked.
If true, theICalendarListener.onDayClick(AjaxRequestTarget, CalendarView, LocalDateTime, boolean)event will be triggered
Note:truewill enable the global 'editable' option totrue.- Specified by:
isDayClickEnabledin interfaceICalendarListener- Returns:
- false by default
- See Also:
-
isEventClickEnabled
public boolean isEventClickEnabled()Description copied from interface:ICalendarListenerIndicates whether an event can be clicked.
If true, theICalendarListener.onEventClick(AjaxRequestTarget, CalendarView, String)event will be triggered
Note:truewill enable the global 'editable' option totrue.- Specified by:
isEventClickEnabledin interfaceICalendarListener- Returns:
- false by default
- See Also:
-
isEventDropEnabled
public boolean isEventDropEnabled()Description copied from interface:ICalendarListenerIndicates whether the event can be dragged & dropped. If true, theICalendarListener.onEventDrop(AjaxRequestTarget, String, long, boolean)event will be triggered- Specified by:
isEventDropEnabledin interfaceICalendarListener- Returns:
- false by default
-
isEventResizeEnabled
public boolean isEventResizeEnabled()Description copied from interface:ICalendarListenerIndicates whether the event can be resized. If true, theICalendarListener.onEventResize(AjaxRequestTarget, String, long)event will be triggered- Specified by:
isEventResizeEnabledin interfaceICalendarListener- Returns:
- false by default
-
isObjectDropEnabled
public boolean isObjectDropEnabled()Description copied from interface:ICalendarListenerIndicates whether theICalendarListener.onObjectDrop(AjaxRequestTarget, String, LocalDateTime, boolean)event will be triggered- Specified by:
isObjectDropEnabledin interfaceICalendarListener- Returns:
- false by default
-
isViewRenderEnabled
public boolean isViewRenderEnabled()Description copied from interface:ICalendarListenerIndicates whether theICalendarListener.onViewRender(AjaxRequestTarget, CalendarView, LocalDate, LocalDate)event will be triggered- Specified by:
isViewRenderEnabledin interfaceICalendarListener- Returns:
- false by default
-
getEventDropPrecondition
Description copied from interface:ICalendarListenerGets the javascript statement which will be executed beforeICalendarListener.onEventDrop(AjaxRequestTarget, String, long, boolean)event is triggered
A common use case is to call therevertFunccallback to cancel the event.- Specified by:
getEventDropPreconditionin interfaceICalendarListener- Returns:
- the javascript statement, empty string by default
- See Also:
-
getEventResizePrecondition
Description copied from interface:ICalendarListenerGets the javascript statement which will be executed beforeICalendarListener.onEventResize(AjaxRequestTarget, String, long)event is triggered
A common use case is to call therevertFunccallback to cancel the event.- Specified by:
getEventResizePreconditionin interfaceICalendarListener- Returns:
- the javascript statement, empty string by default
- See Also:
-
onInitialize
protected void onInitialize()- Overrides:
onInitializein classcom.googlecode.wicket.jquery.core.JQueryContainer
-
onConfigure
public void onConfigure(com.googlecode.wicket.jquery.core.JQueryBehavior behavior) - Specified by:
onConfigurein interfacecom.googlecode.wicket.jquery.core.IJQueryWidget- Overrides:
onConfigurein classcom.googlecode.wicket.jquery.core.JQueryContainer
-
onSelect
public void onSelect(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, LocalDateTime start, LocalDateTime end, boolean allDay) Description copied from interface:ICalendarListenerTriggered when an cell is selected.
ICalendarListener.isSelectable()should return true for this event to be triggered.- Specified by:
onSelectin interfaceICalendarListener- Parameters:
target- theAjaxRequestTargetview- the current calendar viewstart- the event startLocalDateTimeend- the event endLocalDateTimeallDay- the event all-day property
-
onDayClick
public void onDayClick(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, LocalDateTime date, boolean allDay) Description copied from interface:ICalendarListenerTriggered when a calendar day is clicked
ICalendarListener.isDayClickEnabled()should return true for this event to be triggered.- Specified by:
onDayClickin interfaceICalendarListener- Parameters:
target- theAjaxRequestTargetview- the current calendar viewdate- the dayallDay- the event all-day property
-
onEventClick
public void onEventClick(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, String eventId) Description copied from interface:ICalendarListenerTriggered when an event is clicked.
ICalendarListener.isEventClickEnabled()should return true for this event to be triggered.- Specified by:
onEventClickin interfaceICalendarListener- Parameters:
target- theAjaxRequestTargetview- the current calendar vieweventId- theCalendarEventid
-
onEventDrop
public void onEventDrop(org.apache.wicket.ajax.AjaxRequestTarget target, String eventId, long delta, boolean allDay) Description copied from interface:ICalendarListenerTriggered when an event is dropped (after being dragged).
ICalendarListener.isEventDropEnabled()should return true for this event to be triggered.- Specified by:
onEventDropin interfaceICalendarListener- Parameters:
target- theAjaxRequestTargeteventId- theCalendarEventiddelta- the delta (time) with the original event dateallDay- the event all-day property
-
onEventResize
public void onEventResize(org.apache.wicket.ajax.AjaxRequestTarget target, String eventId, long delta) Description copied from interface:ICalendarListenerTriggered when an event is dropped (after being dragged).
ICalendarListener.isEventResizeEnabled()should return true for this event to be triggered.- Specified by:
onEventResizein interfaceICalendarListener- Parameters:
target- theAjaxRequestTargeteventId- theCalendarEventiddelta- the delta (time) with the original event date
-
onObjectDrop
public void onObjectDrop(org.apache.wicket.ajax.AjaxRequestTarget target, String title, LocalDateTime date, boolean allDay) Description copied from interface:ICalendarListenerTriggered when an event-object is dropped.
ICalendarListener.isObjectDropEnabled()should return true for this event to be triggered.- Specified by:
onObjectDropin interfaceICalendarListener- Parameters:
target- theAjaxRequestTargettitle- the titledate- the dayallDay- the event all-day property
-
onViewRender
public void onViewRender(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, LocalDate start, LocalDate end) Description copied from interface:ICalendarListenerTriggered when the calendar loads and every time a different date-range is displayed.
ICalendarListener.isViewRenderEnabled()should return true for this event to be triggered.- Specified by:
onViewRenderin interfaceICalendarListener- Parameters:
target- theAjaxRequestTargetview- the current calendar viewstart- the startLocalDateof the current viewend- the event endLocalDateof the current view
-
newWidgetBehavior
seeIJQueryWidget.newWidgetBehavior(String)- Specified by:
newWidgetBehaviorin interfacecom.googlecode.wicket.jquery.core.IJQueryWidget
-
newCalendarModelBehavior
Gets a newCalendarModelBehavior- Parameters:
model- theCalendarModel- Returns:
- the
CalendarModelBehavior
-