Class AbstractCalendar
- java.lang.Object
-
- org.apache.wicket.Component
-
- org.apache.wicket.markup.html.WebComponent
-
- org.wicketstuff.datetime.extensions.yui.calendar.AbstractCalendar
-
- All Implemented Interfaces:
Serializable,IEventSink,IEventSource,IFeedbackContributor,IConverterLocator,IMetadataContext<Serializable,Component>,IHeaderContributor,IRequestableComponent,IHierarchical<Component>,IClusterable
public abstract class AbstractCalendar extends WebComponent
Abstract calendar component based on the YUI (Yahoo User Interface library) javascript widget.Although this component by itself is fully functional, it doesn't do much other than just displaying the calendar. Hence, this class is abstract.
An easy way to build upon this component is to override
See YUI's calendar documentation for more info.#appendToInit(String, String, String, StringBuffer)and add event handlers etc. in the YUI widget's initialization function.- Author:
- eelcohillenius
- See Also:
DatePicker, Serialized Form
-
-
Field Summary
-
Fields 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
-
-
Constructor Summary
Constructors Constructor Description AbstractCalendar(String id)Construct.AbstractCalendar(String id, boolean contributeDependencies)Construct.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidappendToInit(String markupId, String javascriptId, String javascriptWidgetId, StringBuilder b)Append javascript to the initialization function for the YUI widget.protected voidconfigureWidgetProperties(Map<Object,Object> widgetProperties)Gives overriding classes the option of adding (or even changing/ removing) configuration properties for the javascript widget.StringgetJavaScriptId()Gets the id of the javascript widget.StringgetJavaScriptWidgetId()The name spaced id of the widget.voidrenderHead(IHeaderResponse response)-
Methods inherited from class org.apache.wicket.markup.html.WebComponent
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession, onRender
-
Methods 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, get, 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, 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, internalInitialize, 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, onComponentTagBody, onConfigure, onDetach, onEvent, onInitialize, onModelChanged, onModelChanging, onReAdd, onRemove, redirectToInterceptPage, remove, remove, render, renderComponentTag, rendered, renderPart, renderPlaceholderTag, replaceComponentTagBody, replaceWith, sameInnermostModel, sameInnermostModel, send, setAuto, setDefaultModel, setDefaultModelObject, setEnabled, setEscapeModelStrings, setFlag, setIgnoreAttributeModifier, setMarkup, setMarkupId, setMarkupIdImpl, setMetaData, setOutputMarkupId, setOutputMarkupPlaceholderTag, setParent, setRenderBodyOnly, setResponsePage, setResponsePage, setResponsePage, setVersioned, setVisibilityAllowed, setVisible, success, toString, toString, urlFor, urlFor, urlFor, urlForListener, urlForListener, visitParents, visitParents, warn, wrap
-
-
-
-
Constructor Detail
-
AbstractCalendar
public AbstractCalendar(String id)
Construct. Contributes packaged dependencies.- Parameters:
id- The component id
-
AbstractCalendar
public AbstractCalendar(String id, boolean contributeDependencies)
Construct.- Parameters:
id- The component idcontributeDependencies- Whether to contribute the packaged dependencies. Pass false in case you want to include the dependencies manually in your own page, e.g. when you want to keep them in your web application dir. To contribute yourself (in case you want to pass false), your page header should look like:<script type="text/javascript" src="yahoo.js"></script> <script type="text/javascript" src="dom.js"></script> <script type="text/javascript" src="event.js"></script> <script type="text/javascript" src="calendar.js"></script> <link rel="stylesheet" type="text/css" href="calendar.css" />
-
-
Method Detail
-
getJavaScriptId
public final String getJavaScriptId()
Gets the id of the javascript widget. Note that this is the non-namespaced id, so depending on what you want to do with it, you may need to prepend 'YAHOO.wicket.' to it. Or you can callgetJavaScriptWidgetId().- Returns:
- The javascript id
- See Also:
getJavaScriptWidgetId()
-
getJavaScriptWidgetId
public final String getJavaScriptWidgetId()
The name spaced id of the widget.- Returns:
- The widget id
- See Also:
getJavaScriptId()
-
appendToInit
protected void appendToInit(String markupId, String javascriptId, String javascriptWidgetId, StringBuilder b)
Append javascript to the initialization function for the YUI widget. Can be used by subclasses to conveniently extend configuration without having to write a separate contribution.- Parameters:
markupId- The markup id of the calendar componentjavascriptId- the non-name spaced javascript id of the widgetjavascriptWidgetId- the name space id of the widgetb- the buffer to append the script to
-
configureWidgetProperties
protected void configureWidgetProperties(Map<Object,Object> widgetProperties)
Gives overriding classes the option of adding (or even changing/ removing) configuration properties for the javascript widget. See the widget's documentation for the available options. If you want to override/ remove properties, you obviously should callsuper.configureWidgetProperties(properties).- Parameters:
widgetProperties- the current widget properties
-
renderHead
public void renderHead(IHeaderResponse response)
- Specified by:
renderHeadin interfaceIHeaderContributor- Overrides:
renderHeadin classComponent
-
-