|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ComponentResources
Provides a component instance with the resources provided by the framework. In many circumstances, the resources
object can be considered the component itself; in others, it is the component property, and
instance of a class provided by the application developer (though transformed in many ways while being loaded) that
is the true component. In reality, it is the combination of the resources object with the lifecycle instance.
| Method Summary | ||
|---|---|---|
void |
addPageLifecycleListener(PageLifecycleListener listener)
Adds a listener object that will be notified about page lifecycle events. |
|
Link |
createActionLink(String eventType,
boolean forForm,
Object... context)
Creates a component action request link as a callback for this component. |
|
Link |
createPageLink(String pageName,
boolean override,
Object... context)
Creates a render request link to a specific page. |
|
void |
discardPersistentFieldChanges()
Discards all persistent field changes for the page containing the component. |
|
AnnotationProvider |
getAnnotationProvider(String parameterName)
Returns an annotation provider, used to obtain annotations related to the parameter. |
|
Resource |
getBaseResource()
Returns the base resource for the component, which will represent the class's location within the classpath (this is used to resolve relative assets). |
|
Block |
getBlockParameter(String parameterName)
Used to access an informal parameter that's a Block. |
|
Class |
getBoundType(String parameterName)
Returns the actual type of the bound parameter, or null if the parameter is not bound. |
|
Component |
getComponent()
Returns the component this object provides resources for. |
|
ComponentModel |
getComponentModel()
Returns the component model object that defines the behavior of the component. |
|
Component |
getContainer()
Returns the component which contains this component, or null for the root component. |
|
Messages |
getContainerMessages()
Returns the Messages from the container, or null if this is the root component (with no container). |
|
ComponentResources |
getContainerResources()
Returns the ComponentResources for the container, or null if the this is the root component (that has no
container). |
|
String |
getElementName()
Returns the name of element that represents the component in its template, or null if not known. |
|
Component |
getEmbeddedComponent(String embeddedId)
Returns an embedded component, given the component's id. |
|
Messages |
getMessages()
Returns the message catalog for this component. |
|
Component |
getPage()
Returns the page that contains this component. |
|
|
getParameterAnnotation(String parameterName,
Class<T> annotationType)
Obtains an annotation provided by a parameter. |
|
Object |
getRenderVariable(String name)
Returns a previously stored render variable. |
|
boolean |
isBound(String parameterName)
Returns true if the named parameter is bound, false if not. |
|
void |
renderInformalParameters(MarkupWriter writer)
Indentifies all parameters that are not formal parameters and writes each as a attribute/value pair into the current element of the markup writer. |
|
void |
storeRenderVariable(String name,
Object value)
Stores a render variable, accessible with the provided name. |
|
| Methods inherited from interface org.apache.tapestry.ComponentResourcesCommon |
|---|
findBlock, getBlock, getCompleteId, getElementName, getId, getLocale, getLogger, getNestedId, getPageName, isRendering, triggerContextEvent, triggerEvent |
| Methods inherited from interface org.apache.tapestry.ioc.Locatable |
|---|
getLocation |
| Method Detail |
|---|
Resource getBaseResource()
ComponentModel getComponentModel()
Component getComponent()
Component getContainer()
ComponentResources getContainerResources()
ComponentResources for the container, or null if the this is the root component (that has no
container). As a special case, for a mixin, this returns the core component's resources.
Messages getContainerMessages()
Messages from the container, or null if this is the root component (with no container). As a
special case, for a mixin, this return the core component's messages.
Component getPage()
Component getEmbeddedComponent(String embeddedId)
embeddedId - selects the embedded component (case is ignored)
IllegalArgumentException - if this component does not contain a component with the given idboolean isBound(String parameterName)
<T extends Annotation> T getParameterAnnotation(String parameterName,
Class<T> annotationType)
parameterName - name of parameter to search for the annotationannotationType - the type of annotation
void renderInformalParameters(MarkupWriter writer)
writer - to which attributes will be writtenMessages getMessages()
Class getBoundType(String parameterName)
parameterName - used to select the parameter (case is ignored)
Binding.getBindingType()AnnotationProvider getAnnotationProvider(String parameterName)
parameterName - used to select the parameter (case is ignored)
Block getBlockParameter(String parameterName)
parameterName - the name of the informal parameter (case is ignored)
Object getRenderVariable(String name)
name - of the variable (case will be ignored)
IllegalArgumentException - if the name doesn't correspond to a stored value
void storeRenderVariable(String name,
Object value)
name - of value to storevalue - value to store (may not be null)
IllegalStateException - if the component is not currently renderingvoid addPageLifecycleListener(PageLifecycleListener listener)
Link createActionLink(String eventType,
boolean forForm,
Object... context)
eventType - the type of event to be triggered. Event types should be Java identifiers (contain only
letters, numbers and the underscore).forForm - if true, the link will be used as the eventType for an HTML form submission, which may affect
what information is encoded into the linkcontext - additional objects to be encoded into the path portion of the link; each is converted to a
string and URI encoded
Link createPageLink(String pageName,
boolean override,
Object... context)
pageName - the logical name of the page to link tooverride - if true, the context is used even if empty (normally, the target page is allowed to passivate,
providing a context, when the provided context is empty)context - the activation context for the page. If omitted, the activation context is obtained from the
target pagetvoid discardPersistentFieldChanges()
Session) which will take effect in the
next request (the attached page instance is not affected).
String getElementName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||