Package org.adempiere.webui.apps
Class AbstractProcessDialog
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Window
org.adempiere.webui.component.Window
org.adempiere.webui.apps.AbstractProcessDialog
- All Implemented Interfaces:
Serializable,Cloneable,IProcessUI,ISupportMask,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.IdSpace,org.zkoss.zk.ui.sys.ComponentCtrl,org.zkoss.zul.ext.Framable
- Direct Known Subclasses:
ProcessDialog,ProcessModalDialog
public abstract class AbstractProcessDialog
extends Window
implements IProcessUI, org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
Abstract dialog base class for execution of process/report.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zul.Window
org.zkoss.zul.Window.ModeNested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrlNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Buttoncancel button to dismiss dialogprotected Buttonok button to run process/reportprotected org.zkoss.zk.ui.HtmlBasedComponentbottom part ofmainParameterLayoutprotected WTableDirEditorprotected Comboboxprotected ComboboxList of name/label for save process parametersprotected intprotected intprotected org.zkoss.zk.ui.HtmlBasedComponentmain content layoutprotected org.zkoss.zk.ui.HtmlBasedComponenttop part ofmainParameterLayoutFields inherited from class org.adempiere.webui.component.Window
DECORATE_INFO, INSERT_END, INSERT_NEXT, INSERT_POSITION_KEY, MODE_EMBEDDED, MODE_HIGHLIGHTED, MODE_KEY, MODE_MODAL, MODE_OVERLAPPED, MODE_POPUP, REPLACE, showMaskWrapperFields inherited from class org.zkoss.zul.Window
EMBEDDED, HIGHLIGHTED, MODAL, OVERLAPPED, POPUPFields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNOREFields inherited from interface org.adempiere.webui.ISupportMask
READY_SHOW_MASK_FLAG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidPrompt for user input.voidaskForInput(String message, Callback<String> callback) ask for input from uservoidaskForInput(String message, MLookup lookup, int editorType, Callback<Object> callback) Prompt user for input with a configurable DisplayType (String, Number, TableDir or Search)voidaskForSecretInput(String message, Callback<String> callback) Prompt for secret input (for e.g password) from user.protected voidAuto start process upon instantiation of process dialog.
Delegate tostartProcess0().protected voidbottomLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Layout content ofbottomParameterLayout.
Report option, save parameter and action buttons.protected voidbuttonLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Action buttons for dialogprotected voidCancel/dismiss process dialog.protected voidchooseSaveParameter(String saveName, boolean lastRun) Load MPInstance by saveName.protected voidCloseprogressWindow.protected BusyDialogCreate newprogressWindow.protected voiddeleteSaveParameter(String saveName) Delete saved MPInstance by saveName.voiddispose()Alias for detach, to ease porting of swing formvoidadd to list of file available for download after process endvoidfocus()intorg.zkoss.zul.ComboitemgetComboItem(String value) FindfSavedNameitem for value.getCtx()protected MPInstancegetName()intabstract voidClose process in progress dialog.protected booleaninit(Properties ctx, int WindowNo, int TabNo, int AD_Process_ID, ProcessInfo pi, boolean autoStart, boolean isDisposeOnComplete) Layout dialogprotected booleaninit(Properties ctx, int WindowNo, int AD_Process_ID, ProcessInfo pi, boolean autoStart, boolean isDisposeOnComplete) layout as belowprotected voidinputParameterLayout(org.zkoss.zk.ui.HtmlBasedComponent parent) Layout parameter part oftopParameterLayout.booleanbooleanisCancel()protected booleanIs current process with IsReport=Y AND JasperReport Is Not NULL.protected booleanisReport()Is current process with IsReport=Y AND JasperReport Is NULL.booleanIs the UI lockedbooleanisValid()protected voidlayout()layout dialogprotected voidloadSavedParams(MPInstance instance) Load parameter values and report options from instance.voidlockUI(ProcessInfo pi) Lock UI by showing of busy dialog (progressWindow).voidonEvent(org.zkoss.zk.ui.event.Event event) protected voidprotected voidLoad saved process parametersprotected voidreportOptionLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Render report option part ofbottomParameterLayout(output type, IsSummary and print format)voidRun process as background job (runBackgroundJob event echo fromstartProcess0()).voidRun process.protected voidsavePrameterLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Layout UI to load/save process parametersprotected voidUpdate process info (ProcessInfo) with selected report options (freportType,fPrintFormat,fLanguageTypeandchbIsSummary).protected voidsaveReportOptionToInstance(MPInstance instance) Save report options (output type, print format, language and IsSummary) to instance.protected org.zkoss.zk.ui.HtmlBasedComponentsetHeadMessage(org.zkoss.zk.ui.HtmlBasedComponent parent, String contentMsg) Create header message oftopParameterLayoutvoidabstract voidShow process in progress dialog.voidshowInfoWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, Integer AD_InfoWindow_ID, boolean lookup) show an info window from inside a process with user defined parameters gustavo.francisco - devCoffee #7094voidshowReports(List<File> pdfList) Merge pdfList and show withSimplePDFViewer.protected voidRun process.Delegate to startProcess0().voidstatusUpdate(String message) Provide status feedback to userprotected voidtopLayout(org.zkoss.zk.ui.HtmlBasedComponent topParameterLayout) Layout content oftopParameterLayout(process message and parameters)voidunlockUI(ProcessInfo pi) Unlock dialog upon completion of process (or upon submission of job if process is running as background job).protected voidupdateSaveParameter(String saveName) Save process parameters and report options.
Set MPInstance.Name = saveName.abstract voidupdateUI()Update UI with the result of process execution.Methods inherited from class org.adempiere.webui.component.Window
getMaskComponent, getMaskObj, getModeAttribute, hideMask, isFireWindowCloseEventOnDetach, onPageDetached, setFireWindowCloseEventOnDetach, showMaskMethods inherited from class org.zkoss.zul.Window
beforeChildAdded, clone, doEmbedded, doHighlighted, doModal, doOverlapped, doPopup, getBorder, getCaption, getContentSclass, getContentStyle, getMinheight, getMinwidth, getMode, getModeType, getPosition, getTitle, getZclass, inEmbedded, inHighlighted, inModal, inOverlapped, inPopup, insertBefore, isClosable, isCollapsible, isMaximizable, isMaximized, isMinimizable, isMinimized, isShadow, isSizable, onChildRemoved, onClose, onModal, renderProperties, service, setBorder, setBorder, setClosable, setContentSclass, setContentStyle, setDraggable, setMaximizable, setMaximized, setMinheight, setMinimizable, setMinimized, setMinwidth, setMode, setMode, setMode, setPosition, setShadow, setSizable, setTitle, setTopmost, setVisibleMethods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onPageAttached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerializeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.zkoss.zk.ui.IdSpace
getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, hasFellow, hasFellowMethods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
-
Field Details
-
m_WindowNo
protected int m_WindowNo -
m_TabNo
protected int m_TabNo -
topParameterLayout
protected org.zkoss.zk.ui.HtmlBasedComponent topParameterLayouttop part ofmainParameterLayout -
bottomParameterLayout
protected org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayoutbottom part ofmainParameterLayout -
mainParameterLayout
protected org.zkoss.zk.ui.HtmlBasedComponent mainParameterLayoutmain content layout -
fPrintFormat
-
freportType
-
bOK
ok button to run process/report -
bCancel
cancel button to dismiss dialog -
fSavedName
List of name/label for save process parameters
-
-
Constructor Details
-
AbstractProcessDialog
protected AbstractProcessDialog()default constructor
-
-
Method Details
-
init
protected boolean init(Properties ctx, int WindowNo, int AD_Process_ID, ProcessInfo pi, boolean autoStart, boolean isDisposeOnComplete) layout as below- Parameters:
ctx-WindowNo-AD_Process_ID-pi-autoStart-isDisposeOnComplete-- Returns:
- true if init is ok.
-
init
protected boolean init(Properties ctx, int WindowNo, int TabNo, int AD_Process_ID, ProcessInfo pi, boolean autoStart, boolean isDisposeOnComplete) Layout dialog- Parameters:
ctx-WindowNo-TabNo-AD_Process_ID-pi-autoStart-isDisposeOnComplete-- Returns:
- true if init is ok.
-
layout
protected void layout()layout dialog -
overalLayout
protected void overalLayout() -
topLayout
protected void topLayout(org.zkoss.zk.ui.HtmlBasedComponent topParameterLayout) Layout content oftopParameterLayout(process message and parameters)- Parameters:
topParameterLayout-
-
setHeadMessage
protected org.zkoss.zk.ui.HtmlBasedComponent setHeadMessage(org.zkoss.zk.ui.HtmlBasedComponent parent, String contentMsg) Create header message oftopParameterLayout- Parameters:
parent-contentMsg-- Returns:
- content component for contentMsg
-
inputParameterLayout
protected void inputParameterLayout(org.zkoss.zk.ui.HtmlBasedComponent parent) Layout parameter part oftopParameterLayout.parameterPanel,runAsJobFieldandnotificationTypeField.- Parameters:
parent-
-
bottomLayout
protected void bottomLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Layout content ofbottomParameterLayout.
Report option, save parameter and action buttons.- Parameters:
bottomParameterLayout-
-
reportOptionLayout
protected void reportOptionLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Render report option part ofbottomParameterLayout(output type, IsSummary and print format)- Parameters:
bottomParameterLayout-
-
isReport
protected boolean isReport()Is current process with IsReport=Y AND JasperReport Is NULL.- Returns:
- true if current process is with IsReport=Y AND JasperReport Is NULL.
-
isJasperReport
protected boolean isJasperReport()Is current process with IsReport=Y AND JasperReport Is Not NULL.- Returns:
- true if current process is with IsReport=Y AND JasperReport Is Not NULL.
-
savePrameterLayout
protected void savePrameterLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Layout UI to load/save process parameters- Parameters:
bottomParameterLayout-
-
querySaved
protected void querySaved()Load saved process parameters -
buttonLayout
protected void buttonLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Action buttons for dialog- Parameters:
bottomParameterLayout-
-
getLastRun
- Returns:
- Last run
MPInstancerecord for current logged in user.
-
saveReportOption
protected void saveReportOption()Update process info (ProcessInfo) with selected report options (freportType,fPrintFormat,fLanguageTypeandchbIsSummary). -
autoStart
protected void autoStart()Auto start process upon instantiation of process dialog.
Delegate tostartProcess0(). -
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>
-
updateSaveParameter
Save process parameters and report options.
Set MPInstance.Name = saveName.- Parameters:
saveName-
-
saveReportOptionToInstance
Save report options (output type, print format, language and IsSummary) to instance.- Parameters:
instance-MPInstance
-
getComboItem
FindfSavedNameitem for value.- Parameters:
value-- Returns:
Comboitemfound.
-
deleteSaveParameter
Delete saved MPInstance by saveName.- Parameters:
saveName-
-
chooseSaveParameter
Load MPInstance by saveName.- Parameters:
saveName-lastRun-
-
loadSavedParams
Load parameter values and report options from instance.- Parameters:
instance-MPInstance
-
startProcess
protected void startProcess()Run process.Delegate to startProcess0(). -
cancelProcess
protected void cancelProcess()Cancel/dismiss process dialog. -
createBusyDialog
Create newprogressWindow.- Returns:
BusyDialog
-
closeBusyDialog
protected void closeBusyDialog()CloseprogressWindow. -
dispose
public void dispose()Description copied from class:WindowAlias for detach, to ease porting of swing form -
runProcess
public void runProcess()Run process. Echo event fromstartProcess0(). -
runBackgroundJob
public void runBackgroundJob()Run process as background job (runBackgroundJob event echo fromstartProcess0()).
The different withrunProcess()is this method doesn't wait for completion of process. -
lockUI
Lock UI by showing of busy dialog (progressWindow).- Specified by:
lockUIin interfaceIProcessUI- Parameters:
pi- process info
-
showBusyDialog
public abstract void showBusyDialog()Show process in progress dialog. -
unlockUI
Unlock dialog upon completion of process (or upon submission of job if process is running as background job).- Specified by:
unlockUIin interfaceIProcessUI- Parameters:
pi- process info
-
hideBusyDialog
public abstract void hideBusyDialog()Close process in progress dialog. -
updateUI
public abstract void updateUI()Update UI with the result of process execution. -
isUILocked
public boolean isUILocked()Description copied from interface:IProcessUIIs the UI locked- Specified by:
isUILockedin interfaceIProcessUI- Returns:
- true, if UI is locked
-
statusUpdate
Description copied from interface:IProcessUIProvide status feedback to user- Specified by:
statusUpdatein interfaceIProcessUI
-
ask
Description copied from interface:IProcessUIPrompt for user input. Example Usage in process:final StringBuffer answer = new StringBuffer(); aProcessMonitor.ask(adMessage, new Callback() { - Specified by:
askin interfaceIProcessUI
-
download
Description copied from interface:IProcessUIadd to list of file available for download after process end- Specified by:
downloadin interfaceIProcessUI
-
getProcessInfo
- Returns:
ProcessInfo
-
setProcessInfo
- Parameters:
pi-
-
isValid
public boolean isValid()- Returns:
- true if dialog is still valid (i.e not completed and not cancel).
-
isCancel
public boolean isCancel()- Returns:
- true if user have press the cancel button to close the dialog
-
getCtx
- Returns:
- cache environment context reference
-
getWindowNo
public int getWindowNo()- Returns:
- register window number.
-
getAD_Process_ID
public int getAD_Process_ID()- Returns:
- AD_Process_ID
-
getParameterPanel
- Returns:
ProcessParameterPanelinstance
-
getName
- Returns:
- translated process name
-
getShowHelp
- Returns:
- DonTShowHelp, ShowHelp or Silent.
-
getInitialMessage
- Returns:
- initial panel header message
-
isBackgroundJob
public boolean isBackgroundJob()- Returns:
- true if run process as background job.
-
getNotificationType
- Returns:
- Notification type - None, Email, Notice or Email+Notice.
-
getDownloadFiles
- Returns:
- list of files for user download
-
askForSecretInput
Description copied from interface:IProcessUIPrompt for secret input (for e.g password) from user.- Specified by:
askForSecretInputin interfaceIProcessUI
-
askForInput
Description copied from interface:IProcessUIask for input from user- Specified by:
askForInputin interfaceIProcessUI
-
askForInput
Description copied from interface:IProcessUIPrompt user for input with a configurable DisplayType (String, Number, TableDir or Search)Usage is the same from ask and askForInput methods with some additional parameters muriloht - devCoffee #3390
- Specified by:
askForInputin interfaceIProcessUI
-
showReports
Merge pdfList and show withSimplePDFViewer.- Specified by:
showReportsin interfaceIProcessUI
-
showInfoWindow
public void showInfoWindow(int WindowNo, String tableName, String keyColumn, String queryValue, boolean multipleSelection, String whereClause, Integer AD_InfoWindow_ID, boolean lookup) Description copied from interface:IProcessUIshow an info window from inside a process with user defined parameters gustavo.francisco - devCoffee #7094- Specified by:
showInfoWindowin interfaceIProcessUI
-
focus
public void focus()- Overrides:
focusin classorg.zkoss.zk.ui.HtmlBasedComponent
-