|
||||||||||
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.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.impl.InputElement
org.zkoss.zul.impl.FormatInputElement
org.zkoss.zul.impl.NumberInputElement
public abstract class NumberInputElement
A skeletal implementation for number-type input box.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl |
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
org.zkoss.zk.ui.AbstractComponent.Children |
Field Summary |
---|
Fields inherited from class org.zkoss.zul.impl.InputElement |
---|
_value |
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
_zclass |
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 | |
---|---|
NumberInputElement()
|
Method Summary | |
---|---|
protected java.lang.String |
formatNumber(java.lang.Object value,
java.lang.String defaultFormat)
Formats a number (Integer, BigDecimal...) into a string. |
protected java.lang.String |
getDefaultFormat()
Return a default format for the number input element when the locale is specified. |
protected java.util.Locale |
getDefaultLocale()
Returns the default locale, either getLocale() or
Locales.getCurrent() (never null). |
java.util.Locale |
getLocale()
Returns the locale associated with this number input element, or null if Locales.getCurrent() is preferred. |
int |
getRoundingMode()
Returns the rounding mode. |
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
|
void |
setLocale(java.util.Locale locale)
Sets the locale used to identify the symbols of this number input element. |
void |
setLocale(java.lang.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(java.lang.String name)
Sets the rounding mode by the name. |
protected java.lang.Object[] |
toNumberOnly(java.lang.String val)
Filters out non digit characters, such comma and whitespace, from the specified value. |
Methods inherited from class org.zkoss.zul.impl.FormatInputElement |
---|
getFormat, getRealFormat, setFormat |
Methods inherited from class org.zkoss.zul.impl.InputElement |
---|
checkUserError, clearErrorMessage, clearErrorMessage, clone, coerceFromString, coerceToString, getCols, getConstraint, getErrorMessage, getInstant, getMaxlength, getName, getPlaceholder, getRawText, getRawValue, getTabindex, getTargetValue, getText, getType, isChildable, isDisabled, isInplace, 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, validate |
Methods inherited from class org.zkoss.zul.impl.XulElement |
---|
getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setCtrlKeys, setPopup, setPopup, setTooltip, setTooltip |
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent |
---|
focus, 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, setZIndexDirectly |
Methods inherited from class org.zkoss.zk.ui.AbstractComponent |
---|
addAnnotation, addAnnotation, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addScopeListener, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableClientUpdate, equals, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, removeScopeListener, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, willPassivate, willPassivate, willSerialize, willSerialize |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NumberInputElement()
Method Detail |
---|
public 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_UP
java.lang.UnsupportedOperationException
- if Java 5 or belowpublic void setRoundingMode(java.lang.String name)
name
- the rounding mode's name. Allowed value:
java.lang.UnsupportedOperationException
- if Java 5 or belowRoundingModes
public int getRoundingMode()
Default: BigDecimal.ROUND_HALF_EVEN
.
public java.util.Locale getLocale()
Locales.getCurrent()
is preferred.
public void setLocale(java.util.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(java.lang.String locale)
Default: null (i.e., Locales.getCurrent()
, the current locale
is assumed)
protected java.util.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 java.io.IOException
renderProperties
in class FormatInputElement
java.io.IOException
protected java.lang.String getDefaultFormat()
Default: ##,##0.##
, you can overwrite this by specifying
the following setting in zk.xml
org.zkoss.zul.numberFormat
##,##0.##
setLocale(Locale)
protected java.lang.String formatNumber(java.lang.Object value, java.lang.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 java.lang.Object[] toNumberOnly(java.lang.String val)
formatNumber(java.lang.Object, java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |