|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.zkoss.zk.ui.AbstractComponent org.zkoss.zhtml.impl.AbstractTag
public class AbstractTag
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
).
Nested Class Summary | |
---|---|
protected class |
AbstractTag.ExtraCtrl
|
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
AbstractComponent.Children |
Field Summary | |
---|---|
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 |
---|
CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE |
Constructor Summary | |
---|---|
protected |
AbstractTag()
|
protected |
AbstractTag(java.lang.String tagname)
|
Method Summary | |
---|---|
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. |
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()
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.lang.String _tagnm
Constructor Detail |
---|
protected AbstractTag(java.lang.String tagname)
protected AbstractTag()
Method Detail |
---|
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 dispaly 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 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()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |