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
AFTER_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
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.String |
getAccesskey()
Returns the accesskey of this tag.
|
java.lang.String |
getDir()
Returns the dir of this tag.
|
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.
|
java.lang.String |
getLang()
Returns the lang of this tag.
|
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.Integer |
getTabindex()
Returns the tabindex of this tag.
|
java.lang.String |
getTag()
Returns the tag name.
|
java.lang.String |
getTitle()
Returns the title of this tag.
|
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.
|
boolean |
isContenteditable()
Returns the contenteditable of this tag.
|
boolean |
isDraggable()
Returns the draggable of this tag.
|
boolean |
isHidden()
Returns the hidden of this tag.
|
protected boolean |
isOrphanTag()
Returns whether this tag is an orphan tag, i.e., it shall be in the form of <tag/>.
|
boolean |
isSpellcheck()
Returns the spellcheck of this 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 |
setAccesskey(java.lang.String accesskey)
Sets the accesskey of this tag.
|
void |
setContenteditable(boolean contenteditable)
Sets the contenteditable of this tag.
|
void |
setDir(java.lang.String dir)
Sets the dir of this tag.
|
void |
setDraggable(boolean draggable)
Sets the draggable of this tag.
|
void |
setDynamicProperty(java.lang.String name,
java.lang.Object value)
Sets the dynamic property.
|
void |
setHidden(boolean hidden)
Sets the hidden of this tag.
|
void |
setLang(java.lang.String lang)
Sets the lang of this tag.
|
void |
setSclass(java.lang.String sclass)
Sets the CSS class.
|
void |
setSpellcheck(boolean spellcheck)
Sets the spellcheck of this tag.
|
void |
setStyle(java.lang.String style)
Sets the CSS style.
|
void |
setTabindex(java.lang.Integer tabindex)
Sets the tabindex of this tag.
|
void |
setTitle(java.lang.String title)
Sets the title of this tag.
|
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, 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, 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, invalidatePartial, isInitialized, 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, 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
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
invalidatePartial
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 getAccesskey()
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
public void setAccesskey(java.lang.String accesskey) throws WrongValueException
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
WrongValueException
public boolean isContenteditable()
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
public void setContenteditable(boolean contenteditable) throws WrongValueException
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
WrongValueException
public java.lang.String getDir()
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
public void setDir(java.lang.String dir) throws WrongValueException
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
WrongValueException
public boolean isDraggable()
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
public void setDraggable(boolean draggable) throws WrongValueException
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
WrongValueException
public boolean isHidden()
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
public void setHidden(boolean hidden) throws WrongValueException
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
WrongValueException
public java.lang.String getLang()
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
public void setLang(java.lang.String lang) throws WrongValueException
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
WrongValueException
public boolean isSpellcheck()
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
public void setSpellcheck(boolean spellcheck) throws WrongValueException
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
WrongValueException
public java.lang.Integer getTabindex()
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
public void setTabindex(java.lang.Integer tabindex) throws WrongValueException
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
WrongValueException
public java.lang.String getTitle()
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
public void setTitle(java.lang.String title) throws WrongValueException
Notice that this attribute refers to the corresponding attribute of the HTML5 specification. Hence, it would still be rendered to client-side as a DOM attribute even if the browser doesn’t support it.
WrongValueException
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-2023 Potix Corporation. All Rights Reserved.