|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlMacroComponent
public class HtmlMacroComponent
The implemetation of a macro component upon HTML.
Generally, a macro component is created automatically by ZK loader.
If a developer wants to create it manually, it has to instantiate from
the correct class, and then invoke afterCompose().
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
HtmlBasedComponent.ExtraCtrl |
| Field Summary |
|---|
| Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
RS_NO_DISPLAY, RS_NO_HEIGHT, RS_NO_WIDTH |
| Fields inherited from interface org.zkoss.zk.ui.Component |
|---|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE |
| Constructor Summary | |
|---|---|
HtmlMacroComponent()
|
|
| Method Summary | |
|---|---|
void |
afterCompose()
Creates the child components after apply dynamic properties setDynamicProperty(java.lang.String, java.lang.Object). |
java.lang.Object |
clone()
Clones the component. |
java.lang.Object |
getDynamicProperty(java.lang.String name)
Returns the property value of the specified name. |
boolean |
hasDynamicProperty(java.lang.String name)
Returns whether a dynamic attribute is allowed. |
boolean |
isChildable()
Default: return true (allows to have children). |
boolean |
isInline()
Returns whether this is an inline macro. |
void |
recreate()
Detaches all child components and then recreate them by use of AfterCompose.afterCompose(). |
void |
setDynamicProperty(java.lang.String name,
java.lang.Object value)
Sets an attribute with a value. |
void |
setMacroURI(java.lang.String uri)
Sets the macro URI. |
void |
setPage(Page page)
Changes the page. |
void |
setParent(Component parent)
Changes the parent. |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
|---|
addEventListener, appendAsapAttr, focus, getDraggable, getDroppable, getHeight, getInnerAttrs, getLeft, getOuterAttrs, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZIndex, isAsapRequired, newExtraCtrl, removeEventListener, setClass, setDraggable, setDroppable, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZIndex |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zk.ui.IdSpace |
|---|
getFellow, getFellowIfAny |
| Constructor Detail |
|---|
public HtmlMacroComponent()
| Method Detail |
|---|
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 AfterComposepublic void setMacroURI(java.lang.String uri)
MacroNote: this method calls Macro.recreate() automatically
if uri is changed.
setMacroURI in interface Macrouri - the URI of this macro. If null, the default is used.public void recreate()
MacroAfterCompose.afterCompose().
It is used if you have assigned new values to dynamical 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 the Developer's Guide for details.
recreate in interface Macropublic boolean isInline()
MacroComponentDefinition.newInstance(org.zkoss.zk.ui.Page, java.lang.String).
isInline in interface Macropublic void setParent(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 ComponentsetParent in class AbstractComponentpublic void setPage(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 ComponentsetPage in class AbstractComponentpublic boolean isChildable()
AbstractComponent
isChildable in interface ComponentisChildable in class AbstractComponentpublic java.lang.Object clone()
Component
clone in interface Componentclone in class AbstractComponentpublic boolean hasDynamicProperty(java.lang.String name)
DynamicPropertied
hasDynamicProperty in interface DynamicPropertiedpublic java.lang.Object getDynamicProperty(java.lang.String name)
DynamicPropertied
getDynamicProperty in interface DynamicPropertied
public void setDynamicProperty(java.lang.String name,
java.lang.Object value)
throws WrongValueException
DynamicPropertiedIf a component supports only String-type values, it could use org.zkoss.lang.Objects.toString() to convert the value to a String instance.
setDynamicProperty in interface DynamicPropertiedWrongValueException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||