org.zkoss.zul
Class Longbox
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.impl.InputElement
org.zkoss.zul.impl.FormatInputElement
org.zkoss.zul.impl.NumberInputElement
org.zkoss.zul.Longbox
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, HtmlBasedComponent, Component, Scope, ComponentCtrl, Longbox, Constrainted, FormatInputElement, InputElement, NumberInputElement, XulElement
public class Longbox
- extends NumberInputElement
- implements Longbox
An edit box for holding an integer.
Default getZclass(): z-longbox.(since 3.5.0)
- Author:
- tomyeh
- See Also:
- Serialized Form
| Methods inherited from class org.zkoss.zul.impl.InputElement |
checkUserError, clearErrorMessage, clearErrorMessage, getAreaText, getCols, getConstraint, getErrorMessage, getInnerAttrs, getMaxlength, getName, getRawText, getRawValue, getTabindex, getTargetValue, getText, getType, isChildable, isDisabled, isMultiline, isReadonly, isValid, newExtraCtrl, onWrongValue, select, setCols, setConstraint, setConstraint, setDisabled, setMaxlength, setName, setRawValue, setReadonly, setSelectedText, setSelectionRange, setTabindex, setText, setValueDirectly, showCustomError, validate |
| Methods inherited from class org.zkoss.zul.impl.XulElement |
getAction, getActionAttrs, getAllOnClickAttrs, getContext, getCtrlKeys, getPopup, getTooltip, setAction, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
| Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
focus, getAllOnClickAttrs, getDraggable, getDroppable, getHeight, getLeft, getMoldSclass, getRealSclass, getRealStyle, getRealStyleFlags, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZindex, getZIndex, redraw, setClass, setDraggable, setDroppable, setFocus, setHeight, setLeft, setMoldSclass, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndex |
| Methods inherited from class org.zkoss.zk.ui.AbstractComponent |
addAnnotation, addAnnotation, addEventHandler, addEventListener, addForward, addForward, addForward, addForward, addMoved, addSharedAnnotationMap, addSharedEventHandlerMap, appendAsapAttr, appendAsapAttr, appendChild, applyProperties, clone, containsVariable, detach, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttributes, getAttributes, getChildren, getCommand, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getExtraCtrl, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getMoldURI, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, hasFellow, insertBefore, invalidate, isAsapRequired, isInvalidated, isListenerAvailable, isVisible, newChildren, onChildAdded, onChildRemoved, onDrawNewChild, onPageAttached, onPageDetached, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setComponentDefinition, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, smartUpdate, smartUpdate, smartUpdate, smartUpdateDeferred, smartUpdateValues, toString, unsetVariable |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.zkoss.zul.impl.api.InputElement |
clearErrorMessage, clearErrorMessage, getAreaText, getCols, getErrorMessage, getMaxlength, getName, getRawText, getRawValue, getTabindex, getText, getType, isDisabled, isMultiline, isReadonly, isValid, select, setCols, setConstraint, setDisabled, setMaxlength, setName, setRawValue, setReadonly, setSelectedText, setSelectionRange, setTabindex, setText |
| 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, 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, getAttributes, getAttributes, getChildren, getDefinition, getDesktop, getFellow, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNamespace, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getUuid, getVariable, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, redraw, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setId, setMold, setPage, setPageBefore, setParent, setVariable, setVisible, unsetVariable |
Longbox
public Longbox()
Longbox
public Longbox(long value)
throws WrongValueException
- Throws:
WrongValueException
Longbox
public Longbox(int value)
throws WrongValueException
- Throws:
WrongValueException
getValue
public java.lang.Long getValue()
throws WrongValueException
- Returns the value (in Long), might be null unless
a constraint stops it.
- Specified by:
getValue in interface Longbox
- Throws:
WrongValueException - if user entered a wrong value
longValue
public long longValue()
throws WrongValueException
- Returns the value in long. If null, zero is returned.
- Specified by:
longValue in interface Longbox
- Throws:
WrongValueException
intValue
public long intValue()
throws WrongValueException
- Returns the value in int. If null, zero is returned.
- Specified by:
intValue in interface Longbox
- Throws:
WrongValueException
setValue
public void setValue(java.lang.Long value)
throws WrongValueException
- Sets the value (in Long).
- Specified by:
setValue in interface Longbox
- Throws:
WrongValueException - if value is wrong
getZclass
public java.lang.String getZclass()
- Description copied from class:
HtmlBasedComponent
- Returns the ZK Cascading Style class(es) for this component.
It usually depends on the implementation of the mold (@{link #getMold}).
Default: null (the default value depends on element).
HtmlBasedComponent.setZclass(java.lang.String)) will completely replace the default style
of a component. In other words, the default style of a component
is associated with the default value of HtmlBasedComponent.getZclass().
Once it is changed, the default style won't be applied at all.
If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String)
instead.
- Specified by:
getZclass in interface HtmlBasedComponent- Overrides:
getZclass in class HtmlBasedComponent
- See Also:
HtmlBasedComponent.getSclass(),
HtmlBasedComponent.getRealSclass()
coerceFromString
protected java.lang.Object coerceFromString(java.lang.String value)
throws WrongValueException
- Description copied from class:
InputElement
- Coerces the value passed to
InputElement.setText(java.lang.String).
Deriving note:
If you want to store the value in other type, say BigDecimal,
you have to override InputElement.coerceToString(java.lang.Object) and InputElement.coerceFromString(java.lang.String)
to convert between a string and your targeting type.
Moreover, when Textbox is called, it calls this method
with value = null. Derives shall handle this case properly.
- Specified by:
coerceFromString in class InputElement
- Throws:
WrongValueException
coerceToString
protected java.lang.String coerceToString(java.lang.Object value)
- Description copied from class:
InputElement
- Coerces the value passed to
InputElement.setText(java.lang.String).
Default: convert null to an empty string.
Deriving note:
If you want to store the value in other type, say BigDecimal,
you have to override InputElement.coerceToString(java.lang.Object) and InputElement.coerceFromString(java.lang.String)
to convert between a string and your targeting type.
- Specified by:
coerceToString in class InputElement
Copyright © 2005-2009 Potix Corporation. All Rights Reserved.