public class Label extends XulElement
Default getZclass()
: z-label.
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
int |
getMaxlength()
Returns the maximal length of the label.
|
org.zkoss.zk.ui.sys.PropertyAccess |
getPropertyAccess(String prop) |
String |
getValue()
Returns the value.
|
String |
getZclass() |
protected boolean |
isChildable()
No child is allowed.
|
boolean |
isHyphen()
Deprecated.
As of release 5.0.0, use CSS instead.
|
boolean |
isMultiline()
Returns whether to preserve the new line and the white spaces at the
beginning of each line.
|
boolean |
isPre()
Returns whether to preserve the white spaces, such as space,
tab and new line.
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
setHyphen(boolean hyphen)
Deprecated.
As of release 5.0.0, use CSS instead.
Use the CSS style called "word-wrap: word-break" to have similar effect. Unfortunately, word-wrap is not applicable to FF and Opera(it works fine with IE and Safari). |
void |
setMaxlength(int maxlength)
Sets the maximal length of the label.
|
void |
setMultiline(boolean multiline)
Sets whether to preserve the new line and the white spaces at the
beginning of each line.
|
void |
setPre(boolean pre)
Sets whether to preserve the white spaces, such as space,
tab and new line.
|
void |
setValue(String value)
Sets the value.
|
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
addSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
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, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, invalidatePartial, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
public Label()
public Label(String value)
public String getValue()
Default: "".
Deriving class can override it to return whatever it wants other than null.
public void setValue(String value)
public int getMaxlength()
Default: 0 (means no limitation)
public void setMaxlength(int maxlength)
public boolean isMultiline()
public void setMultiline(boolean multiline)
public boolean isPre()
It is the same as style="white-space:pre". However, IE has a bug when handling such style if the content is updated dynamically. Refer to Bug 1455584.
Note: the new line is preserved either isPre()
or
isMultiline()
returns true.
In other words, pre
implies multiline
public void setPre(boolean pre)
public boolean isHyphen()
public void setHyphen(boolean hyphen)
Use the CSS style called "word-wrap: word-break" to have similar effect. Unfortunately, word-wrap is not applicable to FF and Opera(it works fine with IE and Safari).
public org.zkoss.zk.ui.sys.PropertyAccess getPropertyAccess(String prop)
getPropertyAccess
in interface org.zkoss.zk.ui.sys.ComponentCtrl
getPropertyAccess
in class XulElement
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws IOException
renderProperties
in class XulElement
IOException
public String getZclass()
getZclass
in class org.zkoss.zk.ui.HtmlBasedComponent
public Object clone()
clone
in interface org.zkoss.zk.ui.Component
clone
in class XulElement
protected boolean isChildable()
isChildable
in class org.zkoss.zk.ui.AbstractComponent
Copyright © 2020. All rights reserved.