Package org.adempiere.webui.adwindow
Class AbstractADWindowContent
java.lang.Object
org.adempiere.webui.part.AbstractUIPart
org.adempiere.webui.adwindow.AbstractADWindowContent
- All Implemented Interfaces:
EventListener
,ActionListener
,ToolbarListener
,ISupportMask
,ITabOnSelectHandler
,UIPart
,DataStatusListener
,org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
- Direct Known Subclasses:
ADWindowContent
public abstract class AbstractADWindowContent
extends AbstractUIPart
implements ToolbarListener, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>, DataStatusListener, ActionListener, ITabOnSelectHandler
Abstract model class for the content of AD Window (toolbar+breadcrumb+tabs+statusbar).
- Version:
- $Revision: 0.10 $
- Author:
- Ashley G Ramdass, Low Heng Sin, Cristina Ghita, www.arhipac.ro
see FR [ 2877111 ] See identifiers columns when delete records https://sourceforge.net/p/adempiere/feature-requests/855/, hengsin, hengsin.low@idalica.com
see FR [2887701] https://sourceforge.net/p/adempiere/feature-requests/866/, Teo Sarca, teo.sarca@gmail.com
- BF [ 2992540 ] Grid/Panel not refreshed after process run https://sourceforge.net/p/adempiere/zk-web-client/418/
- BF [ 2985892 ] Opening a window using a new record query is not working https://sourceforge.net/p/adempiere/zk-web-client/411/
-
Field Summary
Modifier and TypeFieldDescriptionprotected IADTabbox
UI part for AD_Tabsprotected ADWindow
protected BreadCrumb
path to selected tabprotected QuickGridView
Implementation to work key listener for the current open Quick Form.protected org.zkoss.zk.ui.Component
track last focus field editor componentMaintain no of quick form tabs openprotected boolean
true if confirmation for exit dialog is visibleprotected StatusBar
status bar for message and record infoprotected StatusBar
Quick Form Status barprotected String
window titleprotected ADWindowToolbar
Fields inherited from class org.adempiere.webui.part.AbstractUIPart
page, showMaskWrapper
Fields inherited from interface org.adempiere.webui.ISupportMask
READY_SHOW_MASK_FLAG
Fields inherited from interface org.adempiere.webui.part.ITabOnSelectHandler
ATTRIBUTE_KEY
-
Constructor Summary
ConstructorDescriptionAbstractADWindowContent
(Properties ctx, int windowNo, int adWindowId) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) Delegate toactionButton(IProcessButton)
void
closeQuickFormTab
(Integer AD_Tab_ID) Close Quick form to remove tabID from the listprotected abstract IADTabbox
Override to createIADTabbox
instance.org.zkoss.zk.ui.Component
createPart
(Object parent) CreateIADTabbox
and setup listeners.void
Data Changedvoid
Simulate opening the Find Window, selecting a user query and click okprotected void
doOnRefresh
(boolean fireEvent) Refresh all rowsvoid
Deprecated, for removal: This API element is subject to removal in a future version.void
executeButtonProcess
(IProcessButton wButton, boolean startWOasking, int table_ID, int record_ID, boolean isProcessMandatory, Callback<Boolean> callback) Show process, form or info window dialog for button.void
executeButtonProcess
(IProcessButton wButton, boolean startWOasking, int table_ID, int record_ID, String record_UU, boolean isProcessMandatory, Callback<Boolean> callback) Show process, form or info window dialog for button.findADTabpanel
(IProcessButton button) void
set focus to active tab panelboolean
restore focus to last known focus editor (if any)boolean
focusToLastFocusEditor
(boolean defer) restore focus to last known focus editor (if any)getADTab()
Get cache find window for current selected tabboolean
getFindWindow
(GridField[] findFields) getImage()
Get list of open quick form tabsgetTitle()
int
void
hide busy maskboolean
Init all tab panels.protected GridTab
Init tab at tabIndex.boolean
isBlock()
boolean
boolean
void
Show active workflow for current recordvoid
Delegate toWArchive
void
Open the attachment dialogvoid
onChat()
open chat windowvoid
onCopy()
Copy current record as a new recordvoid
Delegate toCSVImportAction
void
show dialog to customize fields (hidden, display, order of field) in grid modevoid
onDelete()
Delete current recordvoid
Navigate to detail record, i.e next tabvoid
onEvent
(org.zkoss.zk.ui.event.Event event) void
handle on exit/close of windowvoid
onExport()
Delegate toExportAction
void
Delegate toFileImportAction
void
onFind()
Delegate todoOnFind()
void
onFirst()
Navigate to first recordvoid
onHelp()
Open the help windowvoid
onIgnore()
Ignore user changesvoid
onLabel()
Open Label panel.void
onLast()
Navigate to last recordvoid
onLock()
Personal lockvoid
onNew()
Create new recordvoid
onNext()
Navigate to next recordvoid
Navigate to parent record.void
onPostIt()
Open Post It note dialog.void
Navigate to previous recordvoid
onPrint()
Delegate toonPrintCallback(Callback)
void
Show popup menu for process toolbar button (the gear button)void
View product infovoid
Open quick formvoid
onQuickForm
(boolean stayInParent) Open quick formvoid
Refresh current recordvoid
onRefresh
(boolean fireEvent) Refresh all row.void
onRefresh
(boolean fireEvent, boolean saveCurrentRow) Refresh all row.void
onReport()
Delegate toonReport0()
void
Delegate toWRequest
void
onSave()
Delegate toonSave(boolean, boolean, Callback)
void
FireWindowValidatorEvent
and delegate actual save toonSaveCallback(boolean, boolean, Callback)
void
Save and create new record.void
Handle WPaymentEditor.ON_SAVE_PAYMENT event.void
Delegate todoOnQueryChange()
void
onSelect()
handle tab on_select eventvoid
onToggle()
Toggle record presentation between free form and tabularvoid
onTreeNavigate
(GridTab gt, int rowIndex) handle tree navigationvoid
Delegate toWZoomAcross
.boolean
registerQuickFormTab
(Integer AD_Tab_ID) Register Quick form against tabIDvoid
saveAndNavigate
(Callback<Boolean> callback) save (if needed) and execute callbackvoid
setADWindow
(ADWindow adwindow) void
setCurrQGV
(QuickGridView currQGV) void
setLastFocusEditor
(org.zkoss.zk.ui.Component component) Set component of last focus editor.void
setStatusBarQF
(StatusBar statusBar) void
showBusyMask
(Window window) show busy mask over windowprotected abstract void
switchEditStatus
(boolean editStatus) Handle switching of editing status.Methods inherited from class org.adempiere.webui.part.AbstractUIPart
doCreatePart, getMaskComponent, getMaskObj, hideMask, showMask
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.adempiere.webui.part.UIPart
getComponent
-
Field Details
-
statusBar
status bar for message and record info -
adTabbox
UI part for AD_Tabs -
toolbar
-
title
window title -
breadCrumb
path to selected tab -
statusBarQF
Quick Form Status bar -
quickFormOpenTabs
Maintain no of quick form tabs open -
lastFocusEditor
protected org.zkoss.zk.ui.Component lastFocusEditortrack last focus field editor component -
adwindow
-
showingOnExitDialog
protected boolean showingOnExitDialogtrue if confirmation for exit dialog is visible -
currQGV
Implementation to work key listener for the current open Quick Form.
-
-
Constructor Details
-
AbstractADWindowContent
Constructor- Parameters:
ctx
-windowNo
-adWindowId
-
-
-
Method Details
-
createPart
- Specified by:
createPart
in interfaceUIPart
- Overrides:
createPart
in classAbstractUIPart
- Parameters:
parent
-- Returns:
- Component
-
getBreadCrumb
- Returns:
BreadCrumb
-
getStatusBar
- Returns:
StatusBar
-
createADTab
Override to createIADTabbox
instance.- Returns:
IADTabbox
-
switchEditStatus
protected abstract void switchEditStatus(boolean editStatus) Handle switching of editing status. Override to set isEditting to true/false at widget side.- Parameters:
editStatus
- true if editing (dirty)
-
focusToActivePanel
public void focusToActivePanel()set focus to active tab panel -
initPanel
Init all tab panels. Delegate the init of each individual tab panel toinitTab(MQuery, int)
.- Parameters:
query
-- Returns:
- boolean
-
initTab
Init tab at tabIndex. Further delegate toinitTabPanel(MQuery, int, GridTab, IADTabpanel)
.- Parameters:
query
-tabIndex
-- Returns:
GridTab
-
getTitle
- Returns:
- title of window
-
getImage
- Returns:
MImage
of window title
-
onDetailRecord
public void onDetailRecord()Description copied from interface:ToolbarListener
Navigate to detail record, i.e next tab- Specified by:
onDetailRecord
in interfaceToolbarListener
- See Also:
-
onParentRecord
public void onParentRecord()Navigate to parent record. Delegate toBreadCrumbLink
ON_Click event.- Specified by:
onParentRecord
in interfaceToolbarListener
- See Also:
-
onFirst
public void onFirst()Description copied from interface:ToolbarListener
Navigate to first record- Specified by:
onFirst
in interfaceToolbarListener
- See Also:
-
onLast
public void onLast()Description copied from interface:ToolbarListener
Navigate to last record- Specified by:
onLast
in interfaceToolbarListener
- See Also:
-
onNext
public void onNext()Description copied from interface:ToolbarListener
Navigate to next record- Specified by:
onNext
in interfaceToolbarListener
- See Also:
-
onPrevious
public void onPrevious()Description copied from interface:ToolbarListener
Navigate to previous record- Specified by:
onPrevious
in interfaceToolbarListener
- See Also:
-
onLock
public void onLock()Description copied from interface:ToolbarListener
Personal lock- Specified by:
onLock
in interfaceToolbarListener
- See Also:
-
onAttachment
public void onAttachment()Description copied from interface:ToolbarListener
Open the attachment dialog- Specified by:
onAttachment
in interfaceToolbarListener
- See Also:
-
onChat
public void onChat()Description copied from interface:ToolbarListener
open chat window- Specified by:
onChat
in interfaceToolbarListener
-
onPostIt
public void onPostIt()Open Post It note dialog. -
onLabel
public void onLabel()Open Label panel. Delegate toLabelAction
-
onToggle
public void onToggle()Description copied from interface:ToolbarListener
Toggle record presentation between free form and tabular- Specified by:
onToggle
in interfaceToolbarListener
- See Also:
-
onExit
handle on exit/close of window- Parameters:
callback
-
-
focusToLastFocusEditor
public boolean focusToLastFocusEditor()restore focus to last known focus editor (if any)- Returns:
- true if there's last focus editor
-
focusToLastFocusEditor
public boolean focusToLastFocusEditor(boolean defer) restore focus to last known focus editor (if any)- Parameters:
defer
- true to schedule for later/defer execution- Returns:
- true if there's last focus editor
-
onQuickForm
public void onQuickForm()Open quick form -
onQuickForm
public void onQuickForm(boolean stayInParent) Open quick form- Parameters:
stayInParent
- true to goes back to parent record after quick form have been closed
-
onEvent
public void onEvent(org.zkoss.zk.ui.event.Event event) - Specified by:
onEvent
in interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
- Parameters:
event
-- See Also:
-
EventListener.onEvent(Event)
-
dataStatusChanged
Description copied from interface:DataStatusListener
Data Changed- Specified by:
dataStatusChanged
in interfaceDataStatusListener
- Parameters:
e
-- See Also:
-
isFirstTab
public boolean isFirstTab()- Returns:
- true if selected tab is first tab
-
onRefresh
public void onRefresh(boolean fireEvent) Refresh all row. Delegate toonRefresh(boolean, boolean)
- Parameters:
fireEvent
-
-
onRefresh
public void onRefresh(boolean fireEvent, boolean saveCurrentRow) Refresh all row. Delegate todoOnRefresh(boolean)
- Parameters:
fireEvent
-saveCurrentRow
- if true, save before refresh
-
doOnRefresh
protected void doOnRefresh(boolean fireEvent) Refresh all rows- Parameters:
fireEvent
- true to fireStateChangeEvent
-
onRefresh
public void onRefresh()Description copied from interface:ToolbarListener
Refresh current record- Specified by:
onRefresh
in interfaceToolbarListener
- See Also:
-
onHelp
public void onHelp()Description copied from interface:ToolbarListener
Open the help window- Specified by:
onHelp
in interfaceToolbarListener
- See Also:
-
onNew
public void onNew()Description copied from interface:ToolbarListener
Create new record- Specified by:
onNew
in interfaceToolbarListener
-
onCopy
public void onCopy()Description copied from interface:ToolbarListener
Copy current record as a new record- Specified by:
onCopy
in interfaceToolbarListener
-
onFind
public void onFind()Delegate todoOnFind()
- Specified by:
onFind
in interfaceToolbarListener
- See Also:
-
onIgnore
public void onIgnore()Description copied from interface:ToolbarListener
Ignore user changes- Specified by:
onIgnore
in interfaceToolbarListener
-
onSave
public void onSave()Delegate toonSave(boolean, boolean, Callback)
- Specified by:
onSave
in interfaceToolbarListener
- See Also:
-
onSave
FireWindowValidatorEvent
and delegate actual save toonSaveCallback(boolean, boolean, Callback)
- Parameters:
onSaveEvent
-onNavigationEvent
-callback
-
-
onSavePayment
public void onSavePayment()Handle WPaymentEditor.ON_SAVE_PAYMENT event. Do not call this directly. -
onSaveCreate
public void onSaveCreate()Save and create new record. Delegate toonSave(boolean, boolean, Callback)
.- Specified by:
onSaveCreate
in interfaceToolbarListener
- See Also:
-
onDelete
public void onDelete()Description copied from interface:ToolbarListener
Delete current record- Specified by:
onDelete
in interfaceToolbarListener
-
onPrint
public void onPrint()Delegate toonPrintCallback(Callback)
- Specified by:
onPrint
in interfaceToolbarListener
-
onReport
public void onReport()Delegate toonReport0()
- Specified by:
onReport
in interfaceToolbarListener
- See Also:
-
onZoomAcross
public void onZoomAcross()Delegate toWZoomAcross
.- Specified by:
onZoomAcross
in interfaceToolbarListener
- See Also:
-
onActiveWorkflows
public void onActiveWorkflows()Description copied from interface:ToolbarListener
Show active workflow for current record- Specified by:
onActiveWorkflows
in interfaceToolbarListener
- See Also:
-
onRequests
public void onRequests()Delegate toWRequest
- Specified by:
onRequests
in interfaceToolbarListener
- See Also:
-
onProductInfo
public void onProductInfo()Description copied from interface:ToolbarListener
View product info- Specified by:
onProductInfo
in interfaceToolbarListener
- See Also:
-
onArchive
public void onArchive()Delegate toWArchive
- Specified by:
onArchive
in interfaceToolbarListener
- See Also:
-
onExport
public void onExport()Delegate toExportAction
- Specified by:
onExport
in interfaceToolbarListener
-
onFileImport
public void onFileImport()Delegate toFileImportAction
- Specified by:
onFileImport
in interfaceToolbarListener
-
onCSVImport
public void onCSVImport()Delegate toCSVImportAction
- Specified by:
onCSVImport
in interfaceToolbarListener
-
onSearchQuery
public void onSearchQuery()Delegate todoOnQueryChange()
- Specified by:
onSearchQuery
in interfaceToolbarListener
-
doOnQueryChange
public void doOnQueryChange()Simulate opening the Find Window, selecting a user query and click ok -
hideBusyMask
public void hideBusyMask()hide busy mask -
showBusyMask
show busy mask over window- Parameters:
window
-
-
isBlock
public boolean isBlock()- Returns:
- true if window is block by mask or highlighted window
-
executeButtonProcess
public void executeButtonProcess(IProcessButton wButton, boolean startWOasking, int table_ID, int record_ID, boolean isProcessMandatory, Callback<Boolean> callback) Show process, form or info window dialog for button. Delegate toexecuteButtonProcess0(IProcessButton, boolean, int, int, String, Callback)
orexecutionButtonInfoWindow0(IProcessButton)
.- Parameters:
wButton
-startWOasking
-table_ID
-record_ID
-isProcessMandatory
-callback
-
-
executeButtonProcess
public void executeButtonProcess(IProcessButton wButton, boolean startWOasking, int table_ID, int record_ID, String record_UU, boolean isProcessMandatory, Callback<Boolean> callback) Show process, form or info window dialog for button. Delegate toexecuteButtonProcess0(IProcessButton, boolean, int, int, String, Callback)
orexecutionButtonInfoWindow0(IProcessButton)
.- Parameters:
wButton
-startWOasking
-table_ID
-record_ID
-record_UU
-isProcessMandatory
-callback
-
-
actionPerformed
Delegate toactionButton(IProcessButton)
- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
event
-- See Also:
-
findADTabpanel
- Parameters:
button
-- Returns:
IADTabpanel
-
getADTab
- Returns:
IADTabbox
-
executeASync
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
pi
-
-
getToolbar
- Returns:
- toolbar instance
-
getActiveGridTab
- Returns:
GridTab
of selected tab
-
getWindowNo
public int getWindowNo()- Returns:
- windowNo
-
onCustomize
public void onCustomize()show dialog to customize fields (hidden, display, order of field) in grid mode- Specified by:
onCustomize
in interfaceToolbarListener
- See Also:
-
onProcess
public void onProcess()Show popup menu for process toolbar button (the gear button)- Specified by:
onProcess
in interfaceToolbarListener
- See Also:
-
onSelect
public void onSelect()Description copied from interface:ITabOnSelectHandler
handle tab on_select event- Specified by:
onSelect
in interfaceITabOnSelectHandler
-
isPendingChanges
public boolean isPendingChanges()- Returns:
- true if dirty
-
setADWindow
- Parameters:
adwindow
-
-
getADWindow
- Returns:
ADWindow
-
getFindWindow
- Parameters:
findFields
-- Returns:
- true if find window found and init ok
-
getCurrentFindWindow
Get cache find window for current selected tab- Returns:
FindWindow
-
getStatusBarQF
- Returns:
- Quick Form StatusBar
-
setStatusBarQF
- Parameters:
statusBar
-
-
getCurrQGV
- Returns:
QuickGridView
-
setCurrQGV
- Parameters:
currQGV
-
-
closeQuickFormTab
Close Quick form to remove tabID from the list- Parameters:
AD_Tab_ID
-
-
getOpenQuickFormTabs
Get list of open quick form tabs- Returns:
- list of tabIDs
-
registerQuickFormTab
Register Quick form against tabID- Parameters:
AD_Tab_ID
-- Returns:
- False when already quick form opens for same tab
-
getGridWindow
- Returns:
GridWindow
-
setLastFocusEditor
public void setLastFocusEditor(org.zkoss.zk.ui.Component component) Set component of last focus editor. Use in onClose/Exit to restore focus.- Parameters:
component
-
-