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

    Fields
    Modifier and Type
    Field
    Description
    protected Button
    cancel button to dismiss dialog
    protected Button
    ok button to run process/report
    protected org.zkoss.zk.ui.HtmlBasedComponent
    bottom part of mainParameterLayout
    protected WTableDirEditor
     
    protected Listbox
     
    protected Combobox
    List of name/label for save process parameters
    protected int
     
    protected int
     
    protected org.zkoss.zk.ui.HtmlBasedComponent
    main content layout
    protected org.zkoss.zk.ui.HtmlBasedComponent

    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

    Constructors
    Modifier
    Constructor
    Description
    protected
    default constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    ask(String message, Callback<Boolean> callback)
    Prompt for user input.
    void
    askForInput(String message, Callback<String> callback)
    ask for input from user
    void
    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 of bottomParameterLayout.
    protected void
    buttonLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout)
    Action buttons for dialog
    protected void
    Cancel/dismiss process dialog.
    protected void
    chooseSaveParameter(String saveName, boolean lastRun)
    Load MPInstance by saveName.
    protected void
    Close progressWindow.
    protected BusyDialog
    Create new progressWindow.
    protected void
    Delete saved MPInstance by saveName.
    void
    alias for detach, to ease porting of swing form
    void
    download(File file)
    add to list of file available for download after process end
    void
     
    int
     
    org.zkoss.zul.Comboitem
    Find fSavedName item for value.
     
     
     
    protected MPInstance
     
     
     
     
     
     
    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 dialog
    protected boolean
    init(Properties ctx, int WindowNo, int AD_Process_ID, ProcessInfo pi, boolean autoStart, boolean isDisposeOnComplete)
    layout as below
    protected void
    inputParameterLayout(org.zkoss.zk.ui.HtmlBasedComponent parent)
    Layout parameter part of topParameterLayout.
    boolean
     
    boolean
     
    protected boolean
     
    protected boolean
     
    boolean
    Is the UI locked
    boolean
     
    protected void
    layout dialog
    protected void
    Load parameter values and report options from instance.
    void
    Lock UI by showing of busy dialog (progressWindow).
    void
    onEvent(org.zkoss.zk.ui.event.Event event)
     
    protected void
    protected void
    Load saved process parameters
    protected void
    reportOptionLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout)
    Render report option part of bottomParameterLayout.
    void
    Run process as background job (runBackgroundJob event echo from startProcess0()).
    void
    Run process.
    protected void
    savePrameterLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout)
    Layout UI to load/save process parameters
    protected void
    Update process info (ProcessInfo) with selected report options (freportType, fPrintFormat, fLanguageType and chbIsSummary).
    protected void
    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 of topParameterLayout
    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 #7094
    void
    showReports(List<File> pdfList)
    Merge pdfList and show with SimplePDFViewer.
    protected void
    Run process.
    void
    Provide status feedback to user
    protected void
    topLayout(org.zkoss.zk.ui.HtmlBasedComponent topParameterLayout)
    Layout content of topParameterLayout
    void
    Unlock dialog upon completion of process (or upon submission of job if process is running as background job).
    protected void
    Save process parameters and report options.
    abstract void
    Update UI with the result of process execution.

    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 topParameterLayout
    • bottomParameterLayout

      protected org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout
      bottom part of mainParameterLayout
    • mainParameterLayout

      protected org.zkoss.zk.ui.HtmlBasedComponent mainParameterLayout
      main content layout
    • fPrintFormat

      protected WTableDirEditor fPrintFormat
    • freportType

      protected Listbox freportType
    • bOK

      protected Button bOK
      ok button to run process/report
    • bCancel

      protected Button bCancel
      cancel button to dismiss dialog
    • fSavedName

      protected Combobox 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 of topParameterLayout
      Parameters:
      topParameterLayout -
    • setHeadMessage

      protected org.zkoss.zk.ui.HtmlBasedComponent setHeadMessage(org.zkoss.zk.ui.HtmlBasedComponent parent, String contentMsg)
      Create header message of topParameterLayout
      Parameters:
      parent -
      contentMsg -
      Returns:
      content component for contentMsg
    • inputParameterLayout

      protected void inputParameterLayout(org.zkoss.zk.ui.HtmlBasedComponent parent)
      Layout parameter part of topParameterLayout. parameterPanel, runAsJobField and notificationTypeField.
      Parameters:
      parent -
    • bottomLayout

      protected void bottomLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout)
      Layout content of bottomParameterLayout. Report option, save parameter and action buttons.
      Parameters:
      bottomParameterLayout -
    • reportOptionLayout

      protected void reportOptionLayout(org.zkoss.zk.ui.HtmlBasedComponent bottomParameterLayout)
      Render report option part of bottomParameterLayout.
      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

      protected MPInstance 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 and chbIsSummary).
    • autoStart

      protected void autoStart()
      Auto start process upon instantiation of process dialog. Delegate to startProcess0().
    • onEvent

      public void onEvent(org.zkoss.zk.ui.event.Event event)
      Specified by:
      onEvent in interface org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
    • updateSaveParameter

      protected void updateSaveParameter(String saveName)
      Save process parameters and report options. Set MPInstance.Name = saveName.
      Parameters:
      saveName -
    • saveReportOptionToInstance

      protected void saveReportOptionToInstance(MPInstance instance)
      Save report options (output type, print format, language and IsSummary) to instance.
      Parameters:
      instance - MPInstance
    • getComboItem

      public org.zkoss.zul.Comboitem getComboItem(String value)
      Find fSavedName item for value.
      Parameters:
      value -
      Returns:
      Comboitem found.
    • deleteSaveParameter

      protected void deleteSaveParameter(String saveName)
      Delete saved MPInstance by saveName.
      Parameters:
      saveName -
    • chooseSaveParameter

      protected void chooseSaveParameter(String saveName, boolean lastRun)
      Load MPInstance by saveName.
      Parameters:
      saveName -
      lastRun -
    • loadSavedParams

      protected void loadSavedParams(MPInstance instance)
      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

      protected BusyDialog createBusyDialog()
      Create new progressWindow.
      Returns:
      BusyDialog
    • closeBusyDialog

      protected void closeBusyDialog()
      Close progressWindow.
    • dispose

      public void dispose()
      Description copied from class: Window
      alias for detach, to ease porting of swing form
      Overrides:
      dispose in class Window
    • runProcess

      public void runProcess()
      Run process. Echo event from startProcess0().
    • runBackgroundJob

      public void runBackgroundJob()
      Run process as background job (runBackgroundJob event echo from startProcess0()).
      The different with runProcess() is this method doesn't wait for completion of process.
    • lockUI

      public void lockUI(ProcessInfo pi)
      Lock UI by showing of busy dialog (progressWindow).
      Specified by:
      lockUI in interface IProcessUI
      Parameters:
      pi - process info
    • showBusyDialog

      public abstract void showBusyDialog()
      Show process in progress dialog.
    • unlockUI

      public void unlockUI(ProcessInfo pi)
      Unlock dialog upon completion of process (or upon submission of job if process is running as background job).
      Specified by:
      unlockUI in interface IProcessUI
      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 interface IProcessUI
      Returns:
      true, if UI is locked
    • statusUpdate

      public void statusUpdate(String message)
      Description copied from interface: IProcessUI
      Provide status feedback to user
      Specified by:
      statusUpdate in interface IProcessUI
    • ask

      public void ask(String message, Callback<Boolean> callback)
      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 interface IProcessUI
    • download

      public void download(File file)
      Description copied from interface: IProcessUI
      add to list of file available for download after process end
      Specified by:
      download in interface IProcessUI
    • getProcessInfo

      public ProcessInfo getProcessInfo()
      Returns:
      ProcessInfo
    • setProcessInfo

      public void setProcessInfo(ProcessInfo pi)
      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

      public Properties 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

      public ProcessParameterPanel getParameterPanel()
      Returns:
      ProcessParameterPanel instance
    • getName

      public String getName()
      Returns:
      translated process name
    • getShowHelp

      public String getShowHelp()
      Returns:
      DonTShowHelp, ShowHelp or Silent.
    • getInitialMessage

      public String getInitialMessage()
      Returns:
      initial panel header message
    • isBackgroundJob

      public boolean isBackgroundJob()
      Returns:
      true if run process as background job.
    • getNotificationType

      public String getNotificationType()
      Returns:
      Notification type - None, Email, Notice or Email+Notice.
    • getDownloadFiles

      public List<File> getDownloadFiles()
      Returns:
      list of files for user download
    • askForSecretInput

      public void askForSecretInput(String message, Callback<String> callback)
      Description copied from interface: IProcessUI
      Prompt for secret input (for e.g password) from user.
      Specified by:
      askForSecretInput in interface IProcessUI
    • askForInput

      public void askForInput(String message, Callback<String> callback)
      Description copied from interface: IProcessUI
      ask for input from user
      Specified by:
      askForInput in interface IProcessUI
    • askForInput

      public void askForInput(String message, MLookup lookup, int editorType, Callback<Object> callback)
      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 interface IProcessUI
    • showReports

      public void showReports(List<File> pdfList)
      Merge pdfList and show with SimplePDFViewer.
      Specified by:
      showReports in interface IProcessUI
    • 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 interface IProcessUI
    • focus

      public void focus()
      Overrides:
      focus in class org.zkoss.zk.ui.HtmlBasedComponent