public abstract class AbstractPage extends BaseComponent implements IPage
IPageinterface.| Constructor and Description |
|---|
AbstractPage()
Standard constructor; invokes
initialize()to configure initial values for
properties of the page. |
| Modifier and Type | Method and Description |
|---|---|
void |
addPageAttachListener(PageAttachListener listener) |
void |
addPageBeginRenderListener(PageBeginRenderListener listener) |
void |
addPageDetachListener(PageDetachListener listener) |
void |
addPageEndRenderListener(PageEndRenderListener listener) |
void |
addPageRenderListener(PageRenderListener listener)
Deprecated.
|
void |
addPageValidateListener(PageValidateListener listener) |
void |
attach(IEngine engine,
IRequestCycle cycle)
Called by the
engineto attach the page to itself. |
void |
beginPageRender()
Invoked before a partial render of the page occurs (this happens when rewinding a
Formwithin the page). |
void |
beginResponse(IMarkupWriter writer,
IRequestCycle cycle)
Deprecated.
To be removed in 4.0. Implement
PageRenderListenerinstead. |
void |
detach()
Prepares the page to be returned to the pool.
|
void |
endPageRender()
Invoked after a partial render of the page occurs (this happens when rewinding a
Formwithin the page). |
void |
firePageAttached()
Used to explicitly fire
PageAttachListeners for this page. |
protected void |
firePageBeginRender() |
protected void |
firePageDetached() |
protected void |
firePageEndRender() |
protected void |
firePageValidate() |
ChangeObserver |
getChangeObserver()
Returns the object (effectively, an
IPageRecorder) that
is notified of any changes to persistant properties of the page. |
IEngine |
getEngine()
Returns the
IEnginethat the page is currently attached to. |
java.lang.String |
getExtendedId()
Returns the name of the page.
|
java.lang.Object |
getGlobal()
Deprecated.
|
java.lang.String |
getIdPath()
Pages always return null for idPath.
|
java.util.Locale |
getLocale()
Returns the locale for the page, which may be null if the locale is not known (null
corresponds to the "default locale").
|
IComponent |
getNestedComponent(java.lang.String path)
Returns a particular component from within the page.
|
protected java.lang.String |
getOutputEncoding()
Returns the output encoding to be used when rendering this page.
|
java.lang.String |
getPageName()
Returns the fully qualified name of the page, including its namespace prefix, if any.
|
IRequestCycle |
getRequestCycle()
Returns the current
IRequestCycle. |
java.lang.Object |
getVisit()
Deprecated.
|
protected void |
initialize()
Deprecated.
To be removed in 4.1 with no replacement.
|
void |
removePageAttachListener(PageAttachListener listener) |
void |
removePageBeginRenderListener(PageBeginRenderListener listener) |
void |
removePageDetachListener(PageDetachListener listener) |
void |
removePageEndRenderListener(PageEndRenderListener listener) |
void |
removePageRenderListener(PageRenderListener listener)
Deprecated.
|
void |
removePageValidateListener(PageValidateListener listener) |
void |
renderPage(IMarkupWriter writer,
IRequestCycle cycle)
Invokes
PageBeginRenderListener.pageBeginRender(PageEvent)
Invokes beginResponse(IMarkupWriter, IRequestCycle)
Invokes IRequestCycle.commitPageChanges()(if not rewinding)
Invokes AbstractComponent.render(IMarkupWriter, IRequestCycle)
Invokes PageEndRenderListener.pageEndRender(PageEvent)(this occurs even if a
previous step throws an exception) |
void |
setChangeObserver(ChangeObserver value) |
void |
setLocale(java.util.Locale value)
Updates the page's locale.
|
void |
setPageName(java.lang.String pageName)
Sets the name of the page.
|
void |
validate(IRequestCycle cycle)
By default, pages are not protected and this method does nothing.
|
addOuter, finishLoad, renderComponentaddAsset, addBody, addComponent, checkActiveLock, cleanupAfterRender, enterActiveState, finishLoad, format, format, format, format, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getBody, getBodyCount, getComponent, getComponents, getContainedComponent, getContainer, getId, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isInActiveState, isParameterBound, isRendering, pageEndRender, prepareForRender, render, renderBody, renderInformalParameters, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setProperty, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetResponseContentTypeaddAsset, addBody, addComponent, enterActiveState, finishLoad, getAsset, getAssets, getBeans, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainedComponent, getContainer, getId, getListeners, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, isRendering, renderBody, setBinding, setContainedComponent, setContainer, setId, setNamespace, setPage, setPropertypublic AbstractPage()
initialize()to configure initial values for
properties of the page.public void detach()
PageDetachListener.pageDetached(PageEvent)on all listeners
initialize()to clear/reset any properties
Subclasses may override this method, but must invoke this implementation (usually, last).
detach in interface IPagePageDetachListenerprotected void initialize()
detach()to (re-)initialize properties
of the page. This is most useful when properties have non-null initial values.
Subclasses may override this implementation (which is empty).
PageDetachListener,
PageAttachListenerpublic IEngine getEngine()
IPageIEnginethat the page is currently attached to.public ChangeObserver getChangeObserver()
IPageIPageRecorder) that
is notified of any changes to persistant properties of the page.getChangeObserver in interface IPagepublic java.lang.String getExtendedId()
getExtendedId in interface IComponentgetExtendedId in class AbstractComponentAbstractComponent.getIdPath()public java.lang.String getIdPath()
getIdPath in interface IComponentgetIdPath in class AbstractComponentIComponent.getId()public java.util.Locale getLocale()
public void setLocale(java.util.Locale value)
IPageApplicationRuntimeException.public IComponent getNestedComponent(java.lang.String path)
IPagegetNestedComponent in interface IPagepublic void attach(IEngine engine, IRequestCycle cycle)
engineto attach the page to itself. Does not change
the locale, but since a page is selected from the
IPageSourcepool based on its locale matching the engine's
locale, they should match anyway.public void renderPage(IMarkupWriter writer, IRequestCycle cycle)
PageBeginRenderListener.pageBeginRender(PageEvent)
beginResponse(IMarkupWriter, IRequestCycle)
IRequestCycle.commitPageChanges()(if not rewinding)
AbstractComponent.render(IMarkupWriter, IRequestCycle)
PageEndRenderListener.pageEndRender(PageEvent)(this occurs even if a
previous step throws an exception)renderPage in interface IPagepublic void setChangeObserver(ChangeObserver value)
setChangeObserver in interface IPagepublic void setPageName(java.lang.String pageName)
IPagesetPageName in interface IPagepageName - fully qualified page name (including namespace prefix, if any)public void validate(IRequestCycle cycle)
public void beginResponse(IMarkupWriter writer, IRequestCycle cycle)
PageRenderListenerinstead.beginResponse in interface IPagepublic IRequestCycle getRequestCycle()
IPageIRequestCycle. This is set when the page is loaded (or obtained
from the pool) and attached to the engine.getRequestCycle in interface IPagepublic java.lang.Object getVisit()
IEngine.getVisit(IRequestCycle).public java.lang.Object getGlobal()
IEngine.getGlobal().public void addPageDetachListener(PageDetachListener listener)
addPageDetachListener in interface IPagepublic void addPageRenderListener(PageRenderListener listener)
addPageRenderListener in interface IPagepublic void addPageBeginRenderListener(PageBeginRenderListener listener)
addPageBeginRenderListener in interface IPagepublic void addPageEndRenderListener(PageEndRenderListener listener)
addPageEndRenderListener in interface IPagepublic void removePageBeginRenderListener(PageBeginRenderListener listener)
removePageBeginRenderListener in interface IPagepublic void removePageEndRenderListener(PageEndRenderListener listener)
removePageEndRenderListener in interface IPagepublic void firePageAttached()
IPagePageAttachListeners for this page. This is used when a page
is first loaded; The page loader attaches the newly created page instance before
the rest of the page and components is loaded. In order to have meaningful event
notifications when a page is first loaded (rather than pulled from the pool), it is necessary
to fire page attach listeners at the end of the load.firePageAttached in interface IPageprotected void firePageDetached()
protected void firePageBeginRender()
protected void firePageEndRender()
public void removePageDetachListener(PageDetachListener listener)
removePageDetachListener in interface IPagepublic void removePageRenderListener(PageRenderListener listener)
removePageRenderListener in interface IPagepublic void beginPageRender()
IPageFormwithin the page). The page is expected to fire
appopriate events.beginPageRender in interface IPagepublic void endPageRender()
IPageFormwithin the page). The page is expected to fire
appropriate events.endPageRender in interface IPagepublic java.lang.String getPageName()
IPagegetPageName in interface IPagepublic void addPageValidateListener(PageValidateListener listener)
addPageValidateListener in interface IPagepublic void removePageValidateListener(PageValidateListener listener)
removePageValidateListener in interface IPagepublic void addPageAttachListener(PageAttachListener listener)
addPageAttachListener in interface IPagepublic void removePageAttachListener(PageAttachListener listener)
removePageAttachListener in interface IPageprotected void firePageValidate()
protected java.lang.String getOutputEncoding()