|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.tapestry.spec.BaseLocatable
org.apache.tapestry.AbstractComponent
org.apache.tapestry.BaseComponent
org.apache.tapestry.AbstractPage
public abstract class AbstractPage
Abstract base class implementing the IPage interface.
| Constructor Summary | |
|---|---|
AbstractPage()
Standard constructor; invokes initialize()
to configure initial values for properties
of the page. |
|
| Method Summary | |
|---|---|
void |
addPageDetachListener(PageDetachListener listener)
|
void |
addPageRenderListener(PageRenderListener listener)
|
void |
addPageValidateListener(PageValidateListener listener)
|
void |
attach(IEngine value)
Called by the engine to attach the page
to itself. |
void |
beginPageRender()
Invoked before a partial render of the page occurs (this happens when rewinding a Form
within the page). |
void |
beginResponse(IMarkupWriter writer,
IRequestCycle cycle)
Deprecated. To be removed in 3.1. Implement PageRenderListener instead. |
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 Form
within the page). |
protected void |
firePageBeginRender()
|
protected void |
firePageDetached()
|
protected void |
firePageEndRender()
|
protected void |
firePageValidate()
|
ChangeObserver |
getChangeObserver()
Return's the page's change observer. |
IEngine |
getEngine()
Returns the IEngine that the page is currently
attached to. |
String |
getExtendedId()
Returns the name of the page. |
Object |
getGlobal()
Convienience methods, simply invokes IEngine.getGlobal(). |
String |
getIdPath()
Pages always return null for idPath. |
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(String path)
Returns a particular component from within the page. |
protected String |
getOutputEncoding()
Returns the output encoding to be used when rendering this page. |
String |
getPageName()
Returns the fully qualified name of the page, including its namespace prefix, if any. |
IRequestCycle |
getRequestCycle()
Returns the current IRequestCycle. |
abstract IMarkupWriter |
getResponseWriter(OutputStream out)
Implemented in subclasses to provide a particular kind of response writer (and therefore, a particular kind of content). |
Object |
getVisit()
Returns the visit object obtained from the engine via IEngine.getVisit(IRequestCycle). |
protected void |
initialize()
Method invoked from the constructor, and from detach() to (re-)initialize properties
of the page. |
void |
removePageDetachListener(PageDetachListener listener)
|
void |
removePageRenderListener(PageRenderListener listener)
|
void |
removePageValidateListener(PageValidateListener listener)
|
void |
renderPage(IMarkupWriter writer,
IRequestCycle cycle)
Invokes PageRenderListener.pageBeginRender(PageEvent)
Invokes beginResponse(IMarkupWriter, IRequestCycle)
Invokes IRequestCycle.commitPageChanges() (if not rewinding)
Invokes AbstractComponent.render(IMarkupWriter, IRequestCycle)
Invokes PageRenderListener.pageEndRender(PageEvent) (this occurs
even if a previous step throws an exception) |
void |
setChangeObserver(ChangeObserver value)
|
void |
setLocale(Locale value)
Updates the page's locale. |
void |
setPageName(String pageName)
Sets the name of the page. |
void |
setRequestCycle(IRequestCycle value)
Invoked by the IRequestCycle to inform the page of the cycle,
as it is loaded. |
void |
validate(IRequestCycle cycle)
By default, pages are not protected and this method does nothing. |
| Methods inherited from class org.apache.tapestry.BaseComponent |
|---|
addOuter, finishLoad, renderComponent |
| Methods inherited from class org.apache.tapestry.spec.BaseLocatable |
|---|
getLocation, setLocation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.tapestry.IComponent |
|---|
addAsset, addBody, addComponent, finishLoad, getAsset, getAssets, getBinding, getBindingNames, getBindings, getComponent, getComponents, getContainer, getId, getMessage, getMessages, getNamespace, getPage, getProperty, getSpecification, getString, renderBody, setBinding, setContainer, setId, setNamespace, setPage, setProperty, setSpecification |
| Methods inherited from interface org.apache.tapestry.IRender |
|---|
render |
| Methods inherited from interface org.apache.tapestry.ILocationHolder |
|---|
setLocation |
| Methods inherited from interface org.apache.tapestry.ILocatable |
|---|
getLocation |
| Constructor Detail |
|---|
public AbstractPage()
initialize()
to configure initial values for properties
of the page.
| Method Detail |
|---|
public abstract IMarkupWriter getResponseWriter(OutputStream out)
getResponseWriter in interface IPagepublic 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 IPageIPageSource.releasePage(IPage)protected 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).
public IEngine getEngine()
IPageIEngine that the page is currently
attached to.
getEngine in interface IPagepublic ChangeObserver getChangeObserver()
AbstractComponentIPageRecorder.
getChangeObserver in interface IPagegetChangeObserver in class AbstractComponentIPage.getChangeObserver()public String getExtendedId()
getExtendedId in interface IComponentgetExtendedId in class AbstractComponentAbstractComponent.getIdPath()public String getIdPath()
getIdPath in interface IComponentgetIdPath in class AbstractComponentIComponent.getId()public Locale getLocale()
getLocale in interface IPagepublic void setLocale(Locale value)
IPageApplicationRuntimeException.
setLocale in interface IPagepublic IComponent getNestedComponent(String path)
IPage
getNestedComponent in interface IPagepublic void attach(IEngine value)
engine to attach the page
to itself. Does
not change the locale, but since a page is selected
from the IPageSource pool based on its
locale matching the engine's locale, they should match
anyway.
attach in interface IPage
public void renderPage(IMarkupWriter writer,
IRequestCycle cycle)
PageRenderListener.pageBeginRender(PageEvent)
beginResponse(IMarkupWriter, IRequestCycle)
IRequestCycle.commitPageChanges() (if not rewinding)
AbstractComponent.render(IMarkupWriter, IRequestCycle)
PageRenderListener.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(String pageName)
IPage
setPageName in interface IPagepageName - fully qualified page name (including namespace prefix, if any)public void validate(IRequestCycle cycle)
validate in interface IPage
public void beginResponse(IMarkupWriter writer,
IRequestCycle cycle)
PageRenderListener instead.
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 void setRequestCycle(IRequestCycle value)
IPageIRequestCycle to inform the page of the cycle,
as it is loaded.
setRequestCycle in interface IPagepublic Object getVisit()
IEngine.getVisit(IRequestCycle).
getVisit in interface IPagepublic Object getGlobal()
IEngine.getGlobal().
getGlobal in interface IPagepublic void addPageDetachListener(PageDetachListener listener)
addPageDetachListener in interface IPagepublic void addPageRenderListener(PageRenderListener listener)
addPageRenderListener 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()
IPageForm
within the page). The page is expected to fire appopriate
events.
beginPageRender in interface IPagepublic void endPageRender()
IPageForm
within the page). The page is expected to fire
appropriate events.
endPageRender in interface IPagepublic String getPageName()
IPage
getPageName in interface IPagepublic void addPageValidateListener(PageValidateListener listener)
addPageValidateListener in interface IPagepublic void removePageValidateListener(PageValidateListener listener)
removePageValidateListener in interface IPageprotected void firePageValidate()
protected String getOutputEncoding()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||