Interface ComponentPageElement
- All Superinterfaces:
BodyPageElement,ComponentResourcesCommon,InternalComponentResourcesCommon,Locatable,RenderCommand
- All Known Implementing Classes:
ComponentPageElementImpl
public interface ComponentPageElement
extends ComponentResourcesCommon, InternalComponentResourcesCommon, RenderCommand, BodyPageElement
Defines an element of a
Page that is a full Component,
including the possibility of its own template and mixins. This is distinct from other renderable
elements of the page, which represent fixed or dynamic text, or markup element that may have dynamic attribute values.-
Method Summary
Modifier and TypeMethodDescriptionvoidUsed during the contruction of a page to add a non-anonymous Block to the component.voidaddMixin(String mixinId, Instantiator instantiator, String... order) Adds a mixin.voidaddToTemplate(RenderCommand element) Used during the construction of a page.voidbindMixinParameter(String mixinId, String parameterName, Binding binding) booleandispatchEvent(ComponentEvent event) Asks each mixin and component toComponent.dispatchComponentEvent(ComponentEvent), returning true if any handler was found.voidInvoked when the component should render its body.Returns the core component associated with this page element (as opposed to any mixins attached to the component).Returns the resources associated with the core component.Containing component (or null for the root component of a page).Returns the page which contains this component.Retrieves a component page element by its id.Returns the ids of all embedded elements defined within the component.org.slf4j.LoggerReturns a logger used to for logging event dispatch and event method invocation.getMixinResources(String mixinId) Returns theComponentResourcesfor a mixin attached to this component element.newChild(String id, String nestedId, String completeId, String elementName, Instantiator instantiator, Location location) Creates a new child component of the invoked component.Methods inherited from interface org.apache.tapestry5.internal.structure.BodyPageElement
addToBodyMethods inherited from interface org.apache.tapestry5.ComponentResourcesCommon
createEventLink, createFormEventLink, findBlock, getBlock, getBody, getCompleteId, getElementName, getId, getLocale, getLogger, getNestedId, getPageName, getResourceSelector, hasBody, isRendering, triggerContextEvent, triggerEventMethods inherited from interface org.apache.tapestry5.internal.InternalComponentResourcesCommon
bindParameter, getBinding, getInformalParameterBindings, getMixinByClassName, isLoadedMethods inherited from interface org.apache.tapestry5.commons.Locatable
getLocationMethods inherited from interface org.apache.tapestry5.runtime.RenderCommand
render
-
Method Details
-
getComponent
Returns the core component associated with this page element (as opposed to any mixins attached to the component). -
getComponentResources
Returns the resources associated with the core component. -
getContainingPage
Returns the page which contains this component. -
getContainerElement
Containing component (or null for the root component of a page). -
addToTemplate
Used during the construction of a page. Adds a page element as part of the template for this page element. A page element will eventually render by sequentially rendering these elements. A page elements template is really just the outermost portions of the component's template ... where a template contains elements that are all components, those components will receive portions of the template as their body. -
addBlock
Used during the contruction of a page to add a non-anonymous Block to the component. -
addMixin
Adds a mixin.- Parameters:
mixinId- a unique id for the mixin, the last term of the mixin's class nameinstantiator- used to instantiate an instance of the mixinorder- Ordering strings used to determine the order of mixin execution.
-
bindMixinParameter
- Parameters:
mixinId- id of previously added mixinparameterName- simple (unqualified) name of parameterbinding- binding for parameter- Since:
- 5.1.0.0
-
getEmbeddedElement
Retrieves a component page element by its id. The search is caseless.- Parameters:
id- used to locate the element- Returns:
- the page element
- Throws:
IllegalArgumentException- if no component exists with the given id
-
getEmbeddedElementIds
Returns the ids of all embedded elements defined within the component.- Since:
- 5.8.3
-
getMixinResources
Returns theComponentResourcesfor a mixin attached to this component element. Mixin ids are the simple names of the mixin class.- Parameters:
mixinId- the mixin id (case insensitive)- Returns:
- the resources for the component
- Throws:
IllegalArgumentException- if no mixin with the given id exists
-
enqueueBeforeRenderBody
Invoked when the component should render its body. -
dispatchEvent
Asks each mixin and component toComponent.dispatchComponentEvent(ComponentEvent), returning true if any handler was found.- Parameters:
event- to be handled- Returns:
- true if a handler was found
-
newChild
ComponentPageElement newChild(String id, String nestedId, String completeId, String elementName, Instantiator instantiator, Location location) Creates a new child component of the invoked component. The new element will be added as an embedded element of its container.- Parameters:
id- simple id of the new componentnestedId-completeId-elementName- name of the component's element in its container's templateinstantiator- used to create a component instance, and access the component's modellocation- location of the element within its container's template @return the new component
-
getEventLogger
org.slf4j.Logger getEventLogger()Returns a logger used to for logging event dispatch and event method invocation.
-