org.zkoss.zul.api
Interface Label

All Superinterfaces:
java.lang.Cloneable, Component, HtmlBasedComponent, Scope, java.io.Serializable, XulElement
All Known Implementing Classes:
Label

public interface Label
extends XulElement

A label.

Since:
3.5.2
Author:
tomyeh

Field Summary
 
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
 
Method Summary
 int getMaxlength()
          Returns the maximal length of the label.
 java.lang.String getValue()
          Returns the value.
 boolean isHyphen()
          Returns whether to hyphenate a long word if maxlength is specified.
 boolean isMultiline()
          Returns whether to preserve the new line and the white spaces at the begining of each line.
 boolean isPre()
          Returns whether to preserve the white spaces, such as space, tab and new line.
 void setHyphen(boolean hyphen)
          Sets whether to hyphen a long word if maxlength is specified.
 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 begining of each line.
 void setPre(boolean pre)
          Sets whether to preserve the white spaces, such as space, tab and new line.
 void setValue(java.lang.String value)
          Sets the value.
 
Methods inherited from interface org.zkoss.zul.impl.api.XulElement
getAction, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip
 
Methods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex
 
Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, containsVariable, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getChildren, getDefinition, getDesktop, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, setWidgetListener, setWidgetOverride, unsetVariable
 
Methods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
 

Method Detail

getValue

java.lang.String getValue()
Returns the value.

Default: "".


setValue

void setValue(java.lang.String value)
Sets the value.


getMaxlength

int getMaxlength()
Returns the maximal length of the label.

Noteice:

hyphen="false" and pre="false"
maxlength is the maximal length to display. Exceeding part is truncated.
hyphen="true"
maxlength is the maximal length of each line, and hyphenation is added if a line exceeds maxlength.
hyphen="false" and pre="true"
maxlength has no effect.
maxlength=0
hyphen has no effect

Since 3.0.4, you can set the style class (@{link #setSclass}) to "word-wrap" to wrap a long word instead of using the hyphen and maxlength property. However, word-wrap is not applicable to Opera (it works fine with FF, IE and Safari).


setMaxlength

void setMaxlength(int maxlength)
Sets the maximal length of the label.

See getMaxlength() for the relationship among pre, hyphen and maxlength.


isPre

boolean isPre()
Returns whether to preserve the white spaces, such as space, tab and new line.

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.

See getMaxlength() for the relationship among pre, hyphen and maxlength.

Note: the new line is preserved either isPre() or isMultiline() returns true. In other words, pre implies multiline


setPre

void setPre(boolean pre)
Sets whether to preserve the white spaces, such as space, tab and new line.

See getMaxlength() for the relationship among pre, hyphen and maxlength.


isMultiline

boolean isMultiline()
Returns whether to preserve the new line and the white spaces at the begining of each line.

Note: the new line is preserved either isPre() or isMultiline() returns true. In other words, pre implies multiline


setMultiline

void setMultiline(boolean multiline)
Sets whether to preserve the new line and the white spaces at the begining of each line.


isHyphen

boolean isHyphen()
Returns whether to hyphenate a long word if maxlength is specified.

Since 3.0.4, you can set the style class (@{link #setSclass}) to "word-wrap" to wrap a long word instead of using the hyphen and maxlength property. However, word-wrap is not applicable to Opera (it works fine with FF, IE and Safari).

See getMaxlength() for the relationship among pre, hyphen and maxlength.


setHyphen

void setHyphen(boolean hyphen)
Sets whether to hyphen a long word if maxlength is specified.

See getMaxlength() for the relationship among pre, hyphen and maxlength.



Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo