com.googlecode.wicket.jquery.ui.calendar
Class CalendarBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
          extended by com.googlecode.wicket.jquery.core.JQueryBehavior
              extended by com.googlecode.wicket.jquery.ui.calendar.CalendarBehavior
All Implemented Interfaces:
IJQueryAjaxAware, Serializable, org.apache.wicket.IClusterable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor

public abstract class CalendarBehavior
extends JQueryBehavior
implements IJQueryAjaxAware

Provides the jQuery fullCalendar behavior

Author:
Sebastien Briquet - sebfz1
See Also:
Serialized Form

Nested Class Summary
protected static class CalendarBehavior.ClickEvent
          An event object that will be broadcasted when the user clicks on an event
protected static class CalendarBehavior.DayClickEvent
          An event object that will be broadcasted when the user clicks on a day cell
protected static class CalendarBehavior.DeltaEvent
          A base event object that contains a delta time
protected static class CalendarBehavior.DropEvent
          An event object that will be broadcasted when the user moves (drag & drop) an event
protected static class CalendarBehavior.ResizeEvent
          An event object that will be broadcasted when the user resizes an event
protected static class CalendarBehavior.SelectEvent
          An event object that will be broadcasted when the user select a cell range
 
Field Summary
 
Fields inherited from class com.googlecode.wicket.jquery.core.JQueryBehavior
method, options, selector
 
Constructor Summary
CalendarBehavior(String selector)
           
CalendarBehavior(String selector, Options options)
           
 
Method Summary
 void bind(org.apache.wicket.Component component)
           
 boolean isEditable()
          Indicates whether the event can be edited (ie, clicked).
IIF true, an event can override this global setting to false by using CalendarEvent#setEditable(boolean);
If true, the onEventClick(AjaxRequestTarget, CalendarView, int) event and onDayClick(AjaxRequestTarget, CalendarView, Date) event will be triggered
 boolean isEventDropEnabled()
          Indicates whether the event can be dragged & dropped.
 boolean isEventResizeEnabled()
          Indicates whether the event can be resized.
 boolean isSelectable()
          Indicated whether a cell can be selected.
If true, the onSelect(AjaxRequestTarget, CalendarView, Date, Date, boolean) event will be triggered
protected  JQueryAjaxBehavior newOnDayClickBehavior()
          Gets the ajax behavior that will be triggered when the user clicks on a day cell
protected  JQueryAjaxBehavior newOnEventClickBehavior()
          Gets the ajax behavior that will be triggered when the user clicks on an event
protected  JQueryAjaxBehavior newOnEventDropBehavior()
          Gets the ajax behavior that will be triggered when the user moves (drag & drop) an event
protected  JQueryAjaxBehavior newOnEventResizeBehavior()
          Gets the ajax behavior that will be triggered when the user resizes an event
protected  JQueryAjaxBehavior newOnSelectBehavior()
          Gets the ajax behavior that will be triggered when the user select a cell range
 void onAjax(org.apache.wicket.ajax.AjaxRequestTarget target, JQueryEvent event)
           
 void onConfigure(org.apache.wicket.Component component)
           
 void onDayClick(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, Date date)
          Triggered when a calendar day is clicked
 void onEventClick(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, int eventId)
          Triggered when an event is clicked.
isEditable() should return true for this event to be triggered.
 void onEventDrop(org.apache.wicket.ajax.AjaxRequestTarget target, int eventId, long delta, boolean allDay)
          Triggered when an event is dropped (after being dragged).
isEventDropEnabled() should return true for this event to be triggered.
 void onEventResize(org.apache.wicket.ajax.AjaxRequestTarget target, int eventId, long delta)
          Triggered when an event is dropped (after being dragged).
isEventResizeEnabled() should return true for this event to be triggered.
 void onSelect(org.apache.wicket.ajax.AjaxRequestTarget target, CalendarView view, Date start, Date end, boolean allDay)
          Triggered when an cell is selected.
isSelectable() should return true for this event to be triggered.
 void renderHead(org.apache.wicket.Component component, org.apache.wicket.markup.html.IHeaderResponse response)
           
 
Methods inherited from class com.googlecode.wicket.jquery.core.JQueryBehavior
$, $, $, getOption, on, on, setOption, setOptions
 
Methods inherited from class com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
add, beforeRender, toString
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, canCallListenerInterface, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onEvent, onException, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CalendarBehavior

public CalendarBehavior(String selector)

CalendarBehavior

public CalendarBehavior(String selector,
                        Options options)
Method Detail

bind

public void bind(org.apache.wicket.Component component)
Overrides:
bind in class org.apache.wicket.behavior.Behavior

renderHead

public void renderHead(org.apache.wicket.Component component,
                       org.apache.wicket.markup.html.IHeaderResponse response)
Specified by:
renderHead in interface org.apache.wicket.markup.html.IComponentAwareHeaderContributor
Overrides:
renderHead in class JQueryBehavior

onConfigure

public void onConfigure(org.apache.wicket.Component component)
Overrides:
onConfigure in class org.apache.wicket.behavior.Behavior

onAjax

public void onAjax(org.apache.wicket.ajax.AjaxRequestTarget target,
                   JQueryEvent event)
Specified by:
onAjax in interface IJQueryAjaxAware

newOnDayClickBehavior

protected JQueryAjaxBehavior newOnDayClickBehavior()
Gets the ajax behavior that will be triggered when the user clicks on a day cell

Returns:
the JQueryAjaxBehavior

newOnSelectBehavior

protected JQueryAjaxBehavior newOnSelectBehavior()
Gets the ajax behavior that will be triggered when the user select a cell range

Returns:
the JQueryAjaxBehavior

newOnEventClickBehavior

protected JQueryAjaxBehavior newOnEventClickBehavior()
Gets the ajax behavior that will be triggered when the user clicks on an event

Returns:
the JQueryAjaxBehavior

newOnEventDropBehavior

protected JQueryAjaxBehavior newOnEventDropBehavior()
Gets the ajax behavior that will be triggered when the user moves (drag & drop) an event

Returns:
the JQueryAjaxBehavior

newOnEventResizeBehavior

protected JQueryAjaxBehavior newOnEventResizeBehavior()
Gets the ajax behavior that will be triggered when the user resizes an event

Returns:
the JQueryAjaxBehavior

isEditable

public boolean isEditable()
Indicates whether the event can be edited (ie, clicked).
IIF true, an event can override this global setting to false by using CalendarEvent#setEditable(boolean);
If true, the onEventClick(AjaxRequestTarget, CalendarView, int) event and onDayClick(AjaxRequestTarget, CalendarView, Date) event will be triggered

Returns:
false by default

isSelectable

public boolean isSelectable()
Indicated whether a cell can be selected.
If true, the onSelect(AjaxRequestTarget, CalendarView, Date, Date, boolean) event will be triggered

Returns:
false by default

isEventDropEnabled

public boolean isEventDropEnabled()
Indicates whether the event can be dragged & dropped. If true, the onEventDrop(AjaxRequestTarget, int, long, boolean) event will be triggered

Returns:
false by default

isEventResizeEnabled

public boolean isEventResizeEnabled()
Indicates whether the event can be resized. If true, the onEventResize(AjaxRequestTarget, int, long) event will be triggered

Returns:
false by default

onSelect

public void onSelect(org.apache.wicket.ajax.AjaxRequestTarget target,
                     CalendarView view,
                     Date start,
                     Date end,
                     boolean allDay)
Triggered when an cell is selected.
isSelectable() should return true for this event to be triggered.

Parameters:
target - the AjaxRequestTarget
view - the current calendar view
start - the event start Date
end - the event end Date
allDay - the event all-day property

onDayClick

public void onDayClick(org.apache.wicket.ajax.AjaxRequestTarget target,
                       CalendarView view,
                       Date date)
Triggered when a calendar day is clicked

Parameters:
target - the AjaxRequestTarget
view - the current calendar view
date - the day

onEventClick

public void onEventClick(org.apache.wicket.ajax.AjaxRequestTarget target,
                         CalendarView view,
                         int eventId)
Triggered when an event is clicked.
isEditable() should return true for this event to be triggered.

Parameters:
target - the AjaxRequestTarget
view - the current calendar view
eventId - the CalendarEvent id

onEventDrop

public void onEventDrop(org.apache.wicket.ajax.AjaxRequestTarget target,
                        int eventId,
                        long delta,
                        boolean allDay)
Triggered when an event is dropped (after being dragged).
isEventDropEnabled() should return true for this event to be triggered.

Parameters:
target - the AjaxRequestTarget
eventId - the CalendarEvent id
delta - the delta (time) with the original event date
allDay - the event all-day property

onEventResize

public void onEventResize(org.apache.wicket.ajax.AjaxRequestTarget target,
                          int eventId,
                          long delta)
Triggered when an event is dropped (after being dragged).
isEventResizeEnabled() should return true for this event to be triggered.

Parameters:
target - the AjaxRequestTarget
eventId - the CalendarEvent id
delta - the delta (time) with the original event date


Copyright © 2013 7thWeb. All Rights Reserved.