Interface Macro
- All Superinterfaces:
AfterCompose,DynamicPropertied,IdSpace,Scope
- All Known Implementing Classes:
HtmlMacroComponent
Component to represent
a macro component.- Author:
- tomyeh
-
Method Summary
Modifier and TypeMethodDescriptionReturns the macro URI.booleanisInline()Returns whether this is an inline macro.voidrecreate()Detaches all child components and then recreate them.booleansetInlineParent(Component parent, Component beforeSibling) Sets the parent to the given one and insert the children of the inline macro right before the given sibling (beforeSibling).voidsetMacroURI(String uri) Sets the macro URI.Methods inherited from interface org.zkoss.zk.ui.ext.AfterCompose
afterComposeMethods inherited from interface org.zkoss.zk.ui.ext.DynamicPropertied
getDynamicProperties, getDynamicProperty, hasDynamicProperty, setDynamicPropertyMethods inherited from interface org.zkoss.zk.ui.IdSpace
getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, hasFellow, hasFellowMethods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, getAttribute, getAttributes, hasAttribute, hasAttribute, removeAttribute, removeAttribute, removeScopeListener, setAttribute, setAttribute
-
Method Details
-
setMacroURI
Sets the macro URI. It affects only this component.Note: this method calls
recreate()automatically if uri is changed.- Parameters:
uri- the URI of this macro. If null, the default is used.
-
getMacroURI
String getMacroURI()Returns the macro URI.If
setMacroURI(java.lang.String)wasn't called, it returns the URI defined in the macro definition.- Since:
- 3.6.0
-
recreate
void recreate()Detaches all child components and then recreate them.It is used if you have assigned new values to dynamic properties and want to re-create child components to reflect the new values. Note: it is convenient but the performance is better if you can manipulate only the child components that need to be changed. Refer to ZK Developer's Reference for details.
-
isInline
boolean isInline()Returns whether this is an inline macro. The only way to create an inline macro is by use ofComponentDefinition.newInstance(org.zkoss.zk.ui.Page, java.lang.String).- Since:
- 2.4.0
-
setInlineParent
Sets the parent to the given one and insert the children of the inline macro right before the given sibling (beforeSibling).This method is used only internally.
Notice that when
AbstractComponent.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)is called to insert an inline macro (isInline()), the invocation will be forwarded to this method. It is called onlyisInline()is true.- Parameters:
parent- the parentbeforeSibling- a child of the parent that the macro component will be inserted before- Returns:
- if it has been added successfully
- Throws:
IllegalStateException- ifisInline()is false.- Since:
- 5.0.4
-