public class AbstractTag extends AbstractComponent implements DynamicPropertied, RawId
Note: ZHTML components ignore the page listener since it handles
non-deferrable event listeners
(see Deferrable
).
Modifier and Type | Class and Description |
---|---|
protected class |
AbstractTag.ExtraCtrl |
AbstractComponent.Children
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
_tagnm
The tag name.
|
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
Modifier | Constructor and Description |
---|---|
protected |
AbstractTag() |
protected |
AbstractTag(java.lang.String tagname) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone()
Clones the component.
|
java.lang.Object |
getDynamicProperty(java.lang.String name)
Returns the dynamic property, or null if not found.
|
java.lang.Object |
getExtraCtrl()
Returns the extra controls that tell ZK how to handle this component
specially.
|
PropertyAccess |
getPropertyAccess(java.lang.String prop)
Returns the corresponding property access object from the given property
name, if any.
|
java.lang.String |
getSclass()
Returns the CSS class.
|
java.lang.String |
getStyle()
Returns the CSS style.
|
java.lang.String |
getTag()
Returns the tag name.
|
java.lang.String |
getWidgetClass()
Returns the widget class, "zhtml.Widget".
|
boolean |
hasDynamicProperty(java.lang.String name)
Returns whether a dynamic property is defined.
|
protected boolean |
isChildable()
Returns whether this component can have a child.
|
protected boolean |
isOrphanTag()
Returns whether this tag is an orphan tag, i.e., it shall be in the
form of <tag/>.
|
void |
redraw(java.io.Writer out)
Redraws this component and all its descendants.
|
protected void |
redrawChildrenDirectly(TagRenderContext rc,
Execution exec,
java.io.Writer out)
Renders the children directly to the given output.
|
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 the dynamic property.
|
void |
setSclass(java.lang.String sclass)
Sets the CSS class.
|
void |
setStyle(java.lang.String style)
Sets the CSS style.
|
boolean |
setVisible(boolean visible)
Changes the visibility of this component.
|
protected boolean |
shallHideId()
Whether to hide the id attribute.
|
java.lang.String |
toString() |
addAnnotation, addAnnotation, 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, 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, getShadowRoots, 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, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redrawChildren, removeAttribute, removeAttribute, removeAttribute, 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, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
protected AbstractTag(java.lang.String tagname)
protected AbstractTag()
public java.lang.String getSclass()
Default: null (the default value depends on element).
public void setSclass(java.lang.String sclass)
public java.lang.String getStyle()
Default: null.
public void setStyle(java.lang.String style)
Note: if display is not specified as part of style,
the returned value of AbstractComponent.isVisible()
is assumed.
In other words, if not visible and display is not specified as part of style,
"display:none" is appended.
On the other hand, if display is specified, then setVisible(boolean)
is called to reflect the visibility, if necessary.
public java.lang.String getTag()
public boolean hasDynamicProperty(java.lang.String name)
DynamicPropertied
hasDynamicProperty
in interface DynamicPropertied
public java.lang.Object getDynamicProperty(java.lang.String name)
getDynamicProperty
in interface DynamicPropertied
public void setDynamicProperty(java.lang.String name, java.lang.Object value) throws WrongValueException
Objects.toString(java.lang.Object)
).
Note: it handles the style property specially. Refer to setStyle(java.lang.String)
for details.
setDynamicProperty
in interface DynamicPropertied
WrongValueException
protected boolean shallHideId()
Default: false.
Some tags, such as Html
, won't generate the id attribute.
They shall override this method to return true.
public boolean setVisible(boolean visible)
Note: it will adjust the style (getStyle()
) based on the visibility.
setVisible
in interface Component
setVisible
in class AbstractComponent
public java.lang.String getWidgetClass()
getWidgetClass
in interface Component
getWidgetClass
in class AbstractComponent
Component.setWidgetClass(java.lang.String)
public void redraw(java.io.Writer out) throws java.io.IOException
AbstractComponent
Default: 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 ComponentCtrl
redraw
in class AbstractComponent
java.io.IOException
protected void redrawChildrenDirectly(TagRenderContext rc, Execution exec, java.io.Writer out) throws java.io.IOException
redraw(java.io.Writer)
is going to render
the content (HTML tags) directly.
If it is about to generate the JavaScript code
AbstractComponent.redrawChildren(java.io.Writer)
will be called instead.
You have to override this method if the deriving class has additional information to render.
java.io.IOException
protected void renderProperties(ContentRenderer renderer) throws java.io.IOException
AbstractComponent
ComponentCtrl.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 AbstractComponent
java.io.IOException
protected boolean isChildable()
AbstractComponent
Default: return true (means it can have children).
isChildable
in class AbstractComponent
protected boolean isOrphanTag()
public PropertyAccess getPropertyAccess(java.lang.String prop)
ComponentCtrl
getPropertyAccess
in interface ComponentCtrl
getPropertyAccess
in class AbstractComponent
prop
- the name of the propertypublic java.lang.Object clone()
Component
clone
in interface Component
clone
in class AbstractComponent
public java.lang.String toString()
toString
in class AbstractComponent
public java.lang.Object getExtraCtrl()
AbstractComponent
Default: null.
getExtraCtrl
in interface ComponentCtrl
getExtraCtrl
in class AbstractComponent
Cropper
.ComponentCtrl.getExtraCtrl()
Copyright © 2005-2011 Potix Corporation. All Rights Reserved.