Class 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 a IModelReference service. The name for this service can be found in the configuration with the wicket.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 IBehaviorServices. 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:
    Serialized Form
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addExtensionPoint​(String extension)  
      void bind​(IRenderService parent, String wicketId)
      Bind the component to the specified id.
      protected abstract AbstractRenderService.ExtensionPoint createExtensionPoint​(String extension)
      Create an extension point with the specified name.
      void focus​(IRenderService child)
      Set focus on the specified child.
      protected String getBundleName()  
      org.apache.wicket.Component getComponent()
      The Wicket Component that is added to the parent.
      protected IDialogService getDialogService()
      Utility method to retrieve the IDialogService} from the plugin framework.
      String getId()
      String getMarkupId​(boolean createIfDoesNotExist)  
      org.apache.wicket.model.IModel<T> getModel()  
      T getModelObject()  
      IObservable getObservable()
      The observable that the observer is interested in.
      IRenderService getParentService()
      The parent service for this render service.
      protected IPluginConfig getPluginConfig()
      The IPluginConfig that was used to create the service.
      protected IPluginContext getPluginContext()
      The IPluginContext that was used to create the service.
      protected ResourceBundleModel getResourceBundleModel​(String key, Locale locale)  
      UserSession getSession()  
      String getVariation()  
      boolean isActive()  
      protected void onAfterRender()  
      protected void onBeforeRender()  
      void onComponentTag​(org.apache.wicket.markup.ComponentTag tag)  
      void onComponentTagBody​(org.apache.wicket.markup.MarkupStream markupStream, org.apache.wicket.markup.ComponentTag openTag)  
      void onEvent​(Iterator event)
      Callback that is invoked when the observable sends events.
      protected void redraw()
      Utility method for subclasses to redraw the complete Panel.
      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)  
      void setModel​(org.apache.wicket.model.IModel<T> model)  
      void setModelObject​(T object)  
      void unbind()
      Releases the component.
      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 interface org.apache.wicket.IQueueRegion

        dequeue, newDequeueContext
    • Method Detail

      • getModel

        public org.apache.wicket.model.IModel<T> getModel()
      • getModelObject

        public T getModelObject()
      • setModel

        public final void setModel​(org.apache.wicket.model.IModel<T> model)
      • setModelObject

        public final void setModelObject​(T object)
      • isActive

        public boolean isActive()
      • setDefaultModel

        public org.apache.wicket.MarkupContainer setDefaultModel​(org.apache.wicket.model.IModel<?> model)
        Overrides:
        setDefaultModel in class org.apache.wicket.MarkupContainer
      • updateModel

        public final void updateModel​(org.apache.wicket.model.IModel model)
      • onEvent

        public void onEvent​(Iterator event)
        Description copied from interface: IObserver
        Callback that is invoked when the observable sends events. The iterator is guaranteed to be non-empty.
        Specified by:
        onEvent in interface IObserver<T>
      • getVariation

        public String getVariation()
        Overrides:
        getVariation in class org.apache.wicket.Component
      • redraw

        protected void redraw()
        Utility method for subclasses to redraw the complete Panel. 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

        protected void addExtensionPoint​(String extension)
      • removeExtensionPoint

        protected void removeExtensionPoint​(String name)
      • getDialogService

        protected IDialogService getDialogService()
        Utility method to retrieve the IDialogService} 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 class org.apache.wicket.Component
      • render

        public void render​(PluginRequestTarget target)
        Called after user events and JCR events have been handled, but before the rendering has started. Plugins can register Components 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 interface IRenderService
      • focus

        public void focus​(IRenderService child)
        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 interface IRenderService
        Parameters:
        child - The extension that requests focus. This parameter can be null, in which case the Component should set focus to itself.
      • getId

        public String getId()
        Specified by:
        getId in interface org.apache.wicket.request.component.IRequestableComponent
        Overrides:
        getId in class org.apache.wicket.Component
      • getMarkupId

        public String getMarkupId​(boolean createIfDoesNotExist)
        Overrides:
        getMarkupId in class org.apache.wicket.Component
      • getSession

        public UserSession getSession()
        Overrides:
        getSession in class org.apache.wicket.Component
      • bind

        public void bind​(IRenderService parent,
                         String wicketId)
        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 interface IRenderService
      • 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 interface IRenderService
      • getBundleName

        protected String getBundleName()
      • onBeforeRender

        protected void onBeforeRender()
        Overrides:
        onBeforeRender in class org.apache.wicket.Component
      • onAfterRender

        protected void onAfterRender()
        Overrides:
        onAfterRender in class org.apache.wicket.Component
      • onComponentTagBody

        public void onComponentTagBody​(org.apache.wicket.markup.MarkupStream markupStream,
                                       org.apache.wicket.markup.ComponentTag openTag)
        Overrides:
        onComponentTagBody in class org.apache.wicket.MarkupContainer