public class HtmlNativeComponent extends AbstractComponent implements DynamicTag, Native
It contains the content that shall be sent directly to client.
It has three parts: prolog, children and epilog.
The prolog (getPrologContent()) and epilog (getEpilogContent())
are both String.
When this component is rendered (redraw(java.io.Writer)), it generates
the prolog first, the children and then the epilog.
| Modifier and Type | Class and Description |
|---|---|
protected class |
HtmlNativeComponent.ExtraCtrl |
static class |
HtmlNativeComponent.HtmlHelper
The HTML helper.
|
AbstractComponent.ChildrenNative.HelperAPPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEAFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE| Constructor and Description |
|---|
HtmlNativeComponent()
Constructs a
HtmlNativeComponent component. |
HtmlNativeComponent(java.lang.String tag)
Constructs a
HtmlNativeComponent component with the specified tag name. |
HtmlNativeComponent(java.lang.String tag,
java.lang.String prolog,
java.lang.String epilog)
Constructs a
HtmlNativeComponent component with the specified
prolog and epilog. |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeclaredNamespace(Namespace ns)
Adds a declared namespace.
|
java.util.List<Namespace> |
getDeclaredNamespaces()
Returns a readonly list of the declared namespaces
(
Namespace), or empty if no declared namespace. |
java.lang.Object |
getDynamicProperty(java.lang.String name)
Returns the property value of the specified name.
|
java.lang.String |
getEpilogContent()
Returns the epilog content.
|
java.lang.Object |
getExtraCtrl()
Returns the extra controls that tell ZK how to handle this component
specially.
|
Native.Helper |
getHelper()
Returns the helper to generate the output of the native components.
|
java.lang.String |
getPrologContent()
Returns the prolog content.
|
PropertyAccess |
getPropertyAccess(java.lang.String prop)
Returns the corresponding property access object from the given property
name, if any.
|
java.lang.String |
getTag()
Returns the tag name, or null if plain text.
|
java.lang.String |
getWidgetClass()
Returns the widget class, "zk.Native".
|
boolean |
hasDynamicProperty(java.lang.String name)
Returns whether a dynamic property is defined.
|
boolean |
hasTag(java.lang.String tag)
Returns whether the specified tag is allowed.
|
void |
redraw(java.io.Writer out)
Redraws this component and all its descendants.
|
protected void |
renderProperties(ContentRenderer renderer)
Called by (
ComponentCtrl.redraw(java.io.Writer)) to render the
properties, excluding the enclosing tag and children. |
void |
setDynamicProperty(java.lang.String name,
java.lang.Object value)
Sets a property with the specified name and value.
|
void |
setEpilogContent(java.lang.String epilog)
Sets the epilog content.
|
void |
setId(java.lang.String id)
Sets the ID.
|
void |
setPrologContent(java.lang.String prolog)
Sets the prolog content.
|
void |
setTag(java.lang.String tag)
Sets the tag name.
|
boolean |
setVisible(boolean visible)
Sets whether this component is visible.
|
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, clone, 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, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, isChildable, 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, replace, response, response, response, service, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerializepublic HtmlNativeComponent()
HtmlNativeComponent component.public HtmlNativeComponent(java.lang.String tag)
HtmlNativeComponent component with the specified tag name.tag - the tag name. If null or empty, plain text is assumed.public HtmlNativeComponent(java.lang.String tag,
java.lang.String prolog,
java.lang.String epilog)
HtmlNativeComponent component with the specified
prolog and epilog.tag - the tag name. If null or empty, plain text is assumed.prolog - the content right before the children, if any.epilog - the content right after the children, if any.public java.lang.String getWidgetClass()
getWidgetClass in interface ComponentgetWidgetClass in class AbstractComponentComponent.setWidgetClass(java.lang.String)public java.lang.String getTag()
public java.util.List<Namespace> getDeclaredNamespaces()
NativeNamespace), or empty if no declared namespace.getDeclaredNamespaces in interface Nativepublic void addDeclaredNamespace(Namespace ns)
NativeaddDeclaredNamespace in interface Nativens - the namespace (never null).public java.lang.String getPrologContent()
NativeDefault: empty ("").
getPrologContent in interface Nativepublic void setPrologContent(java.lang.String prolog)
NativesetPrologContent in interface Nativepublic java.lang.String getEpilogContent()
NativeDefault: empty ("").
getEpilogContent in interface Nativepublic void setEpilogContent(java.lang.String epilog)
NativesetEpilogContent in interface Nativepublic Native.Helper getHelper()
Nativepublic void setId(java.lang.String id)
ComponentComponent.getId() for more details.
Default: "" (an empty string; it means no ID at all).
setId in interface ComponentsetId in class AbstractComponentid - the identifier.
You could specify null or an empty string to remove ID.Selectorspublic boolean setVisible(boolean visible)
ComponentsetVisible in interface ComponentsetVisible in class AbstractComponentpublic void redraw(java.io.Writer out)
throws java.io.IOException
AbstractComponentDefault: It uses JsContentRenderer to render all information
in JavaScript codes. For devices that don't support JavaScript,
it must override this method.
To generate all information, it first invokes
AbstractComponent.renderProperties(org.zkoss.zk.ui.sys.ContentRenderer) to render component's
properties,
and then AbstractComponent.redrawChildren(java.io.Writer) to redraw children (and descendants)
(by calling their AbstractComponent.redraw(java.io.Writer)).
If a derived class wants to render more properties, it can override
AbstractComponent.renderProperties(org.zkoss.zk.ui.sys.ContentRenderer).
If a derived class renders only a subset of its children
(such as paging/cropping), it could override AbstractComponent.redrawChildren(java.io.Writer).
If a deriving class wants to do something before
AbstractComponent.renderProperties(org.zkoss.zk.ui.sys.ContentRenderer), it has to override AbstractComponent.redraw(java.io.Writer).
If a deriving class doesn't want to render in JavaScript codes,
it has to override AbstractComponent.redraw(java.io.Writer) with the proper implementation
of ContentRenderer.
redraw in interface ComponentCtrlredraw in class AbstractComponentjava.io.IOExceptionprotected void renderProperties(ContentRenderer renderer) throws java.io.IOException
AbstractComponentComponentCtrl.redraw(java.io.Writer)) to render the
properties, excluding the enclosing tag and children.
Default: it renders AbstractComponent.getId() if it was assigned,
and event names if listened (and listed in AbstractComponent.getClientEvents()).
Note: it doesn't render AbstractComponent.getWidgetClass(), AbstractComponent.getUuid()
and AbstractComponent.getMold(), which are caller's job.
renderProperties in class AbstractComponentjava.io.IOExceptionpublic void setTag(java.lang.String tag)
throws WrongValueException
setTag in interface DynamicTagtag - the tag name. If null or empty, plain text is assumed.WrongValueExceptionpublic boolean hasTag(java.lang.String tag)
DynamicTaghasTag in interface DynamicTagpublic boolean hasDynamicProperty(java.lang.String name)
DynamicPropertiedhasDynamicProperty in interface DynamicPropertiedpublic java.lang.Object getDynamicProperty(java.lang.String name)
DynamicPropertiedgetDynamicProperty in interface DynamicPropertiedpublic 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 DynamicPropertiedWrongValueExceptionpublic PropertyAccess getPropertyAccess(java.lang.String prop)
ComponentCtrlgetPropertyAccess in interface ComponentCtrlgetPropertyAccess in class AbstractComponentprop - the name of the propertypublic java.lang.Object getExtraCtrl()
AbstractComponentDefault: null.
getExtraCtrl in interface ComponentCtrlgetExtraCtrl in class AbstractComponentCropper.ComponentCtrl.getExtraCtrl()Copyright © 2005-2018 Potix Corporation. All Rights Reserved.