org.zkoss.zhtml.impl
Class AbstractTag

java.lang.Object
  extended by org.zkoss.zk.ui.AbstractComponent
      extended by org.zkoss.zhtml.impl.AbstractTag
All Implemented Interfaces:
Serializable, Cloneable, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.DynamicPropertied, org.zkoss.zk.ui.ext.RawId, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.sys.ComponentCtrl
Direct Known Subclasses:
A, Abbr, Acronym, Address, Area, B, Base, Big, Blockquote, Body, Br, Button, Caption, Center, Cite, Code, Col, Colgroup, ContentTag, Dd, Del, Dfn, Dir, Div, Dl, Dt, Em, Embed, Fieldset, Font, Form, H1, H2, H3, H4, Head, Hr, Html, I, Iframe, Img, Input, Ins, Isindex, Kbd, Label, Legend, Li, Link, Map, Menu, Meta, Nobr, Object, Ol, Optgroup, Option, P, Pre, Q, Raw, S, Samp, Select, Small, Span, Strong, Sub, Sup, Table, Tbody, Td, Tfoot, Th, Thead, Title, Tr, Tt, Ul, Var

public class AbstractTag
extends org.zkoss.zk.ui.AbstractComponent
implements org.zkoss.zk.ui.ext.DynamicPropertied, org.zkoss.zk.ui.ext.RawId

The raw component used to generate raw HTML elements.

Note: ZHTML components ignore the page listener since it handles non-deferrable event listeners (see Deferrable).

Author:
tomyeh
See Also:
Serialized Form

Nested Class Summary
protected  class AbstractTag.ExtraCtrl
           
 
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children
 
Field Summary
protected  String _tagnm
          The tag name.
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
 
Constructor Summary
protected AbstractTag()
           
protected AbstractTag(String tagname)
           
 
Method Summary
 Object clone()
           
 Object getDynamicProperty(String name)
          Returns the dynamic property, or null if not found.
 Object getExtraCtrl()
           
 String getSclass()
          Returns the CSS class.
 String getStyle()
          Returns the CSS style.
 String getTag()
          Returns the tag name.
 String getWidgetClass()
          Returns the widget class, "zhtml.Widget".
 boolean hasDynamicProperty(String name)
           
protected  boolean isChildable()
           
protected  boolean isOrphanTag()
          Returns whether this tag is an orphan tag, i.e., it shall be in the form of <tag/>.
 void redraw(Writer out)
           
protected  void redrawChildrenDirectly(TagRenderContext rc, org.zkoss.zk.ui.Execution exec, Writer out)
          Renders the children directly to the given output.
protected  void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
           
 void setDynamicProperty(String name, Object value)
          Sets the dynamic property.
 void setSclass(String sclass)
          Sets the CSS class.
 void setStyle(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.
 String toString()
           
 
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
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, 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, 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
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_tagnm

protected String _tagnm
The tag name.

Constructor Detail

AbstractTag

protected AbstractTag(String tagname)

AbstractTag

protected AbstractTag()
Method Detail

getSclass

public String getSclass()
Returns the CSS class. Due to Java's limitation, we cannot use the name called getClas.

Default: null (the default value depends on element).


setSclass

public void setSclass(String sclass)
Sets the CSS class.


getStyle

public String getStyle()
Returns the CSS style.

Default: null.


setStyle

public void setStyle(String style)
Sets the CSS 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.


getTag

public String getTag()
Returns the tag name.


hasDynamicProperty

public boolean hasDynamicProperty(String name)
Specified by:
hasDynamicProperty in interface org.zkoss.zk.ui.ext.DynamicPropertied

getDynamicProperty

public Object getDynamicProperty(String name)
Returns the dynamic property, or null if not found. Note: it must be a String object or null.

Specified by:
getDynamicProperty in interface org.zkoss.zk.ui.ext.DynamicPropertied

setDynamicProperty

public void setDynamicProperty(String name,
                               Object value)
                        throws org.zkoss.zk.ui.WrongValueException
Sets the dynamic property. Note: it converts the value to a string object (by use of Objects.toString(java.lang.Object)).

Note: it handles the style property specially. Refer to setStyle(java.lang.String) for details.

Specified by:
setDynamicProperty in interface org.zkoss.zk.ui.ext.DynamicPropertied
Throws:
org.zkoss.zk.ui.WrongValueException

shallHideId

protected boolean shallHideId()
Whether to hide the id attribute.

Default: false.

Some tags, such as Html, won't generate the id attribute. They shall override this method to return true.


setVisible

public boolean setVisible(boolean visible)
Changes the visibility of this component.

Note: it will adjust the style (getStyle()) based on the visibility.

Specified by:
setVisible in interface org.zkoss.zk.ui.Component
Overrides:
setVisible in class org.zkoss.zk.ui.AbstractComponent
Returns:
the previous visibility

getWidgetClass

public String getWidgetClass()
Returns the widget class, "zhtml.Widget".

Specified by:
getWidgetClass in interface org.zkoss.zk.ui.Component
Overrides:
getWidgetClass in class org.zkoss.zk.ui.AbstractComponent
Since:
5.0.0

redraw

public void redraw(Writer out)
            throws IOException
Specified by:
redraw in interface org.zkoss.zk.ui.sys.ComponentCtrl
Overrides:
redraw in class org.zkoss.zk.ui.AbstractComponent
Throws:
IOException

redrawChildrenDirectly

protected void redrawChildrenDirectly(TagRenderContext rc,
                                      org.zkoss.zk.ui.Execution exec,
                                      Writer out)
                               throws IOException
Renders the children directly to the given output. Notice it is called only if 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.

Throws:
IOException
Since:
5.0.7

renderProperties

protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
                         throws IOException
Overrides:
renderProperties in class org.zkoss.zk.ui.AbstractComponent
Throws:
IOException

isChildable

protected boolean isChildable()
Overrides:
isChildable in class org.zkoss.zk.ui.AbstractComponent

isOrphanTag

protected boolean isOrphanTag()
Returns whether this tag is an orphan tag, i.e., it shall be in the form of <tag/>.

Since:
5.0.8

clone

public Object clone()
Specified by:
clone in interface org.zkoss.zk.ui.Component
Overrides:
clone in class org.zkoss.zk.ui.AbstractComponent

toString

public String toString()
Overrides:
toString in class org.zkoss.zk.ui.AbstractComponent

getExtraCtrl

public Object getExtraCtrl()
Specified by:
getExtraCtrl in interface org.zkoss.zk.ui.sys.ComponentCtrl
Overrides:
getExtraCtrl in class org.zkoss.zk.ui.AbstractComponent


Copyright © 2015. All Rights Reserved.