public abstract class NumberInputElement extends FormatInputElement
_value| Constructor and Description |
|---|
NumberInputElement() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
formatNumber(Object value,
String defaultFormat)
Formats a number (Integer, BigDecimal...) into a string.
|
protected String |
getDefaultFormat()
Return a default format for the number input element when the locale is specified.
|
protected Locale |
getDefaultLocale()
Returns the default locale, either
getLocale() or
Locales.getCurrent() (never null). |
Locale |
getLocale()
Returns the locale associated with this number input element,
or null if
Locales.getCurrent() is preferred. |
org.zkoss.zk.ui.sys.PropertyAccess |
getPropertyAccess(String prop) |
int |
getRoundingMode()
Returns the rounding mode.
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
setLocale(Locale locale)
Sets the locale used to identify the symbols of this number input element.
|
void |
setLocale(String locale)
Sets the locale used to identify the symbols of this number input element.
|
void |
setRoundingMode(int mode)
Sets the rounding mode.
|
void |
setRoundingMode(String name)
Sets the rounding mode by the name.
|
protected Object[] |
toNumberOnly(String val)
Filters out non digit characters, such comma and whitespace,
from the specified value.
|
getFormat, getRealFormat, setFormatcheckUserError, clearErrorMessage, clearErrorMessage, clone, coerceFromString, coerceToString, getCols, getConstraint, getErrorMessage, getInstant, getMaxlength, getName, getPlaceholder, getRawText, getRawValue, getTabindex, getTargetValue, getText, getType, isChildable, isDisabled, isInplace, isInstant, isMultiline, isReadonly, isValid, marshall, onWrongValue, select, service, setCols, setConstraint, setConstraint, setDisabled, setErrorMessage, setInplace, setInstant, setMaxlength, setName, setPlaceholder, setRawValue, setReadonly, setSelectedText, setSelectionRange, setTabindex, setText, setValueDirectly, showCustomError, unmarshall, validategetContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltipfocus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeightDirectly, setHflex, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTooltiptext, setTop, setTopDirectly, setVflex, setWidth, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyaddAnnotation, addAnnotation, 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, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, 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, getShadowRoots, 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, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, 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, willSerializepublic void setRoundingMode(int mode)
mode - the rounding mode. Allowed value:
BigDecimal.ROUND_CEILING, BigDecimal.ROUND_DOWN,
BigDecimal.ROUND_FLOOR, BigDecimal.ROUND_HALF_DOWN,
BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_EVEN,
BigDecimal.ROUND_UNNECESSARY and BigDecimal.ROUND_UPUnsupportedOperationException - if Java 5 or belowpublic void setRoundingMode(String name)
name - the rounding mode's name. Allowed value:
UnsupportedOperationException - if Java 5 or belowRoundingModespublic int getRoundingMode()
Default: BigDecimal.ROUND_HALF_EVEN.
public Locale getLocale()
Locales.getCurrent() is preferred.public void setLocale(Locale locale)
Default: null (i.e., Locales.getCurrent(), the current locale
is assumed)
If the format of FormatInputElement.getFormat() is null, the format is assumed from
getDefaultFormat(). (since 5.0.9)
public void setLocale(String locale)
Default: null (i.e., Locales.getCurrent(), the current locale
is assumed)
protected Locale getDefaultLocale()
getLocale() or
Locales.getCurrent() (never null).
It is useful when you wan to get a locale for this input.protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
throws IOException
renderProperties in class FormatInputElementIOExceptionprotected String getDefaultFormat()
Default: ##,##0.##, you can overwrite this by specifying
the following setting in zk.xml
org.zkoss.zul.numberFormat
##,##0.##
setLocale(Locale)protected String formatNumber(Object value, String defaultFormat)
A utility to assist the handling of numeric data.
defaultFormat - used if FormatInputElement.getFormat() returns null.
If defaultFormat and FormatInputElement.getFormat() are both null,
the system's default format is used.toNumberOnly(java.lang.String)protected Object[] toNumberOnly(String val)
formatNumber(java.lang.Object, java.lang.String)public org.zkoss.zk.ui.sys.PropertyAccess getPropertyAccess(String prop)
getPropertyAccess in interface org.zkoss.zk.ui.sys.ComponentCtrlgetPropertyAccess in class FormatInputElementCopyright © 2015. All rights reserved.