Class AbstractTag

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      protected class  AbstractTag.ExtraCtrl  
      • Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent

        org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.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

        AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractTag()  
      protected AbstractTag​(java.lang.String tagname)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()  
      java.lang.String getAccesskey()
      Returns the accesskey of this tag.
      java.lang.String getDir()
      Returns the dir of this tag.
      java.util.Map<java.lang.String,​java.lang.Object> getDynamicProperties()  
      java.lang.Object getDynamicProperty​(java.lang.String name)
      Returns the dynamic property, or null if not found.
      java.lang.Object getExtraCtrl()  
      java.lang.String getLang()
      Returns the lang of this tag.
      org.zkoss.zk.ui.sys.PropertyAccess getPropertyAccess​(java.lang.String prop)  
      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)  
      protected boolean isChildable()  
      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)  
      protected void redrawChildrenDirectly​(TagRenderContext rc, org.zkoss.zk.ui.Execution exec, java.io.Writer out)
      Renders the children directly to the given output.
      protected void renderProperties​(org.zkoss.zk.ui.sys.ContentRenderer renderer)  
      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()  
      • Methods inherited from class org.zkoss.zk.ui.AbstractComponent

        addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, 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, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, 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, 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

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _tagnm

        protected java.lang.String _tagnm
        The tag name.
    • Constructor Detail

      • AbstractTag

        protected AbstractTag​(java.lang.String tagname)
      • AbstractTag

        protected AbstractTag()
    • Method Detail

      • getSclass

        public java.lang.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​(java.lang.String sclass)
        Sets the CSS class.
      • getStyle

        public java.lang.String getStyle()
        Returns the CSS style.

        Default: null.

      • setStyle

        public void setStyle​(java.lang.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.

      • getAccesskey

        public java.lang.String getAccesskey()
        Returns the accesskey of this tag.

        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.

        Since:
        8.0.3
      • setAccesskey

        public void setAccesskey​(java.lang.String accesskey)
                          throws org.zkoss.zk.ui.WrongValueException
        Sets the accesskey of this tag.

        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.

        Throws:
        org.zkoss.zk.ui.WrongValueException
        Since:
        8.0.3
      • isContenteditable

        public boolean isContenteditable()
        Returns the contenteditable of this tag.

        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.

        Since:
        8.0.3
      • setContenteditable

        public void setContenteditable​(boolean contenteditable)
                                throws org.zkoss.zk.ui.WrongValueException
        Sets the contenteditable of this tag.

        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.

        Throws:
        org.zkoss.zk.ui.WrongValueException
        Since:
        8.0.3
      • getDir

        public java.lang.String getDir()
        Returns the dir of this tag.

        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.

        Since:
        8.0.3
      • setDir

        public void setDir​(java.lang.String dir)
                    throws org.zkoss.zk.ui.WrongValueException
        Sets the dir of this tag.

        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.

        Throws:
        org.zkoss.zk.ui.WrongValueException
        Since:
        8.0.3
      • isDraggable

        public boolean isDraggable()
        Returns the draggable of this tag.

        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.

        Since:
        8.0.3
      • setDraggable

        public void setDraggable​(boolean draggable)
                          throws org.zkoss.zk.ui.WrongValueException
        Sets the draggable of this tag.

        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.

        Throws:
        org.zkoss.zk.ui.WrongValueException
        Since:
        8.0.3
      • isHidden

        public boolean isHidden()
        Returns the hidden of this tag.

        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.

        Since:
        8.0.3
      • setHidden

        public void setHidden​(boolean hidden)
                       throws org.zkoss.zk.ui.WrongValueException
        Sets the hidden of this tag.

        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.

        Throws:
        org.zkoss.zk.ui.WrongValueException
        Since:
        8.0.3
      • getLang

        public java.lang.String getLang()
        Returns the lang of this tag.

        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.

        Since:
        8.0.3
      • setLang

        public void setLang​(java.lang.String lang)
                     throws org.zkoss.zk.ui.WrongValueException
        Sets the lang of this tag.

        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.

        Throws:
        org.zkoss.zk.ui.WrongValueException
        Since:
        8.0.3
      • isSpellcheck

        public boolean isSpellcheck()
        Returns the spellcheck of this tag.

        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.

        Since:
        8.0.3
      • setSpellcheck

        public void setSpellcheck​(boolean spellcheck)
                           throws org.zkoss.zk.ui.WrongValueException
        Sets the spellcheck of this tag.

        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.

        Throws:
        org.zkoss.zk.ui.WrongValueException
        Since:
        8.0.3
      • getTabindex

        public java.lang.Integer getTabindex()
        Returns the tabindex of this tag.

        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.

        Since:
        8.0.3
      • setTabindex

        public void setTabindex​(java.lang.Integer tabindex)
                         throws org.zkoss.zk.ui.WrongValueException
        Sets the tabindex of this tag.

        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.

        Throws:
        org.zkoss.zk.ui.WrongValueException
        Since:
        8.0.3
      • getTitle

        public java.lang.String getTitle()
        Returns the title of this tag.

        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.

        Since:
        8.0.3
      • setTitle

        public void setTitle​(java.lang.String title)
                      throws org.zkoss.zk.ui.WrongValueException
        Sets the title of this tag.

        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.

        Throws:
        org.zkoss.zk.ui.WrongValueException
        Since:
        8.0.3
      • getTag

        public java.lang.String getTag()
        Returns the tag name.
      • hasDynamicProperty

        public boolean hasDynamicProperty​(java.lang.String name)
        Specified by:
        hasDynamicProperty in interface org.zkoss.zk.ui.ext.DynamicPropertied
      • getDynamicProperties

        public java.util.Map<java.lang.String,​java.lang.Object> getDynamicProperties()
        Specified by:
        getDynamicProperties in interface org.zkoss.zk.ui.ext.DynamicPropertied
      • getDynamicProperty

        public java.lang.Object getDynamicProperty​(java.lang.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​(java.lang.String name,
                                       java.lang.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 java.lang.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​(java.io.Writer out)
                    throws java.io.IOException
        Specified by:
        redraw in interface org.zkoss.zk.ui.sys.ComponentCtrl
        Overrides:
        redraw in class org.zkoss.zk.ui.AbstractComponent
        Throws:
        java.io.IOException
      • redrawChildrenDirectly

        protected void redrawChildrenDirectly​(TagRenderContext rc,
                                              org.zkoss.zk.ui.Execution exec,
                                              java.io.Writer out)
                                       throws java.io.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:
        java.io.IOException
        Since:
        5.0.7
      • renderProperties

        protected void renderProperties​(org.zkoss.zk.ui.sys.ContentRenderer renderer)
                                 throws java.io.IOException
        Overrides:
        renderProperties in class org.zkoss.zk.ui.AbstractComponent
        Throws:
        java.io.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
      • getPropertyAccess

        public org.zkoss.zk.ui.sys.PropertyAccess getPropertyAccess​(java.lang.String prop)
        Specified by:
        getPropertyAccess in interface org.zkoss.zk.ui.sys.ComponentCtrl
        Overrides:
        getPropertyAccess in class org.zkoss.zk.ui.AbstractComponent
      • clone

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

        public java.lang.String toString()
        Overrides:
        toString in class org.zkoss.zk.ui.AbstractComponent
      • getExtraCtrl

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