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.Mode
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrl
Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children
-
Field Summary
Modifier and TypeFieldDescriptionprotected Button
cancel button to dismiss dialogprotected Button
ok button to run process/reportprotected org.zkoss.zk.ui.HtmlBasedComponent
bottom part ofmainParameterLayout
protected WTableDirEditor
protected Listbox
protected Combobox
List of name/label for save process parametersprotected int
protected int
protected org.zkoss.zk.ui.HtmlBasedComponent
main content layoutprotected org.zkoss.zk.ui.HtmlBasedComponent
top part ofmainParameterLayout
Fields inherited from class org.adempiere.webui.component.Window
INSERT_END, INSERT_NEXT, INSERT_POSITION_KEY, MODE_EMBEDDED, MODE_HIGHLIGHTED, MODE_KEY, MODE_MODAL, MODE_OVERLAPPED, MODE_POPUP, REPLACE, showMaskWrapper
Fields inherited from class org.zkoss.zul.Window
EMBEDDED, HIGHLIGHTED, MODAL, OVERLAPPED, POPUP
Fields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclass
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
Fields inherited from interface org.adempiere.webui.ISupportMask
READY_SHOW_MASK_FLAG
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Prompt for user input.void
askForInput
(String message, Callback<String> callback) ask for input from uservoid
askForInput
(String message, MLookup lookup, int editorType, Callback<Object> callback) Prompt user for input with a configurable DisplayType (String, Number, TableDir or Search)void
askForSecretInput
(String message, Callback<String> callback) Prompt for secret input (for e.g password) from user.protected void
Auto start process upon instantiation of process dialog.protected void
bottomLayout
(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Layout content ofbottomParameterLayout
.protected void
buttonLayout
(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Action buttons for dialogprotected void
Cancel/dismiss process dialog.protected void
chooseSaveParameter
(String saveName, boolean lastRun) Load MPInstance by saveName.protected void
CloseprogressWindow
.protected BusyDialog
Create newprogressWindow
.protected void
deleteSaveParameter
(String saveName) Delete saved MPInstance by saveName.void
dispose()
alias for detach, to ease porting of swing formvoid
add to list of file available for download after process endvoid
focus()
int
org.zkoss.zul.Comboitem
getComboItem
(String value) FindfSavedName
item for value.getCtx()
protected MPInstance
getName()
int
abstract void
Close process in progress dialog.protected boolean
init
(Properties ctx, int WindowNo, int TabNo, int AD_Process_ID, ProcessInfo pi, boolean autoStart, boolean isDisposeOnComplete) layout dialogprotected boolean
init
(Properties ctx, int WindowNo, int AD_Process_ID, ProcessInfo pi, boolean autoStart, boolean isDisposeOnComplete) layout as belowprotected void
inputParameterLayout
(org.zkoss.zk.ui.HtmlBasedComponent parent) Layout parameter part oftopParameterLayout
.boolean
boolean
isCancel()
protected boolean
protected boolean
isReport()
boolean
Is the UI lockedboolean
isValid()
protected void
layout()
layout dialogprotected void
loadSavedParams
(MPInstance instance) Load parameter values and report options from instance.void
lockUI
(ProcessInfo pi) Lock UI by showing of busy dialog (progressWindow
).void
onEvent
(org.zkoss.zk.ui.event.Event event) protected void
protected void
Load saved process parametersprotected void
reportOptionLayout
(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Render report option part ofbottomParameterLayout
.void
Run process as background job (runBackgroundJob event echo fromstartProcess0()
).void
Run process.protected void
savePrameterLayout
(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout) Layout UI to load/save process parametersprotected void
Update process info (ProcessInfo
) with selected report options (freportType
,fPrintFormat
,fLanguageType
andchbIsSummary
).protected void
saveReportOptionToInstance
(MPInstance instance) Save report options (output type, print format, language and IsSummary) to instance.protected org.zkoss.zk.ui.HtmlBasedComponent
setHeadMessage
(org.zkoss.zk.ui.HtmlBasedComponent parent, String contentMsg) Create header message oftopParameterLayout
void
abstract void
Show process in progress dialog.void
showInfoWindow
(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 #7094void
showReports
(List<File> pdfList) Merge pdfList and show withSimplePDFViewer
.protected void
Run process.void
statusUpdate
(String message) Provide status feedback to userprotected void
topLayout
(org.zkoss.zk.ui.HtmlBasedComponent topParameterLayout) Layout content oftopParameterLayout
void
unlockUI
(ProcessInfo pi) Unlock dialog upon completion of process (or upon submission of job if process is running as background job).protected void
updateSaveParameter
(String saveName) Save process parameters and report options.abstract void
updateUI()
Update UI with the result of process execution.Methods inherited from class org.adempiere.webui.component.Window
getMaskComponent, getMaskObj, getModeAttribute, hideMask, isFireWindowCloseEventOnDetach, onPageDetached, setFireWindowCloseEventOnDetach, showMask
Methods inherited from class org.zkoss.zul.Window
beforeChildAdded, clone, doEmbedded, doHighlighted, doModal, doOverlapped, doPopup, getBorder, getCaption, getContentSclass, getContentStyle, getDefaultActionOnShow, 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, setDefaultActionOnShow, setDraggable, setMaximizable, setMaximized, setMinheight, setMinimizable, setMinimized, setMinwidth, setMode, setMode, setMode, setPosition, setShadow, setSizable, setTitle, setTopmost, setVisible
Methods inherited from class org.zkoss.zul.impl.XulElement
getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, 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, setZIndexDirectly
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, 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, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, invalidate, invalidatePartial, isChildable, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onPageAttached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, 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, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
invalidatePartial
Methods inherited from interface org.zkoss.zk.ui.IdSpace
getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, hasFellow, hasFellow
Methods 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
- 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
,runAsJobField
andnotificationTypeField
.- 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
.- Parameters:
bottomParameterLayout
-
-
isReport
protected boolean isReport()- Returns:
- true if current process is with IsReport=Y AND JasperReport Is NULL.
-
isJasperReport
protected boolean isJasperReport()- 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
MPInstance
record for current logged in user.
-
saveReportOption
protected void saveReportOption()Update process info (ProcessInfo
) with selected report options (freportType
,fPrintFormat
,fLanguageType
andchbIsSummary
). -
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:
onEvent
in 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
FindfSavedName
item for value.- Parameters:
value
-- Returns:
Comboitem
found.
-
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 tostartProcess0()
. -
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:Window
alias 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:
lockUI
in 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:
unlockUI
in 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:IProcessUI
Is the UI locked- Specified by:
isUILocked
in interfaceIProcessUI
- Returns:
- true, if UI is locked
-
statusUpdate
Description copied from interface:IProcessUI
Provide status feedback to user- Specified by:
statusUpdate
in interfaceIProcessUI
-
ask
Description copied from interface:IProcessUI
Prompt for user input. Example Usage in process:final StringBuffer answer = new StringBuffer(); aProcessMonitor.ask(adMessage, new Callback
() { - Specified by:
ask
in interfaceIProcessUI
-
download
Description copied from interface:IProcessUI
add to list of file available for download after process end- Specified by:
download
in 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:
ProcessParameterPanel
instance
-
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:IProcessUI
Prompt for secret input (for e.g password) from user.- Specified by:
askForSecretInput
in interfaceIProcessUI
-
askForInput
Description copied from interface:IProcessUI
ask for input from user- Specified by:
askForInput
in interfaceIProcessUI
-
askForInput
Description copied from interface:IProcessUI
Prompt 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:
askForInput
in interfaceIProcessUI
-
showReports
Merge pdfList and show withSimplePDFViewer
.- Specified by:
showReports
in 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:IProcessUI
show an info window from inside a process with user defined parameters gustavo.francisco - devCoffee #7094- Specified by:
showInfoWindow
in interfaceIProcessUI
-
focus
public void focus()- Overrides:
focus
in classorg.zkoss.zk.ui.HtmlBasedComponent
-