public class XmlMacroComponent
extends org.zkoss.zk.ui.AbstractComponent
implements org.zkoss.zk.ui.ext.Macro
By default, compose()
will wire members by use
of Selectors
. In other words, it will wire annotated members
the same way as SelectorComposer
does.
If you prefer to wire the members based on the name convention
as GenericForwardComposer
does (i.e.,
backward compatible with ZK 5), you could specify a library property
called org.zkoss.zk.ui.macro.autowire.convention
to true
in WEB-INF/zk.xml as follows.
org.zkoss.zk.ui.macro.autowire.convention
true
If you prefer not to wire at all (neither by-selector nor by-convention),
you could specify a library property called
org.zkoss.zk.ui.macro.autowire.disabled
to true
in WEB-INF/zk.xml as follows..
org.zkoss.zk.ui.macro.autowire.disabled
true
Modifier and Type | Field and Description |
---|---|
protected List<org.zkoss.xel.VariableResolver> |
_resolvers
A list of resolvers (never null).
|
AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED
Constructor and Description |
---|
XmlMacroComponent() |
Modifier and Type | Method and Description |
---|---|
void |
afterCompose()
Creates the child components after apply dynamic properties
setDynamicProperty(java.lang.String, java.lang.Object) . |
Object |
clone() |
protected void |
compose()
Composes the macro component.
|
Object |
getDynamicProperty(String name) |
String |
getMacroURI() |
boolean |
hasDynamicProperty(String name) |
protected boolean |
isChildable() |
boolean |
isInline() |
void |
recreate() |
void |
redraw(Writer out) |
void |
setDynamicProperty(String name,
Object value) |
boolean |
setInlineParent(org.zkoss.zk.ui.Component parent,
org.zkoss.zk.ui.Component beforeSibling) |
void |
setMacroURI(String uri) |
void |
setPage(org.zkoss.zk.ui.Page page)
Changes the page.
|
void |
setParent(org.zkoss.zk.ui.Component parent)
Changes the parent.
|
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getExtraCtrl, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getPropertyAccess, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderProperties, replace, response, response, response, service, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPageBefore, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
protected final List<org.zkoss.xel.VariableResolver> _resolvers
org.zkoss.zk.ui.select.annotation.VariableResolver
was annotated.public void afterCompose()
setDynamicProperty(java.lang.String, java.lang.Object)
.
The second invocation is ignored. If you want to recreate
child components, use recreate()
instead.
If a macro component is created by ZK loader, this method is invoked automatically. Developers need to invoke this method only if they create a macro component manually.
If this is an line macro, this method is invoked automatically
if setParent(org.zkoss.zk.ui.Component)
or setPage(org.zkoss.zk.ui.Page)
called
afterCompose
in interface org.zkoss.zk.ui.ext.AfterCompose
protected void compose()
afterCompose()
, and others
to do the rendering based on getMacroURI()
.public void setMacroURI(String uri)
setMacroURI
in interface org.zkoss.zk.ui.ext.Macro
public String getMacroURI()
getMacroURI
in interface org.zkoss.zk.ui.ext.Macro
public void recreate()
recreate
in interface org.zkoss.zk.ui.ext.Macro
public boolean isInline()
isInline
in interface org.zkoss.zk.ui.ext.Macro
public void setParent(org.zkoss.zk.ui.Component parent)
Note: if this is an inline macro (isInline()
),
this method actually changes the parent of all components created
from the macro URI.
In other word, an inline macro behaves like a controller of
the components it created. It doesn't belong to any page or parent.
Moreover, afterCompose()
is called automatically if
it is not called (and this is an inline macro).
setParent
in interface org.zkoss.zk.ui.Component
setParent
in class org.zkoss.zk.ui.AbstractComponent
public boolean setInlineParent(org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component beforeSibling)
setInlineParent
in interface org.zkoss.zk.ui.ext.Macro
public void setPage(org.zkoss.zk.ui.Page page)
Note: if this is an inline macro (isInline()
),
this method actually changes the page of all components created
from the macro URI.
In other word, an inline macro behaves like a controller of
the components it created. It doesn't belong to any page or parent.
Moreover, afterCompose()
is called automatically if
it is not called (and this is an inline macro).
setPage
in interface org.zkoss.zk.ui.Component
setPage
in class org.zkoss.zk.ui.AbstractComponent
protected boolean isChildable()
isChildable
in class org.zkoss.zk.ui.AbstractComponent
public void redraw(Writer out) throws IOException
redraw
in interface org.zkoss.zk.ui.sys.ComponentCtrl
redraw
in class org.zkoss.zk.ui.AbstractComponent
IOException
public Object clone()
clone
in interface org.zkoss.zk.ui.Component
clone
in class org.zkoss.zk.ui.AbstractComponent
public boolean hasDynamicProperty(String name)
hasDynamicProperty
in interface org.zkoss.zk.ui.ext.DynamicPropertied
public Object getDynamicProperty(String name)
getDynamicProperty
in interface org.zkoss.zk.ui.ext.DynamicPropertied
Copyright © 2016. All rights reserved.