Save This Page
Home » tapestry-src-5.0.19 » org.apache.tapestry5 » [javadoc | source]
public interface: ComponentResourcesCommon [javadoc | source]

All Implemented Interfaces:

All Known Implementing Classes:
    InternalComponentResources, ComponentPageElement, InternalComponentResourcesImpl, ComponentPageElementImpl, ComponentResources

Operations shared by the public org.apache.tapestry5.ComponentResources interface and org.apache.tapestry5.internal.structure.ComponentPageElement interface (on the internal side).
Method from org.apache.tapestry5.ComponentResourcesCommon Summary:
findBlock,   getBlock,   getBody,   getCompleteId,   getElementName,   getId,   getLocale,   getLogger,   getNestedId,   getPageName,   hasBody,   isRendering,   triggerContextEvent,   triggerEvent
Method from org.apache.tapestry5.ComponentResourcesCommon Detail:
 public Block findBlock(String blockId)
 public Block getBlock(String blockId)
    Returns a block from the component's template, referenced by its id.
 public Block getBody()
    Returns the body of this component as a (possibly empty) block. When invoked on a mixin, returns the containing component's body.
 public String getCompleteId()
    Returns a string consisting of the logical name of the containing page, and the nested id of this component, separated by a colon. I.e., "". For a page, returns just the page's logical name.

    This value is often used to obtain an equivalent component instance in a later request.

 public String getElementName(String defaultElementName)
    Returns the name of element that represents the component in its template, or the provided default element name if the element was a component type (in the Tapestry namespace).
 public String getId()
    Returns the simple (or local) id of the component. The id will be unique within the component's immediate container. For a page's root component, the value null is returned.


 public Locale getLocale()
    Returns the locale for the page containing this component.
 public Logger getLogger()
    Returns the log instance associated with the component (which is based on the component or mixin's class name).
 public String getNestedId()
    Return a string consisting the concatinated ids of all containing components, separated by periods. In addition, nested ids are always all lower case. I.e., "". Returns null for the root component of a page.
 public String getPageName()
    Returns the logical name of the page containing this component. This is the short name (it often appears in URLs)
 public boolean hasBody()
    Returns true if the element has a body and false otherwise. Only components may have a body; pages and mixins will return false.
 public boolean isRendering()
    Returns true if the component is currently rendering, false otherwise. This is most often used to determine if parameter values should be cached.
 public boolean triggerContextEvent(String eventType,
    EventContext context,
    ComponentEventCallback callback)
    Triggers a component event. A search for an event handling method will occur, first in the component, then its container, and so on. When a matching event handler method is located, it is invoked. If the method returns a value, the value is passed to the callback (if callback is null, then it is an error for a method to return a non-null value).

    Resolution of event type to event handler methods is case insensitive.

 public boolean triggerEvent(String eventType,
    Object[] contextValues,
    ComponentEventCallback callback)