Package org.adempiere.webui.editor
Class WRecordEditor<T>
java.lang.Object
org.adempiere.webui.editor.WEditor
org.adempiere.webui.editor.WRecordEditor<T>
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,IInputValidator
,IZoomableEditor
,ContextMenuListener
,org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
- Direct Known Subclasses:
WRecordIDEditor
,WRecordUUIDEditor
public abstract class WRecordEditor<T>
extends WEditor
implements ContextMenuListener, IZoomableEditor
Default editor for
Implemented with composite component of
The editor uses
DisplayType.RecordID
and DisplayType.RecordUU
.Implemented with composite component of
Textbox
and ToolBarButton
.The editor uses
WRecordIDDialog
for edit or viewing.- Author:
- Peter Takacs, Cloudempiere
-
Nested Class Summary
Nested classes/interfaces inherited from class org.adempiere.webui.editor.WEditor
WEditor.DynamicDisplayListener
-
Field Summary
Modifier and TypeFieldDescriptionprotected ToolBarButton
protected Object
Record_ID or Record_UU valueprotected Textbox
protected GridField
Current tab's AD_Table_ID GridFieldprotected Object
AD_Table_ID valueprotected ToolBarButton
Fields inherited from class org.adempiere.webui.editor.WEditor
component, gridField, gridTab, IDEMPIERE_EDITOR_ATTR, INIT_EDIT_EVENT, label, listeners, mandatory, MAX_DISPLAY_LENGTH, popupMenu, readOnly, tableEditor
-
Constructor Summary
ConstructorDescriptionWRecordEditor
(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) Constructor -
Method Summary
Modifier and TypeMethodDescriptionGet AD_Table_IDorg.zkoss.zul.Div
getDisplayTextForGridView
(GridRowCtx gridRowCtx, Object value) getValue()
protected void
init()
Init component and context menuboolean
abstract boolean
Use UUID as key columnvoid
onEvent
(org.zkoss.zk.ui.event.Event event) void
onMenu
(ContextMenuEvent evt) void
setAD_Table_ID
(Object tableID) Set AD_Table_IDvoid
setReadWrite
(boolean readWrite) void
Set editor valueprotected void
Set Valueabstract T
toKeyValue
(Object value) Convert value to key value typeabstract String
validateTableIdValue
(int tableId) Validate selected table id 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, getEvents, getGridField, getLabel, getPopupMenu, getStyleEvaluatee, getValidInput, isComponentOfEditor, isMandatory, isMandatoryStyle, isNullOrEmpty, isProcessParameter, isSearchable, isShowPreference, isValid, isVisible, isZoomable, propertyChange, removeDynamicDisplayListener, removeValuechangeListener, setBackground, setBackground, setChangeEventWhenEditing, setColumnName, setComponent, setFieldStyle, setGridTab, setLabelStyle, setMandatory, setProcessParameter, setTableEditor, setValidInput, setVisible, setVisible, showMenu, toString, updateLabelStyle, updateStyle, updateStyle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.adempiere.webui.editor.IZoomableEditor
actionZoom
-
Field Details
-
recordIDValue
Record_ID or Record_UU value -
tableIDValue
AD_Table_ID value -
tableIDGridField
Current tab's AD_Table_ID GridField -
recordTextBox
-
editButton
-
zoomButton
-
-
Constructor Details
-
WRecordEditor
public WRecordEditor(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) Constructor- Parameters:
gridField
-tableEditor
-editorConfiguration
-
-
-
Method Details
-
init
protected void init()Init component and context menu -
onMenu
- Specified by:
onMenu
in interfaceContextMenuListener
-
setReadWrite
public void setReadWrite(boolean readWrite) - Specified by:
setReadWrite
in classWEditor
-
isReadWrite
public boolean isReadWrite()- Specified by:
isReadWrite
in classWEditor
- Returns:
- true if editable
-
setValue
Description copied from class:WEditor
Set editor value -
setValue
Set Value- Parameters:
value
- new valuefire
- true to fire value change event
-
getValue
-
getDisplay
- Specified by:
getDisplay
in classWEditor
- Returns:
- display text
-
getDisplayTextForGridView
- Overrides:
getDisplayTextForGridView
in classWEditor
- Parameters:
gridRowCtx
-GridRowCtx
- Returns:
- display text for grid view, for consumption by
WEditor.getDisplayComponent()
-
onEvent
-
getAD_Table_ID
Get AD_Table_ID- Returns:
- AD_Table_ID value
-
setAD_Table_ID
Set AD_Table_ID- Parameters:
tableID
-
-
getComponent
public org.zkoss.zul.Div getComponent()- Overrides:
getComponent
in classWEditor
- Returns:
- Component
-
isUseUUIDKey
public abstract boolean isUseUUIDKey()Use UUID as key column- Returns:
- Key column name
-
toKeyValue
Convert value to key value type- Parameters:
value
-- Returns:
- key value
-
validateTableIdValue
Validate selected table id value- Parameters:
tableId
-- Returns:
- error message or null
-