|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.zkoss.zk.ui.AbstractComponent
org.zkoss.zhtml.Text
public class Text
Represents a piece of text (of DOM).
Nested Class Summary | |
---|---|
protected class |
Text.ExtraCtrl
|
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
AbstractComponent.Children |
Field Summary |
---|
Fields inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
_visible |
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 | |
---|---|
Text()
|
|
Text(java.lang.String value)
|
Method Summary | |
---|---|
java.lang.String |
getValue()
Returns the value. |
java.lang.String |
getWidgetClass()
Returns the widget class, "zhtml.Text". |
void |
invalidate()
Invalidates this component by setting the dirty flag such that it will be redraw the whole content of this component and its decendances later. |
protected boolean |
isChildable()
Returns whether this component can have a child. |
protected java.lang.Object |
newExtraCtrl()
Used by AbstractComponent.getExtraCtrl() to create extra controls. |
void |
redraw(java.io.Writer out)
Redraws this component and all its decendants. |
protected void |
renderProperties(ContentRenderer renderer)
Called by ( ComponentCtrl.redraw(java.io.Writer) ) to render the
properties, excluding the enclosing tag and children. |
void |
setParent(Component parent)
Sets the parent component. |
void |
setValue(java.lang.String value)
Sets the value. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Text()
public Text(java.lang.String value)
Method Detail |
---|
public java.lang.String getValue()
Default: "".
public void setValue(java.lang.String value)
public java.lang.String getWidgetClass()
getWidgetClass
in interface Component
getWidgetClass
in class AbstractComponent
public void setParent(Component parent)
Component
Note: Component.setParent(org.zkoss.zk.ui.Component)
always calls back Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and/or Component.removeChild(org.zkoss.zk.ui.Component)
,
while Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and Component.removeChild(org.zkoss.zk.ui.Component)
always calls back Component.setParent(org.zkoss.zk.ui.Component)
,
if the parent is changed. Thus, you don't need to override
both Component.insertBefore(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
and Component.setParent(org.zkoss.zk.ui.Component)
, if you want
to customize the behavior.
setParent
in interface Component
setParent
in class AbstractComponent
public void invalidate()
Component
If the application is totally controlled by the server side (i.e., you don't write client codes), you rarely need to access this method.
It can be called only in the request-processing and event-processing phases. However, it is NOT allowed in the rendering phase.
invalidate
in interface Component
invalidate
in class AbstractComponent
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 dervied 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 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 java.lang.Object newExtraCtrl()
AbstractComponent
AbstractComponent.getExtraCtrl()
to create extra controls.
It is used only by component developers.
Default: return null.
To provide extra controls, it is simpler to override this method
instead of AbstractComponent.getExtraCtrl()
.
By use of AbstractComponent.newExtraCtrl()
, you don't need to care of
cloning and serialization.
newExtraCtrl
in class AbstractComponent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |