Package org.adempiere.webui.editor
Class WNumberEditor
java.lang.Object
org.adempiere.webui.editor.WEditor
org.adempiere.webui.editor.WNumberEditor
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,IInputValidator
,ContextMenuListener
,org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
- Author:
- Ashley G Ramdass, Low Heng Sin, Cristina Ghita, www.arhipac.ro
- BF [3058780] WNumberEditor allow only BigDecimal
-
Nested Class Summary
Nested classes/interfaces inherited from class org.adempiere.webui.editor.WEditor
WEditor.DynamicDisplayListener
-
Field Summary
Fields inherited from class org.adempiere.webui.editor.WEditor
component, gridField, gridTab, IDEMPIERE_EDITOR_ATTR, INIT_EDIT_EVENT, label, listeners, mandatory, popupMenu, readOnly, tableEditor
-
Constructor Summary
ConstructorDescriptionDefault constructor, default toDisplayType.Number
.WNumberEditor
(int displayType) WNumberEditor
(String columnName, boolean mandatory, boolean readonly, boolean updateable, int displayType, String title) WNumberEditor
(GridField gridField) WNumberEditor
(GridField gridField, boolean integral) WNumberEditor
(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionaddDecimalPlaces
(BigDecimal oldValue) IDEMPIERE-2553 - Enter amounts without decimal separatorString[]
getValue()
boolean
protected static NumberBox
newNumberBox
(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) Create newNumberBox
instance.void
onEvent
(org.zkoss.zk.ui.event.Event event) Event handlervoid
onMenu
(ContextMenuEvent evt) Handle context menu eventsprotected void
setFieldStyle
(String style) Set field style to Decimalbox insideNumberBox
.void
setReadWrite
(boolean readWrite) void
setTableEditor
(boolean b) Set grid view mode.void
Set editor valueMethods inherited from class org.adempiere.webui.editor.WEditor
addChangeLogMenu, addDynamicDisplayListener, addTextEditorMenu, addValueChangeListener, applyFieldStyles, applyLabelStyles, buildStyle, cleanColumnName, dynamicDisplay, dynamicDisplay, fillHorizontal, fireValueChange, focusNext, getColumnName, getDescription, getDisplayComponent, getDisplayTextForGridView, getDisplayTextForGridView, getGridField, getLabel, getPopupMenu, getStyleEvaluatee, getValidInput, isComponentOfEditor, isMandatory, isMandatoryStyle, isNullOrEmpty, isProcessParameter, isSearchable, isShowPreference, isValid, isVisible, isZoomable, propertyChange, removeDynamicDisplayListener, removeValuechangeListener, setBackground, setBackground, setChangeEventWhenEditing, setColumnName, setComponent, setGridTab, setLabelStyle, setMandatory, setProcessParameter, setValidInput, setVisible, setVisible, showMenu, toString, updateLabelStyle, updateStyle, updateStyle
-
Field Details
-
LISTENER_EVENTS
-
MAX_DISPLAY_LENGTH
public static final int MAX_DISPLAY_LENGTH- See Also:
-
MIN_DISPLAY_LENGTH
public static final int MIN_DISPLAY_LENGTH- See Also:
-
-
Constructor Details
-
WNumberEditor
public WNumberEditor()Default constructor, default toDisplayType.Number
. -
WNumberEditor
public WNumberEditor(int displayType) - Parameters:
displayType
-
-
WNumberEditor
- Parameters:
gridField
-
-
WNumberEditor
public WNumberEditor(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) - Parameters:
gridField
-tableEditor
-editorConfiguration
-
-
WNumberEditor
- Parameters:
gridField
-integral
- true to create NumberBox for DisplayType.Integer
-
WNumberEditor
public WNumberEditor(String columnName, boolean mandatory, boolean readonly, boolean updateable, int displayType, String title) - Parameters:
columnName
-mandatory
-readonly
-updateable
-displayType
-title
-
-
-
Method Details
-
newNumberBox
protected static NumberBox newNumberBox(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) Create newNumberBox
instance.- Parameters:
gridField
-tableEditor
-editorConfiguration
-- Returns:
- NumberBox
-
onEvent
public void onEvent(org.zkoss.zk.ui.event.Event event) Event handler- Specified by:
onEvent
in interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
- Parameters:
event
-
-
addDecimalPlaces
IDEMPIERE-2553 - Enter amounts without decimal separator- Parameters:
oldValue
-- Returns:
- oldValue (if oldValue is already with decimal point)
or oldValue divided by AutomaticDecimalPlacesForAmoun value from Env context (for e.g, if AutomaticDecimalPlacesForAmoun=2, oldValue/100)
-
getComponent
- Overrides:
getComponent
in classWEditor
- Returns:
- NumberBox
-
isReadWrite
public boolean isReadWrite()- Specified by:
isReadWrite
in classWEditor
- Returns:
- true if editable
-
setReadWrite
public void setReadWrite(boolean readWrite) - Specified by:
setReadWrite
in classWEditor
-
getDisplay
- Specified by:
getDisplay
in classWEditor
- Returns:
- display text
-
getValue
-
setValue
Description copied from class:WEditor
Set editor value -
getEvents
- Overrides:
getEvents
in classWEditor
- Returns:
- list of
WEditor.component
events that this editor will listen to
-
onMenu
Handle context menu events- Specified by:
onMenu
in interfaceContextMenuListener
- Parameters:
evt
-
-
setTableEditor
public void setTableEditor(boolean b) Description copied from class:WEditor
Set grid view mode. Have no effect if editor doesn't has a separate grid view mode.- Overrides:
setTableEditor
in classWEditor
-
setFieldStyle
Set field style to Decimalbox insideNumberBox
.- Overrides:
setFieldStyle
in classWEditor
- Parameters:
style
-
-