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 controller class for the content of AD Window (toolbar+breadcrumb+tabs+statusbar).
- 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
FieldsModifier and TypeFieldDescriptionprotected IADTabboxUI part for AD_Tabsprotected ADWindowprotected BreadCrumbpath to selected tabprotected QuickGridViewImplementation to work key listener for the current open Quick Form.protected org.zkoss.zk.ui.Componenttrack last focus field editor componentMaintain no of quick form tabs openprotected booleantrue if confirmation for exit dialog is visibleprotected StatusBarstatus bar for message and record infoprotected StatusBarQuick Form Status barprotected Stringwindow titleprotected ADWindowToolbarFields inherited from class org.adempiere.webui.part.AbstractUIPart
page, showMaskWrapperFields inherited from interface org.adempiere.webui.ISupportMask
READY_SHOW_MASK_FLAGFields inherited from interface org.adempiere.webui.part.ITabOnSelectHandler
ATTRIBUTE_KEY -
Constructor Summary
ConstructorsConstructorDescriptionAbstractADWindowContent(Properties ctx, int windowNo, int adWindowId) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Delegate toactionButton(IProcessButton)voidcloseQuickFormTab(Integer AD_Tab_ID) Close Quick form to remove tabID from the listprotected abstract IADTabboxOverride to createIADTabboxinstance.org.zkoss.zk.ui.ComponentcreatePart(Object parent) voidData ChangedvoidSimulate opening the Find Window, selecting a user query and click okprotected voiddoOnRefresh(boolean fireEvent) Refresh all rowsvoidDeprecated, for removal: This API element is subject to removal in a future version.voidexecuteButtonProcess(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).voidexecuteButtonProcess(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).findADTabpanel(IProcessButton button) Find parent IADTabpanel for buttonvoidSet focus to selected tab panelbooleanrestore focus to last known focus editor (if any)booleanfocusToLastFocusEditor(boolean defer) restore focus to last known focus editor (if any)Get grid tab of selected tabgetADTab()Get IADTabbox instanceGet parent AD window instanceGet bread crumb componentGet cache find window for current selected tabGet grid view for quick formbooleangetFindWindow(GridField[] findFields) Get find windowGet grid window modelgetImage()Get image of window titleGet list of open quick form tabsGet status bar componentGet status bar for quick formgetTitle()Get title of windowGet toolbar componentintGet window numbervoidHide busy maskbooleanInit all tab panels.
Delegate the init of each individual tab panel toinitTab(MQuery, int).protected GridTabInit tab at tabIndex.
Further delegate toinitTabPanel(MQuery, int, GridTab, IADTabpanel).booleanisBlock()Is this window block by mask or highlighted windowbooleanIs first tab selectedbooleanIs selected tab has pending changesvoidShow active workflow for current recordvoidDelegate toWArchivevoidOpen the attachment dialogvoidOpen Table Attribute WindowvoidonChat()open chat windowvoidonCopy()Copy current record as a new recordvoidDelegate toCSVImportActionvoidShow dialog to customize fields (hidden, display, order of field) in grid modevoidonDelete()Delete current recordvoidNavigate to detail record, i.e next tabvoidonEvent(org.zkoss.zk.ui.event.Event event) voidhandle on exit/close of windowvoidonExport()Delegate toExportActionvoidDelegate toFileImportActionvoidonFind()Delegate todoOnFind()voidonFirst()Navigate to first recordvoidonHelp()Open the help windowvoidonIgnore()Ignore user changesvoidonLabel()Open Label panel.voidonLast()Navigate to last recordvoidonLock()Personal lockvoidonNew()Create new recordvoidonNext()Navigate to next recordvoidNavigate to parent record.
Delegate toBreadCrumbLinkON_Click event.voidonPostIt()Open Post It note dialog.voidNavigate to previous recordvoidonPrint()Delegate toonPrintCallback(Callback)voidShow popup menu for process toolbar button (the gear button)voidView product infovoidOpen quick formvoidonQuickForm(boolean stayInParent) Open quick formvoidRefresh current recordvoidonRefresh(boolean fireEvent) Refresh all row.
Delegate toonRefresh(boolean, boolean)voidonRefresh(boolean fireEvent, boolean saveCurrentRow) Refresh all row.
Delegate todoOnRefresh(boolean)voidonReport()Delegate toonReport0()voidDelegate toWRequestvoidonSave()Delegate toonSave(boolean, boolean, Callback)voidFireWindowValidatorEventand delegate actual save toonSaveCallback(boolean, boolean, Callback)voidSave and create new record.voidHandle WPaymentEditor.ON_SAVE_PAYMENT event.voidDelegate todoOnQueryChange()voidonSelect()Handle tab on_select eventvoidonToggle()Toggle record presentation between free form and tabularvoidonTreeNavigate(GridTab gt, int rowIndex) Handle tree navigationvoidDelegate toWZoomAcross.booleanregisterQuickFormTab(Integer AD_Tab_ID) Register Quick form against tabIDvoidsaveAndNavigate(Callback<Boolean> callback) Save (if needed) and execute callbackvoidsetADWindow(ADWindow adwindow) Set parent AD windowvoidsetCurrQGV(QuickGridView currQGV) Set grid view for quick formvoidsetLastFocusEditor(org.zkoss.zk.ui.Component component) Set component of last focus editor.
Use in onClose/Exit to restore focus.voidsetStatusBarQF(StatusBar statusBar) Set status bar for quick formvoidshowBusyMask(Window window) Show busy mask over windowprotected abstract voidswitchEditStatus(boolean editStatus) Handle switching of editing status.
Override to set isEditting to true/false at widget side.Methods inherited from class org.adempiere.webui.part.AbstractUIPart
doCreatePart, getMaskComponent, getMaskObj, hideMask, showMaskMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
createPartin interfaceUIPart- Overrides:
createPartin classAbstractUIPart- Parameters:
parent-- Returns:
- Component
-
getBreadCrumb
Get bread crumb component- Returns:
BreadCrumb
-
getStatusBar
Get status bar component- Returns:
StatusBar
-
createADTab
Override to createIADTabboxinstance.- 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 selected 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
Get title of window- Returns:
- title of window
-
getImage
Get image of window title- Returns:
MImageof window title
-
onDetailRecord
public void onDetailRecord()Description copied from interface:ToolbarListenerNavigate to detail record, i.e next tab- Specified by:
onDetailRecordin interfaceToolbarListener- See Also:
-
onParentRecord
public void onParentRecord()Navigate to parent record.
Delegate toBreadCrumbLinkON_Click event.- Specified by:
onParentRecordin interfaceToolbarListener- See Also:
-
onFirst
public void onFirst()Description copied from interface:ToolbarListenerNavigate to first record- Specified by:
onFirstin interfaceToolbarListener- See Also:
-
onLast
public void onLast()Description copied from interface:ToolbarListenerNavigate to last record- Specified by:
onLastin interfaceToolbarListener- See Also:
-
onNext
public void onNext()Description copied from interface:ToolbarListenerNavigate to next record- Specified by:
onNextin interfaceToolbarListener- See Also:
-
onPrevious
public void onPrevious()Description copied from interface:ToolbarListenerNavigate to previous record- Specified by:
onPreviousin interfaceToolbarListener- See Also:
-
onLock
public void onLock()Description copied from interface:ToolbarListenerPersonal lock- Specified by:
onLockin interfaceToolbarListener- See Also:
-
onAttachment
public void onAttachment()Description copied from interface:ToolbarListenerOpen the attachment dialog- Specified by:
onAttachmentin interfaceToolbarListener- See Also:
-
onChat
public void onChat()Description copied from interface:ToolbarListeneropen chat window- Specified by:
onChatin 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:ToolbarListenerToggle record presentation between free form and tabular- Specified by:
onTogglein 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
-
onAttributeForm
public void onAttributeForm()Open Table Attribute Window -
onEvent
public void onEvent(org.zkoss.zk.ui.event.Event event) - Specified by:
onEventin interfaceorg.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>- Parameters:
event-- See Also:
-
EventListener.onEvent(Event)
-
dataStatusChanged
Description copied from interface:DataStatusListenerData Changed- Specified by:
dataStatusChangedin interfaceDataStatusListener- Parameters:
e-- See Also:
-
isFirstTab
public boolean isFirstTab()Is first tab selected- 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:ToolbarListenerRefresh current record- Specified by:
onRefreshin interfaceToolbarListener- See Also:
-
onHelp
public void onHelp()Description copied from interface:ToolbarListenerOpen the help window- Specified by:
onHelpin interfaceToolbarListener- See Also:
-
onNew
public void onNew()Description copied from interface:ToolbarListenerCreate new record- Specified by:
onNewin interfaceToolbarListener
-
onCopy
public void onCopy()Description copied from interface:ToolbarListenerCopy current record as a new record- Specified by:
onCopyin interfaceToolbarListener
-
onFind
public void onFind()Delegate todoOnFind()- Specified by:
onFindin interfaceToolbarListener- See Also:
-
onIgnore
public void onIgnore()Description copied from interface:ToolbarListenerIgnore user changes- Specified by:
onIgnorein interfaceToolbarListener
-
onSave
public void onSave()Delegate toonSave(boolean, boolean, Callback)- Specified by:
onSavein interfaceToolbarListener- See Also:
-
onSave
FireWindowValidatorEventand 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:
onSaveCreatein interfaceToolbarListener- See Also:
-
onDelete
public void onDelete()Description copied from interface:ToolbarListenerDelete current record- Specified by:
onDeletein interfaceToolbarListener
-
onPrint
public void onPrint()Delegate toonPrintCallback(Callback)- Specified by:
onPrintin interfaceToolbarListener
-
onReport
public void onReport()Delegate toonReport0()- Specified by:
onReportin interfaceToolbarListener- See Also:
-
onZoomAcross
public void onZoomAcross()Delegate toWZoomAcross.- Specified by:
onZoomAcrossin interfaceToolbarListener- See Also:
-
onActiveWorkflows
public void onActiveWorkflows()Description copied from interface:ToolbarListenerShow active workflow for current record- Specified by:
onActiveWorkflowsin interfaceToolbarListener- See Also:
-
onRequests
public void onRequests()Delegate toWRequest- Specified by:
onRequestsin interfaceToolbarListener- See Also:
-
onProductInfo
public void onProductInfo()Description copied from interface:ToolbarListenerView product info- Specified by:
onProductInfoin interfaceToolbarListener- See Also:
-
onArchive
public void onArchive()Delegate toWArchive- Specified by:
onArchivein interfaceToolbarListener- See Also:
-
onExport
public void onExport()Delegate toExportAction- Specified by:
onExportin interfaceToolbarListener
-
onFileImport
public void onFileImport()Delegate toFileImportAction- Specified by:
onFileImportin interfaceToolbarListener
-
onCSVImport
public void onCSVImport()Delegate toCSVImportAction- Specified by:
onCSVImportin interfaceToolbarListener
-
onSearchQuery
public void onSearchQuery()Delegate todoOnQueryChange()- Specified by:
onSearchQueryin 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()Is this window block by mask or highlighted window- 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:
actionPerformedin interfaceActionListener- Parameters:
event-- See Also:
-
findADTabpanel
Find parent IADTabpanel for button- Parameters:
button-- Returns:
IADTabpanel
-
getADTab
Get IADTabbox instance- Returns:
IADTabbox
-
executeASync
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
pi-
-
getToolbar
Get toolbar component- Returns:
- toolbar instance
-
getActiveGridTab
Get grid tab of selected tab- Returns:
GridTabof selected tab
-
getWindowNo
public int getWindowNo()Get window number- Returns:
- windowNo
-
onCustomize
public void onCustomize()Show dialog to customize fields (hidden, display, order of field) in grid mode- Specified by:
onCustomizein interfaceToolbarListener- See Also:
-
onProcess
public void onProcess()Show popup menu for process toolbar button (the gear button)- Specified by:
onProcessin interfaceToolbarListener- See Also:
-
onSelect
public void onSelect()Description copied from interface:ITabOnSelectHandlerHandle tab on_select event- Specified by:
onSelectin interfaceITabOnSelectHandler
-
isPendingChanges
public boolean isPendingChanges()Is selected tab has pending changes- Returns:
- true if dirty
-
setADWindow
Set parent AD window- Parameters:
adwindow-
-
getADWindow
Get parent AD window instance- Returns:
ADWindow
-
getFindWindow
Get find window- Parameters:
findFields-- Returns:
- true if find window found and init ok
-
getCurrentFindWindow
Get cache find window for current selected tab- Returns:
FindWindow
-
getStatusBarQF
Get status bar for quick form- Returns:
- Quick Form StatusBar
-
setStatusBarQF
Set status bar for quick form- Parameters:
statusBar-
-
getCurrQGV
Get grid view for quick form- Returns:
QuickGridView
-
setCurrQGV
Set grid view for quick form- 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
Get grid window model- 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-
-