Home » tapestry-src-5.0.19 » org.apache.tapestry5 » [javadoc | source]
org.apache.tapestry5
public interface: ComponentResources [javadoc | source]

All Implemented Interfaces:
    ComponentResourcesCommon

All Known Implementing Classes:
    InternalComponentResources, InternalComponentResourcesImpl

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 from org.apache.tapestry5.ComponentResources Summary:
addPageLifecycleListener,   createActionLink,   createEventLink,   createFormEventLink,   createPageLink,   createPageLink,   discardPersistentFieldChanges,   getAnnotationProvider,   getBaseResource,   getBlockParameter,   getBoundType,   getComponent,   getComponentModel,   getContainer,   getContainerMessages,   getContainerResources,   getElementName,   getEmbeddedComponent,   getInformalParameter,   getInformalParameterNames,   getMessages,   getPage,   getParameterAnnotation,   getRenderVariable,   isBound,   renderInformalParameters,   storeRenderVariable
Method from org.apache.tapestry5.ComponentResources Detail:
 public  void addPageLifecycleListener(PageLifecycleListener listener)
    Adds a listener object that will be notified about page lifecycle events.
 public Link createActionLink(String eventType,
    boolean forForm,
    Object context)Deprecated! Use -  #createEventLink(String, Object[])  instead

    Creates a component event request link as a callback for this component. The event type and context (as well as the page name and nested component id) will be encoded into a URL. A request for the URL will {@linkplain #triggerEvent(String, Object[], ComponentEventCallback)} trigger} the named event on the component.
 public Link createEventLink(String eventType,
    Object context)
    Creates a component event request link as a callback for this component. The event type and context (as well as the page name and nested component id) will be encoded into a URL. A request for the URL will {@linkplain #triggerEvent(String, Object[], ComponentEventCallback)} trigger} the named event on the component.
 public Link createFormEventLink(String eventType,
    Object context)
    Creates a component event request link as a callback for this component. The event type and context (as well as the page name and nested component id) will be encoded into a URL. A request for the URL will {@linkplain #triggerEvent(String, Object[], ComponentEventCallback)} trigger} the named event on the component. This is only used for form submission events, as extra data may be encoded in the form as hidden fields.
 public Link createPageLink(String pageName,
    boolean override,
    Object context)
    Creates a page render request link to render a specific page.
 public Link createPageLink(Class pageClass,
    boolean override,
    Object context)
    Creates a page render request link to render a specific page. Using a page class, rather than a page name, is more refactoring safe (in the even the page is renamed or moved).
 public  void discardPersistentFieldChanges()
    Discards all persistent field changes for the page containing the component. Changes are eliminated from persistent storage (such as the org.apache.tapestry5.services.Session ) which will take effect in the next request (the attached page instance is not affected).
 public AnnotationProvider getAnnotationProvider(String parameterName)
    Returns an annotation provider, used to obtain annotations related to the parameter.
 public 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).
 public Block getBlockParameter(String parameterName)
    Used to access an informal parameter that's a Block.
 public Class getBoundType(String parameterName)
    Returns the actual type of the bound parameter, or null if the parameter is not bound. This is primarily used with property bindings, and is used to determine the actual type of the property, rather than the type of parameter (remember that type coercion automatically occurs, which can mask significant differences between the parameter type and the bound property type).
 public Component getComponent()
    Returns the component this object provides resources for.
 public ComponentModel getComponentModel()
    Returns the component model object that defines the behavior of the component.
 public Component getContainer()
    Returns the component which contains this component, or null for the root component. For mixins, this returns the componet to which the mixin is attached.
 public Messages getContainerMessages()
    Returns the 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.
 public ComponentResources getContainerResources()
    Returns the 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.
 public String getElementName()
    Returns the name of element that represents the component in its template, or null if not known.
 public Component getEmbeddedComponent(String embeddedId)
    Returns an embedded component, given the component's id.
 public T getInformalParameter(String name,
    Class<T> type)
    Reads an informal parameter and {@linkplain org.apache.tapestry5.ioc.services.TypeCoercer coercers) the bound value to the indicated type.
 public List<String> getInformalParameterNames()
    Returns a list of the names of any informal parameters bound to this component.
 public Messages getMessages()
    Returns the message catalog for this component.
 public Component getPage()
    Returns the page that contains this component. Technically, the page itself is an internal object in Tapestry and this returns the root component of the actual page, but from an application developer point of view, this is the page.
 public T getParameterAnnotation(String parameterName,
    Class<T> annotationType)
    Obtains an annotation provided by a parameter.
 public Object getRenderVariable(String name)
    Returns a previously stored render variable.
 public boolean isBound(String parameterName)
    Returns true if the named parameter is bound, false if not.
 public  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.
 public  void storeRenderVariable(String name,
    Object value)
    Stores a render variable, accessible with the provided name.