Package org.adempiere.webui.editor
Class WSearchEditor
java.lang.Object
org.adempiere.webui.editor.WEditor
org.adempiere.webui.editor.WSearchEditor
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,IInputValidator
,IZoomableEditor
,ContextMenuListener
,ValueChangeListener
,org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
public class WSearchEditor
extends WEditor
implements ContextMenuListener, ValueChangeListener, IZoomableEditor
Default editor for
Implemented with
DisplayType.Search
and DisplayType.SearchUU
.Implemented with
WSearchEditor.CustomSearchBox
component and InfoPanel
, InfoWindow
dialog.- Author:
- Ashley G Ramdass
-
Nested Class Summary
Nested classes/interfaces inherited from class org.adempiere.webui.editor.WEditor
WEditor.DynamicDisplayListener
-
Field Summary
Modifier and TypeFieldDescriptionprotected ADWindow
ADWindow instance that own this editorstatic final String
Boolean component attribute to store whether info panel is openprotected InfoPanel
protected Lookup
protected boolean
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
ConstructorDescriptionWSearchEditor
(String columnName, boolean mandatory, boolean readonly, boolean updateable, Lookup lookup) WSearchEditor
(GridField gridField) WSearchEditor
(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) WSearchEditor
(Lookup lookup, String label, String description, boolean mandatory, boolean readonly, boolean updateable) Constructor for use if a grid field is unavailable -
Method Summary
Modifier and TypeMethodDescriptionprotected void
actionButton
(String queryValue) Handle onClick event fromWSearchEditor.CustomSearchBox
button.protected void
actionCombo
(Object value) Process value from InfoPanel/InfoWindow.
Fire ValueChangeEvent.protected void
Open drill assistant dialogprotected void
actionQuickEntry
(boolean newRecord) Action - Special Quick Entry Screenprotected void
actionRefresh
(Object value) Refresh editor valueprotected void
actionText
(String text) Process text input from uservoid
Zoom to window for reference/target tablestatic WSearchEditor
createBPartner
(int windowNo) Create new WSearhEditor instance for C_Invoice.C_BPartner_ID column.static WSearchEditor
createProduct
(int windowNo) Create new WSearchEditor instance for C_InvoiceLine.M_Product_ID column.void
Turn off auto complete for editorvoid
dynamicDisplay
(Properties ctx) Dynamic update of component statevoid
Turn on auto complete for editorgetDisplayTextForGridView
(Object value) String[]
getValue()
boolean
boolean
boolean
void
onEvent
(org.zkoss.zk.ui.event.Event e) void
onMenu
(ContextMenuEvent evt) On context menu eventprotected void
Reset state ofWSearchEditor.CustomSearchBox
button to defaultvoid
setMultipleSelection
(boolean multipleSelection) void
setReadWrite
(boolean readWrite) void
setTableEditor
(boolean b) Set grid view mode.void
Set editor valuevoid
Open InfoPanel/InfoWindow dialogvoid
On value change eventMethods inherited from class org.adempiere.webui.editor.WEditor
addChangeLogMenu, addDynamicDisplayListener, addTextEditorMenu, addValueChangeListener, applyFieldStyles, applyLabelStyles, buildStyle, cleanColumnName, dynamicDisplay, fillHorizontal, fireValueChange, focusNext, getColumnName, getDescription, getDisplayComponent, getDisplayTextForGridView, 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, setValidInput, setVisible, setVisible, showMenu, toString, updateLabelStyle, updateStyle, updateStyle
-
Field Details
-
ATTRIBUTE_IS_INFO_PANEL_OPEN
Boolean component attribute to store whether info panel is open- See Also:
-
lookup
-
infoPanel
-
adwindow
ADWindow instance that own this editor -
multipleSelection
protected boolean multipleSelection
-
-
Constructor Details
-
WSearchEditor
- Parameters:
gridField
-
-
WSearchEditor
public WSearchEditor(GridField gridField, boolean tableEditor, IEditorConfiguration editorConfiguration) - Parameters:
gridField
-tableEditor
-editorConfiguration
-
-
WSearchEditor
public WSearchEditor(Lookup lookup, String label, String description, boolean mandatory, boolean readonly, boolean updateable) Constructor for use if a grid field is unavailable- Parameters:
lookup
- Store of selectable datalabel
- field labeldescription
- description of componentmandatory
- whether field is mandatoryreadonly
- whether or not the editor is read onlyupdateable
- whether the editor contents can be changed
-
WSearchEditor
public WSearchEditor(String columnName, boolean mandatory, boolean readonly, boolean updateable, Lookup lookup) - Parameters:
columnName
-mandatory
-readonly
-updateable
-lookup
-
-
-
Method Details
-
getComponent
- Overrides:
getComponent
in classWEditor
- Returns:
- Component
-
isReadWrite
public boolean isReadWrite()- Specified by:
isReadWrite
in classWEditor
- Returns:
- true if editable
-
setReadWrite
public void setReadWrite(boolean readWrite) - Specified by:
setReadWrite
in classWEditor
-
enableAutoComplete
public void enableAutoComplete()Turn on auto complete for editor -
disableAutoComplete
public void disableAutoComplete()Turn off auto complete for editor -
setValue
Description copied from class:WEditor
Set editor value -
getValue
-
getDisplay
- Specified by:
getDisplay
in classWEditor
- Returns:
- display text
-
onEvent
public void onEvent(org.zkoss.zk.ui.event.Event e) - Specified by:
onEvent
in interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
-
actionRefresh
Refresh editor value- Parameters:
value
-
-
actionZoom
public void actionZoom()Zoom to window for reference/target table- Specified by:
actionZoom
in interfaceIZoomableEditor
-
onMenu
Description copied from interface:ContextMenuListener
On context menu event- Specified by:
onMenu
in interfaceContextMenuListener
-
actionText
Process text input from user- Parameters:
text
-
-
actionDrill
protected void actionDrill()Open drill assistant dialog -
resetButtonState
protected void resetButtonState()Reset state ofWSearchEditor.CustomSearchBox
button to default -
actionCombo
Process value from InfoPanel/InfoWindow.
Fire ValueChangeEvent.- Parameters:
value
-
-
actionQuickEntry
protected void actionQuickEntry(boolean newRecord) Action - Special Quick Entry Screen- Parameters:
newRecord
- true if new record should be created
-
actionButton
Handle onClick event fromWSearchEditor.CustomSearchBox
button.- Parameters:
queryValue
-
-
showInfoPanel
Open InfoPanel/InfoWindow dialog- Parameters:
ip
- InfoPanel
-
getEvents
- Overrides:
getEvents
in classWEditor
- Returns:
- list of
WEditor.component
events that this editor will listen to
-
valueChange
Description copied from interface:ValueChangeListener
On value change event- Specified by:
valueChange
in interfaceValueChangeListener
-
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
-
isShowingDialog
public boolean isShowingDialog()- Returns:
- true if InfoPanel/InfoWindow dialog is active
-
createBPartner
Create new WSearhEditor instance for C_Invoice.C_BPartner_ID column.- Parameters:
windowNo
-- Returns:
- WSearchEditor
-
createProduct
Create new WSearchEditor instance for C_InvoiceLine.M_Product_ID column.- Parameters:
windowNo
-- Returns:
- WSearchEditor
-
dynamicDisplay
Description copied from class:WEditor
Dynamic update of component state- Overrides:
dynamicDisplay
in classWEditor
-
getDisplayTextForGridView
- Overrides:
getDisplayTextForGridView
in classWEditor
- Returns:
- display text for grid view, for consumption by
WEditor.getDisplayComponent()
-
isMultipleSelection
public boolean isMultipleSelection()- Returns:
- true if info window allow multiple selection
-
setMultipleSelection
public void setMultipleSelection(boolean multipleSelection) - Parameters:
multipleSelection
-
-