|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 IPage
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 IPage
IPageSource.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()
IPage
IEngine
that the page is currently
attached to.
getEngine
in interface IPage
public ChangeObserver getChangeObserver()
AbstractComponent
IPageRecorder
.
getChangeObserver
in interface IPage
getChangeObserver
in class AbstractComponent
IPage.getChangeObserver()
public String getExtendedId()
getExtendedId
in interface IComponent
getExtendedId
in class AbstractComponent
AbstractComponent.getIdPath()
public String getIdPath()
getIdPath
in interface IComponent
getIdPath
in class AbstractComponent
IComponent.getId()
public Locale getLocale()
getLocale
in interface IPage
public void setLocale(Locale value)
IPage
ApplicationRuntimeException
.
setLocale
in interface IPage
public IComponent getNestedComponent(String path)
IPage
getNestedComponent
in interface IPage
public 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 IPage
public void setChangeObserver(ChangeObserver value)
setChangeObserver
in interface IPage
public void setPageName(String pageName)
IPage
setPageName
in interface IPage
pageName
- 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 IPage
public IRequestCycle getRequestCycle()
IPage
IRequestCycle
. This is set when the
page is loaded (or obtained from the pool) and attached to the
engine
.
getRequestCycle
in interface IPage
public void setRequestCycle(IRequestCycle value)
IPage
IRequestCycle
to inform the page of the cycle,
as it is loaded.
setRequestCycle
in interface IPage
public Object getVisit()
IEngine.getVisit(IRequestCycle)
.
getVisit
in interface IPage
public Object getGlobal()
IEngine.getGlobal()
.
getGlobal
in interface IPage
public void addPageDetachListener(PageDetachListener listener)
addPageDetachListener
in interface IPage
public void addPageRenderListener(PageRenderListener listener)
addPageRenderListener
in interface IPage
protected void firePageDetached()
protected void firePageBeginRender()
protected void firePageEndRender()
public void removePageDetachListener(PageDetachListener listener)
removePageDetachListener
in interface IPage
public void removePageRenderListener(PageRenderListener listener)
removePageRenderListener
in interface IPage
public void beginPageRender()
IPage
Form
within the page). The page is expected to fire appopriate
events.
beginPageRender
in interface IPage
public void endPageRender()
IPage
Form
within the page). The page is expected to fire
appropriate events.
endPageRender
in interface IPage
public String getPageName()
IPage
getPageName
in interface IPage
public void addPageValidateListener(PageValidateListener listener)
addPageValidateListener
in interface IPage
public void removePageValidateListener(PageValidateListener listener)
removePageValidateListener
in interface IPage
protected void firePageValidate()
protected String getOutputEncoding()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |