Class AbstractRenderService<T>
java.lang.Object
org.apache.wicket.Component
org.apache.wicket.MarkupContainer
org.apache.wicket.markup.html.WebMarkupContainer
org.apache.wicket.markup.html.panel.Panel
org.hippoecm.frontend.service.render.AbstractRenderService<T>
- All Implemented Interfaces:
Serializable
,Iterable<org.apache.wicket.Component>
,EventListener
,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.IQueueRegion
,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
,IObserver
,IRenderService
- Direct Known Subclasses:
ListRenderService
,RenderService
public abstract class AbstractRenderService<T>
extends org.apache.wicket.markup.html.panel.Panel
implements IObserver, IRenderService
Utility class that bundles a lot of the functionality needed for visual plugins. It registers an
IRenderService
, with itself as the Component
.
The configuration parameters are as follows, with the class of the expected service between brackets:
- wicket.model (IModelReference)
The
IModel
that is available with the getModel() method, is the model that is provided by aIModelReference
service. The name for this service can be found in the configuration with thewicket.model
key. When the model is changed with setModel(), this change is propagated to the IModelReference service. When another plugin changes the model or the model object changes, the Component#onModelChanged() method is invoked. It is recommended to override this method to respond to changes. - wicket.id (IRenderService)
The primary task of the RenderPlugin is to provide an
IRenderService
implementation. - wicket.extensions (IRenderService) A list of service names for child render services. These child services will be added to the plugin directly.
- wicket.behavior
A list of service names for
IBehaviorService
s. The behaviors that are exposed by these services are added to the Component. - wicket.variant (Layout) The layout variantion to use. In contrast with Wickets default, the variation is not inherited from the parent.
- wicket.skin (CSS stylesheet) An array of stylesheets that will be added to the HTML head.
- wicket.css (CSS)
An array of CSS class names that will be added to the
Component
that is provided by this render service. - wicket.feedback (Feedback) The feedback service id. When specified, a IFeedbackMessageFilter that accepts messages generated by the component is registered with this id.
- wicket.feedback.scope (FeedbackScope) The feedback reporting scope. Only messages with the configured scope will be reported by the registered message filter.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected class
Base class for extension points. -
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected final LinkedHashMap<String,
AbstractRenderService<T>.ExtensionPoint> static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class org.apache.wicket.markup.html.panel.Panel
PANEL
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, RFLAG_CONTAINER_HAS_REMOVALS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addExtensionPoint
(String extension) void
bind
(IRenderService parent, String wicketId) Bind the component to the specified id.protected abstract AbstractRenderService<T>.ExtensionPoint
createExtensionPoint
(String extension) Create an extension point with the specified name.void
focus
(IRenderService child) Set focus on the specified child.protected String
org.apache.wicket.Component
The WicketComponent
that is added to the parent.protected IDialogService
Utility method to retrieve theIDialogService
} from the plugin framework.getId()
getMarkupId
(boolean createIfDoesNotExist) org.apache.wicket.model.IModel<T>
getModel()
The observable that the observer is interested in.The parent service for this render service.protected IPluginConfig
TheIPluginConfig
that was used to create the service.protected IPluginContext
TheIPluginContext
that was used to create the service.protected final ResourceBundleModel
getResourceBundleModel
(String key, Locale locale) boolean
isActive()
protected void
protected void
void
onComponentTag
(org.apache.wicket.markup.ComponentTag tag) void
onComponentTagBody
(org.apache.wicket.markup.MarkupStream markupStream, org.apache.wicket.markup.ComponentTag openTag) void
Callback that is invoked when the observable sends events.protected void
redraw()
Utility method for subclasses to redraw the completePanel
.protected void
removeExtensionPoint
(String name) void
render
(PluginRequestTarget target) Called after user events and JCR events have been handled, but before the rendering has started.org.apache.wicket.MarkupContainer
setDefaultModel
(org.apache.wicket.model.IModel<?> model) final void
final void
setModelObject
(T object) void
unbind()
Releases the component.final void
updateModel
(org.apache.wicket.model.IModel model) Methods inherited from class org.apache.wicket.markup.html.panel.Panel
getRegionMarkup, newMarkupSourcingStrategy
Methods inherited from class org.apache.wicket.markup.html.WebMarkupContainer
getWebApplication, getWebPage, getWebRequest, getWebResponse, getWebSession
Methods inherited from class org.apache.wicket.MarkupContainer
add, addDequeuedComponent, addOrReplace, autoAdd, canDequeueTag, contains, dequeue, dequeue, dequeuePreamble, findChildComponent, findComponentToDequeue, get, getAssociatedMarkup, getAssociatedMarkupStream, getMarkup, getMarkupType, internalAdd, internalInitialize, iterator, iterator, newDequeueContext, onDetach, onInitialize, onRender, queue, remove, remove, removeAll, renderAll, renderAssociatedMarkup, renderNext, replace, size, stream, streamChildren, toString, toString, visitChildren, visitChildren
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, getAjaxRegionMarkupId, getApplication, getBehaviorById, getBehaviorId, getBehaviors, getBehaviors, getClassRelativePath, getConverter, getDefaultModel, getDefaultModelObject, getDefaultModelObjectAsString, getDefaultModelObjectAsString, getEscapeModelStrings, getFeedbackMessages, getFlag, getInnermostModel, getInnermostModel, getLocale, getLocalizer, getMarkup, getMarkupAttributes, getMarkupId, getMarkupIdFromMarkup, getMarkupIdImpl, getMarkupSourcingStrategy, getMarkupTag, getMetaData, getModelComparator, getOutputMarkupId, getOutputMarkupPlaceholderTag, getPage, getPageRelativePath, getParent, getPath, getRenderBodyOnly, getRequest, getRequestCycle, getRequestFlag, getResponse, getSizeInBytes, getStatelessHint, getString, getString, getString, getStyle, 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, 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, wrap
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.wicket.IQueueRegion
dequeue, newDequeueContext
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
WICKET_ID
- See Also:
-
MODEL_ID
- See Also:
-
VARIANT_ID
- See Also:
-
SKIN_ID
- See Also:
-
CSS_ID
- See Also:
-
EXTENSIONS_ID
- See Also:
-
FEEDBACK
- See Also:
-
FEEDBACK_SCOPE
- See Also:
-
BEHAVIOR
- See Also:
-
VISIBLE
- See Also:
-
DEFAULT_LOCALE
- See Also:
-
children
-
-
Constructor Details
-
AbstractRenderService
-
-
Method Details
-
getModel
-
getModelObject
-
setModel
-
setModelObject
-
isActive
public boolean isActive() -
setDefaultModel
public org.apache.wicket.MarkupContainer setDefaultModel(org.apache.wicket.model.IModel<?> model) - Overrides:
setDefaultModel
in classorg.apache.wicket.MarkupContainer
-
updateModel
public final void updateModel(org.apache.wicket.model.IModel model) -
getObservable
Description copied from interface:IObserver
The observable that the observer is interested in. This observable may not change, w.r.t. theIObservable.equals(java.lang.Object)
method, while the observer is registered.- Specified by:
getObservable
in interfaceIObserver<T>
-
onEvent
Description copied from interface:IObserver
Callback that is invoked when the observable sends events. The iterator is guaranteed to be non-empty. -
getVariation
- Overrides:
getVariation
in classorg.apache.wicket.Component
-
getPluginContext
TheIPluginContext
that was used to create the service. -
getPluginConfig
TheIPluginConfig
that was used to create the service. -
redraw
protected void redraw()Utility method for subclasses to redraw the completePanel
. When invoked during request processing or event handling, the service will be rendered during the rendering phase.For more fine-grained redrawing, subclasses should override the
render(PluginRequestTarget)
method. -
addExtensionPoint
-
createExtensionPoint
Create an extension point with the specified name. -
removeExtensionPoint
-
getDialogService
Utility method to retrieve theIDialogService
} from the plugin framework. The dialog service is guaranteed to be available. -
onComponentTag
public void onComponentTag(org.apache.wicket.markup.ComponentTag tag) - Overrides:
onComponentTag
in classorg.apache.wicket.Component
-
getComponent
public org.apache.wicket.Component getComponent()The WicketComponent
that is added to the parent. The component must have the id that was set with theIRenderService.bind(IRenderService, String)
method.- Specified by:
getComponent
in interfaceIRenderService
-
render
Called after user events and JCR events have been handled, but before the rendering has started. Plugins can registerComponent
s with the request target to enlist in the rendering phase.Implementations that use extensions must call the same method on those.
- Specified by:
render
in interfaceIRenderService
-
focus
Set focus on the specified child. Implementations should make the child visible when they themselves are visible, or become visible later.- Specified by:
focus
in interfaceIRenderService
- Parameters:
child
- The extension that requests focus. This parameter can be null, in which case the Component should set focus to itself.
-
getId
- Specified by:
getId
in interfaceorg.apache.wicket.request.component.IRequestableComponent
- Overrides:
getId
in classorg.apache.wicket.Component
-
getMarkupId
- Overrides:
getMarkupId
in classorg.apache.wicket.Component
-
getSession
- Overrides:
getSession
in classorg.apache.wicket.Component
-
bind
Description copied from interface:IRenderService
Bind the component to the specified id. Provides the render service with a reference to the parent render service.- Specified by:
bind
in interfaceIRenderService
-
unbind
public void unbind()Description copied from interface:IRenderService
Releases the component. Implementations cannot use the parent reference after this method has been invoked.- Specified by:
unbind
in interfaceIRenderService
-
getParentService
The parent service for this render service.- Specified by:
getParentService
in interfaceIRenderService
-
getResourceBundleModel
-
getBundleName
-
onBeforeRender
protected void onBeforeRender()- Overrides:
onBeforeRender
in classorg.apache.wicket.Component
-
onAfterRender
protected void onAfterRender()- Overrides:
onAfterRender
in classorg.apache.wicket.Component
-
onComponentTagBody
public void onComponentTagBody(org.apache.wicket.markup.MarkupStream markupStream, org.apache.wicket.markup.ComponentTag openTag) - Overrides:
onComponentTagBody
in classorg.apache.wicket.MarkupContainer
-