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 Details

      • statusBar

        protected StatusBar statusBar
        status bar for message and record info
      • adTabbox

        protected IADTabbox adTabbox
        UI part for AD_Tabs
      • toolbar

        protected ADWindowToolbar toolbar
      • title

        protected String title
        window title
      • statusBarQF

        protected StatusBar statusBarQF
        Quick Form Status bar
      • quickFormOpenTabs

        protected ArrayList<Integer> quickFormOpenTabs
        Maintain no of quick form tabs open
      • lastFocusEditor

        protected org.zkoss.zk.ui.Component lastFocusEditor
        track last focus field editor component
      • adwindow

        protected ADWindow adwindow
      • showingOnExitDialog

        protected boolean showingOnExitDialog
        true if confirmation for exit dialog is visible
      • currQGV

        protected QuickGridView currQGV
        Implementation to work key listener for the current open Quick Form.
    • Constructor Details

      • AbstractADWindowContent

        public AbstractADWindowContent(Properties ctx, int windowNo, int adWindowId)
        Constructor
        Parameters:
        ctx -
        windowNo -
        adWindowId -
    • Method Details

      • createPart

        public org.zkoss.zk.ui.Component createPart(Object parent)
        Create IADTabbox and setup listeners.
        Call from ADWindow, don't call this directly.
        Specified by:
        createPart in interface UIPart
        Overrides:
        createPart in class AbstractUIPart
        Parameters:
        parent -
        Returns:
        Component
      • getBreadCrumb

        public BreadCrumb getBreadCrumb()
        Get bread crumb component
        Returns:
        BreadCrumb
      • getStatusBar

        public StatusBar getStatusBar()
        Get status bar component
        Returns:
        StatusBar
      • createADTab

        protected abstract IADTabbox createADTab()
        Override to create IADTabbox 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 selected tab panel
      • initPanel

        public boolean initPanel(MQuery query)
        Init all tab panels.
        Delegate the init of each individual tab panel to initTab(MQuery, int).
        Parameters:
        query -
        Returns:
        boolean
      • initTab

        protected GridTab initTab(MQuery query, int tabIndex)
        Init tab at tabIndex.
        Further delegate to initTabPanel(MQuery, int, GridTab, IADTabpanel).
        Parameters:
        query -
        tabIndex -
        Returns:
        GridTab
      • getTitle

        public String getTitle()
        Get title of window
        Returns:
        title of window
      • getImage

        public MImage getImage()
        Get image of window title
        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 interface ToolbarListener
        See Also:
      • onParentRecord

        public void onParentRecord()
        Navigate to parent record.
        Delegate to BreadCrumbLink ON_Click event.
        Specified by:
        onParentRecord in interface ToolbarListener
        See Also:
      • onFirst

        public void onFirst()
        Description copied from interface: ToolbarListener
        Navigate to first record
        Specified by:
        onFirst in interface ToolbarListener
        See Also:
      • onLast

        public void onLast()
        Description copied from interface: ToolbarListener
        Navigate to last record
        Specified by:
        onLast in interface ToolbarListener
        See Also:
      • onNext

        public void onNext()
        Description copied from interface: ToolbarListener
        Navigate to next record
        Specified by:
        onNext in interface ToolbarListener
        See Also:
      • onPrevious

        public void onPrevious()
        Description copied from interface: ToolbarListener
        Navigate to previous record
        Specified by:
        onPrevious in interface ToolbarListener
        See Also:
      • onTreeNavigate

        public void onTreeNavigate(GridTab gt, int rowIndex)
        Handle tree navigation
        Parameters:
        gt -
        rowIndex -
      • onLock

        public void onLock()
        Description copied from interface: ToolbarListener
        Personal lock
        Specified by:
        onLock in interface ToolbarListener
        See Also:
      • onAttachment

        public void onAttachment()
        Description copied from interface: ToolbarListener
        Open the attachment dialog
        Specified by:
        onAttachment in interface ToolbarListener
        See Also:
      • onChat

        public void onChat()
        Description copied from interface: ToolbarListener
        open chat window
        Specified by:
        onChat in interface ToolbarListener
      • onPostIt

        public void onPostIt()
        Open Post It note dialog.
      • onLabel

        public void onLabel()
        Open Label panel. Delegate to LabelAction
      • onToggle

        public void onToggle()
        Description copied from interface: ToolbarListener
        Toggle record presentation between free form and tabular
        Specified by:
        onToggle in interface ToolbarListener
        See Also:
      • onExit

        public void onExit(Callback<Boolean> callback)
        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 interface org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
        Parameters:
        event -
        See Also:
        • EventListener.onEvent(Event)
      • saveAndNavigate

        public void saveAndNavigate(Callback<Boolean> callback)
        Save (if needed) and execute callback
        Parameters:
        callback - callback for result of execution, must not be null
      • dataStatusChanged

        public void dataStatusChanged(DataStatusEvent e)
        Description copied from interface: DataStatusListener
        Data Changed
        Specified by:
        dataStatusChanged in interface DataStatusListener
        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 to onRefresh(boolean, boolean)
        Parameters:
        fireEvent -
      • onRefresh

        public void onRefresh(boolean fireEvent, boolean saveCurrentRow)
        Refresh all row.
        Delegate to doOnRefresh(boolean)
        Parameters:
        fireEvent -
        saveCurrentRow - if true, save before refresh
      • doOnRefresh

        protected void doOnRefresh(boolean fireEvent)
        Refresh all rows
        Parameters:
        fireEvent - true to fire StateChangeEvent
      • onRefresh

        public void onRefresh()
        Description copied from interface: ToolbarListener
        Refresh current record
        Specified by:
        onRefresh in interface ToolbarListener
        See Also:
      • onHelp

        public void onHelp()
        Description copied from interface: ToolbarListener
        Open the help window
        Specified by:
        onHelp in interface ToolbarListener
        See Also:
      • onNew

        public void onNew()
        Description copied from interface: ToolbarListener
        Create new record
        Specified by:
        onNew in interface ToolbarListener
      • onCopy

        public void onCopy()
        Description copied from interface: ToolbarListener
        Copy current record as a new record
        Specified by:
        onCopy in interface ToolbarListener
      • onFind

        public void onFind()
        Delegate to doOnFind()
        Specified by:
        onFind in interface ToolbarListener
        See Also:
      • onIgnore

        public void onIgnore()
        Description copied from interface: ToolbarListener
        Ignore user changes
        Specified by:
        onIgnore in interface ToolbarListener
      • onSave

        public void onSave()
        Specified by:
        onSave in interface ToolbarListener
        See Also:
      • onSave

        public void onSave(boolean onSaveEvent, boolean onNavigationEvent, Callback<Boolean> callback)
        Fire WindowValidatorEvent and delegate actual save to onSaveCallback(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 to onSave(boolean, boolean, Callback).
        Specified by:
        onSaveCreate in interface ToolbarListener
        See Also:
      • onDelete

        public void onDelete()
        Description copied from interface: ToolbarListener
        Delete current record
        Specified by:
        onDelete in interface ToolbarListener
      • onPrint

        public void onPrint()
        Delegate to onPrintCallback(Callback)
        Specified by:
        onPrint in interface ToolbarListener
      • onReport

        public void onReport()
        Delegate to onReport0()
        Specified by:
        onReport in interface ToolbarListener
        See Also:
      • onZoomAcross

        public void onZoomAcross()
        Delegate to WZoomAcross.
        Specified by:
        onZoomAcross in interface ToolbarListener
        See Also:
      • onActiveWorkflows

        public void onActiveWorkflows()
        Description copied from interface: ToolbarListener
        Show active workflow for current record
        Specified by:
        onActiveWorkflows in interface ToolbarListener
        See Also:
      • onRequests

        public void onRequests()
        Delegate to WRequest
        Specified by:
        onRequests in interface ToolbarListener
        See Also:
      • onProductInfo

        public void onProductInfo()
        Description copied from interface: ToolbarListener
        View product info
        Specified by:
        onProductInfo in interface ToolbarListener
        See Also:
      • onArchive

        public void onArchive()
        Delegate to WArchive
        Specified by:
        onArchive in interface ToolbarListener
        See Also:
      • onExport

        public void onExport()
        Delegate to ExportAction
        Specified by:
        onExport in interface ToolbarListener
      • onFileImport

        public void onFileImport()
        Delegate to FileImportAction
        Specified by:
        onFileImport in interface ToolbarListener
      • onCSVImport

        public void onCSVImport()
        Delegate to CSVImportAction
        Specified by:
        onCSVImport in interface ToolbarListener
      • onSearchQuery

        public void onSearchQuery()
        Delegate to doOnQueryChange()
        Specified by:
        onSearchQuery in interface ToolbarListener
      • doOnQueryChange

        public void doOnQueryChange()
        Simulate opening the Find Window, selecting a user query and click ok
      • hideBusyMask

        public void hideBusyMask()
        Hide busy mask
      • showBusyMask

        public void showBusyMask(Window window)
        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 to executeButtonProcess0(IProcessButton, boolean, int, int, String, Callback) or executionButtonInfoWindow0(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 to executeButtonProcess0(IProcessButton, boolean, int, int, String, Callback) or executionButtonInfoWindow0(IProcessButton).
        Parameters:
        wButton -
        startWOasking -
        table_ID -
        record_ID -
        record_UU -
        isProcessMandatory -
        callback -
      • actionPerformed

        public void actionPerformed(ActionEvent event)
        Delegate to actionButton(IProcessButton)
        Specified by:
        actionPerformed in interface ActionListener
        Parameters:
        event -
        See Also:
      • findADTabpanel

        public IADTabpanel findADTabpanel(IProcessButton button)
        Find parent IADTabpanel for button
        Parameters:
        button -
        Returns:
        IADTabpanel
      • getADTab

        public IADTabbox getADTab()
        Get IADTabbox instance
        Returns:
        IADTabbox
      • executeASync

        @Deprecated(forRemoval=true, since="11") public void executeASync(ProcessInfo pi)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Parameters:
        pi -
      • getToolbar

        public ADWindowToolbar getToolbar()
        Get toolbar component
        Returns:
        toolbar instance
      • getActiveGridTab

        public GridTab getActiveGridTab()
        Get grid tab of selected tab
        Returns:
        GridTab of 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:
        onCustomize in interface ToolbarListener
        See Also:
      • onProcess

        public void onProcess()
        Show popup menu for process toolbar button (the gear button)
        Specified by:
        onProcess in interface ToolbarListener
        See Also:
      • onSelect

        public void onSelect()
        Description copied from interface: ITabOnSelectHandler
        Handle tab on_select event
        Specified by:
        onSelect in interface ITabOnSelectHandler
      • isPendingChanges

        public boolean isPendingChanges()
        Is selected tab has pending changes
        Returns:
        true if dirty
      • setADWindow

        public void setADWindow(ADWindow adwindow)
        Set parent AD window
        Parameters:
        adwindow -
      • getADWindow

        public ADWindow getADWindow()
        Get parent AD window instance
        Returns:
        ADWindow
      • getFindWindow

        public boolean getFindWindow(GridField[] findFields)
        Get find window
        Parameters:
        findFields -
        Returns:
        true if find window found and init ok
      • getCurrentFindWindow

        public FindWindow getCurrentFindWindow()
        Get cache find window for current selected tab
        Returns:
        FindWindow
      • getStatusBarQF

        public StatusBar getStatusBarQF()
        Get status bar for quick form
        Returns:
        Quick Form StatusBar
      • setStatusBarQF

        public void setStatusBarQF(StatusBar statusBar)
        Set status bar for quick form
        Parameters:
        statusBar -
      • getCurrQGV

        public QuickGridView getCurrQGV()
        Get grid view for quick form
        Returns:
        QuickGridView
      • setCurrQGV

        public void setCurrQGV(QuickGridView currQGV)
        Set grid view for quick form
        Parameters:
        currQGV -
      • closeQuickFormTab

        public void closeQuickFormTab(Integer AD_Tab_ID)
        Close Quick form to remove tabID from the list
        Parameters:
        AD_Tab_ID -
      • getOpenQuickFormTabs

        public ArrayList<Integer> getOpenQuickFormTabs()
        Get list of open quick form tabs
        Returns:
        list of tabIDs
      • registerQuickFormTab

        public boolean registerQuickFormTab(Integer AD_Tab_ID)
        Register Quick form against tabID
        Parameters:
        AD_Tab_ID -
        Returns:
        False when already quick form opens for same tab
      • getGridWindow

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