Class ADWindowToolbar

java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Toolbar
org.adempiere.webui.component.ToolBar
org.adempiere.webui.adwindow.ADWindowToolbar
All Implemented Interfaces:
Serializable, Cloneable, 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.sys.ComponentCtrl

public class ADWindowToolbar extends ToolBar implements org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>
Toolbar of AD_Window
Author:
Ashley G Ramdass, Cristina Ghita, www.arhipac.ro
  • FR [ 2076330 ] Add new methods in CWindowToolbar class
  • See Also:
    • Nested Class Summary

      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, org.zkoss.zk.ui.AbstractComponent.ForwardInfo, org.zkoss.zk.ui.AbstractComponent.TargetInfo
    • Field Summary

      Fields
      Modifier and Type
      Field
      Description
      static final String
      Prefix for Button Name
      boolean
      Show Personal Lock
      static final String
      Deprecated, for removal: This API element is subject to removal in a future version.
      static final int
      VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A)
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       
      static final int
       

      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, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
    • Constructor Summary

      Constructors
      Constructor
      Description
      default constructor
      ADWindowToolbar(AbstractADWindowContent windowContent, int windowNo)
       
    • Method Summary

      Modifier and Type
      Method
      Description
      void
      addListener(ToolbarListener toolbarListener)
      Add ToolbarListener
      protected void
      Add separator/spacer between button
      void
      Dynamic update of each toolbar button state (Check restrictions).
      For custom button, call ToolbarCustomButton.dynamicDisplay(), process pressedLogic and readOnlyLogic.
      void
      enableActiveWorkflows(boolean enabled)
      Enable/disable Active Workflows button
      void
      enableArchive(boolean enabled)
      Enable/disable Archive button
      void
      enableAttachment(boolean enabled)
      Enable/disable Attachment button
      void
      enableChat(boolean enabled)
      Enable/disable Chat button
      void
      enableCopy(boolean enabled)
      Enable/disable Copy/Duplicate button
      void
      enableCSVImport(boolean b)
      Enable/disable CSV Import button
      void
      enableCustomize(boolean enabled)
      Enable/disable Customize Grid button
      void
      enableDelete(boolean enabled)
      Enable/disable Delete button
      void
      enableExport(boolean b)
      Enable/disable Export button
      void
      enableFileImport(boolean b)
      Enable/disable File Import button
      void
      enableFind(boolean enabled)
      Enable/disable Find/Query button
      void
      enableGridToggle(boolean enabled)
      Enable/disable Toggle button
      void
      enableIgnore(boolean enabled)
      Enable/disable Ignore/Undo button
      void
      enableLabel(boolean enabled)
      Enable/disable Label record button
      void
      enableNew(boolean enabled)
      Enable/disable New button
      void
      enablePostIt(boolean enabled)
      Enable/disable Post It Note button
      void
      enablePrint(boolean enabled)
      Enable/disable Print button
      void
      Enable/disable Process button
      void
      enableQuickForm(boolean enabled)
      Enable/disable Quick Form button
      void
      enableRefresh(boolean enabled)
      Enable/disable Refresh button
      void
      enableReport(boolean enabled)
      Enable/disable Report button
      void
      enableRequests(boolean enabled)
      Enable/disable Requests button
      void
      enableSave(boolean enabled)
      Enable/disable Save button
      void
      enableTabNavigation(boolean enabled)
      Enable/disable buttons for navigation between parent and detail tab
      void
      enableTabNavigation(boolean enableParent, boolean enableDetail)
      Enable/disable buttons for navigation between parent and detail tab
      void
      enableZoomAcross(boolean enabled)
      Enable/disable Zoom Across button
      int
       
      Get ToolBarButton by name
      org.zkoss.zk.ui.event.Event
      Get source event
      int
      Get parent tab level for quick form
      org.zkoss.zul.impl.LabelImageElement
      Get ToolBarButton by name
      protected boolean
      btnActiveWorkflow should be disabled when table has no workflow defined
      boolean
      Set selected user query to first default user query (if any)
      boolean
      Is delete button enable
      boolean
      Is create new record button enable
      boolean
      Is save button enable
      void
      lock(boolean locked)
      Turn on/off Lock button (Pressed=On, Not Pressed=Off)
      void
      onEvent(org.zkoss.zk.ui.event.Event event)
       
      void
      onPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)
       
      void
      onPageDetached(org.zkoss.zk.ui.Page page)
       
      void
      Post after size event handler for mobile client.
      Calculate which toolbar buttons should overflow to show more popup.
      void
      refreshUserQuery(int AD_Tab_ID, int AD_UserQuery_ID)
      Reload user queries and set selected item to AD_UserQuery_ID
      void
      Remove ToolbarListener
      void
      setPressed(String buttonName, boolean pressed)
      Set button to pressed/not pressed state
      void
      setQuickFormTabHrchyLevel(int quickFormHrchyTabLevel)
      Set parent tab level for quick form
      void
      setSelectedUserQuery(int AD_UserQuery_ID)
      Set selected user query
      void
      setSelectedUserQuery(MUserQuery selectedUserQuery)
      Set selected user query
      void
      setVisible(String buttonName, boolean visible)
       
      void
      setVisibleAll(boolean visible)
      Make all toolbar buttons visible
      void
      setWindowNo(int windowNo)
       
      void
      Initialise the accessibility state of toolbar buttons

      Methods inherited from class org.zkoss.zul.Toolbar

      getAlign, getOrient, getOverflowPopupIconSclass, getZclass, isOverflowPopup, renderProperties, setAlign, setOrient, setOverflowPopup, setOverflowPopupIconSclass

      Methods inherited from class org.zkoss.zul.impl.XulElement

      clone, 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, focus, getAction, getClientAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setClientAction, setDraggable, 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, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, 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, insertBefore, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, 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, setVisible, setVisibleDirectly, 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
    • Field Details

    • Constructor Details

      • ADWindowToolbar

        public ADWindowToolbar()
        default constructor
      • ADWindowToolbar

        public ADWindowToolbar(AbstractADWindowContent windowContent, int windowNo)
        Parameters:
        windowContent -
        windowNo -
    • Method Details

      • getButton

        public ToolBarButton getButton(String name)
        Get ToolBarButton by name
        Parameters:
        name -
        Returns:
        ToolBarButton or null
      • getToolbarItem

        public org.zkoss.zul.impl.LabelImageElement getToolbarItem(String name)
        Get ToolBarButton by name
        Parameters:
        name -
        Returns:
        LabelImageElement or null
      • addSeparator

        protected void addSeparator()
        Add separator/spacer between button
      • addListener

        public void addListener(ToolbarListener toolbarListener)
        Add ToolbarListener
        Parameters:
        toolbarListener -
      • removeListener

        public void removeListener(ToolbarListener toolbarListener)
        Remove ToolbarListener
        Parameters:
        toolbarListener -
      • 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>
      • enableTabNavigation

        public void enableTabNavigation(boolean enabled)
        Enable/disable buttons for navigation between parent and detail tab
        Parameters:
        enabled -
      • enableTabNavigation

        public void enableTabNavigation(boolean enableParent, boolean enableDetail)
        Enable/disable buttons for navigation between parent and detail tab
        Parameters:
        enableParent -
        enableDetail -
      • enableRefresh

        public void enableRefresh(boolean enabled)
        Enable/disable Refresh button
        Parameters:
        enabled -
      • enableSave

        public void enableSave(boolean enabled)
        Enable/disable Save button
        Parameters:
        enabled -
      • isSaveEnable

        public boolean isSaveEnable()
        Is save button enable
        Returns:
        true if Save button is enable
      • enableDelete

        public void enableDelete(boolean enabled)
        Enable/disable Delete button
        Parameters:
        enabled -
      • isDeleteEnable

        public boolean isDeleteEnable()
        Is delete button enable
        Returns:
        true if Delete button is enable
      • isNewEnabled

        public boolean isNewEnabled()
        Is create new record button enable
        Returns:
        true if New button is enable
      • enableIgnore

        public void enableIgnore(boolean enabled)
        Enable/disable Ignore/Undo button
        Parameters:
        enabled -
      • enableNew

        public void enableNew(boolean enabled)
        Enable/disable New button
        Parameters:
        enabled -
      • enableCopy

        public void enableCopy(boolean enabled)
        Enable/disable Copy/Duplicate button
        Parameters:
        enabled -
      • enableAttachment

        public void enableAttachment(boolean enabled)
        Enable/disable Attachment button
        Parameters:
        enabled -
      • enableChat

        public void enableChat(boolean enabled)
        Enable/disable Chat button
        Parameters:
        enabled -
      • enablePrint

        public void enablePrint(boolean enabled)
        Enable/disable Print button
        Parameters:
        enabled -
      • enableReport

        public void enableReport(boolean enabled)
        Enable/disable Report button
        Parameters:
        enabled -
      • enableFind

        public void enableFind(boolean enabled)
        Enable/disable Find/Query button
        Parameters:
        enabled -
      • enableGridToggle

        public void enableGridToggle(boolean enabled)
        Enable/disable Toggle button
        Parameters:
        enabled -
      • enableCustomize

        public void enableCustomize(boolean enabled)
        Enable/disable Customize Grid button
        Parameters:
        enabled -
      • enableArchive

        public void enableArchive(boolean enabled)
        Enable/disable Archive button
        Parameters:
        enabled -
      • enableZoomAcross

        public void enableZoomAcross(boolean enabled)
        Enable/disable Zoom Across button
        Parameters:
        enabled -
      • enableActiveWorkflows

        public void enableActiveWorkflows(boolean enabled)
        Enable/disable Active Workflows button
        Parameters:
        enabled -
      • enableRequests

        public void enableRequests(boolean enabled)
        Enable/disable Requests button
        Parameters:
        enabled -
      • enableQuickForm

        public void enableQuickForm(boolean enabled)
        Enable/disable Quick Form button
        Parameters:
        enabled -
      • lock

        public void lock(boolean locked)
        Turn on/off Lock button (Pressed=On, Not Pressed=Off)
        Parameters:
        locked -
      • enablePostIt

        public void enablePostIt(boolean enabled)
        Enable/disable Post It Note button
        Parameters:
        enabled -
      • enableLabel

        public void enableLabel(boolean enabled)
        Enable/disable Label record button
        Parameters:
        enabled -
      • getEvent

        public org.zkoss.zk.ui.event.Event getEvent()
        Get source event
        Returns:
        ON_Click event that's being handle
      • setVisibleAll

        public void setVisibleAll(boolean visible)
        Make all toolbar buttons visible
        Parameters:
        visible -
      • setVisible

        public void setVisible(String buttonName, boolean visible)
        Parameters:
        buttonName -
        visible -
      • setWindowNo

        public void setWindowNo(int windowNo)
        Parameters:
        windowNo -
      • enableExport

        public void enableExport(boolean b)
        Enable/disable Export button
        Parameters:
        b -
      • enableFileImport

        public void enableFileImport(boolean b)
        Enable/disable File Import button
        Parameters:
        b -
      • enableCSVImport

        public void enableCSVImport(boolean b)
        Enable/disable CSV Import button
        Parameters:
        b -
      • updateToolbarAccess

        public void updateToolbarAccess()
        Initialise the accessibility state of toolbar buttons
      • hasWorkflow

        protected boolean hasWorkflow(GridTab gridTab)
        btnActiveWorkflow should be disabled when table has no workflow defined
        Parameters:
        gridTab -
        Returns:
        true if has workflow define for gridTab
      • enableProcessButton

        public void enableProcessButton(boolean b)
        Enable/disable Process button
        Parameters:
        b - boolean
      • dynamicDisplay

        public void dynamicDisplay()
        Dynamic update of each toolbar button state (Check restrictions).
        For custom button, call ToolbarCustomButton.dynamicDisplay(), process pressedLogic and readOnlyLogic.
      • onPageDetached

        public void onPageDetached(org.zkoss.zk.ui.Page page)
        Specified by:
        onPageDetached in interface org.zkoss.zk.ui.sys.ComponentCtrl
        Overrides:
        onPageDetached in class org.zkoss.zk.ui.AbstractComponent
      • onPageAttached

        public void onPageAttached(org.zkoss.zk.ui.Page newpage, org.zkoss.zk.ui.Page oldpage)
        Specified by:
        onPageAttached in interface org.zkoss.zk.ui.sys.ComponentCtrl
        Overrides:
        onPageAttached in class org.zkoss.zk.ui.AbstractComponent
      • onPostAfterSize

        public void onPostAfterSize()
        Post after size event handler for mobile client.
        Calculate which toolbar buttons should overflow to show more popup.
      • setPressed

        public void setPressed(String buttonName, boolean pressed)
        Set button to pressed/not pressed state
        Parameters:
        buttonName -
        pressed -
      • getQuickFormTabHrchyLevel

        public int getQuickFormTabHrchyLevel()
        Get parent tab level for quick form
        Returns:
        parent tab level for quick form
      • setQuickFormTabHrchyLevel

        public void setQuickFormTabHrchyLevel(int quickFormHrchyTabLevel)
        Set parent tab level for quick form
        Parameters:
        quickFormHrchyTabLevel -
      • refreshUserQuery

        public void refreshUserQuery(int AD_Tab_ID, int AD_UserQuery_ID)
        Reload user queries and set selected item to AD_UserQuery_ID
        Parameters:
        AD_Tab_ID -
        AD_UserQuery_ID -
      • setSelectedUserQuery

        public void setSelectedUserQuery(int AD_UserQuery_ID)
        Set selected user query
        Parameters:
        AD_UserQuery_ID -
      • setSelectedUserQuery

        public void setSelectedUserQuery(MUserQuery selectedUserQuery)
        Set selected user query
        Parameters:
        selectedUserQuery -
      • getAD_UserQuery_ID

        public int getAD_UserQuery_ID()
        Returns:
        AD_UserQuery_ID of selected user query
      • initDefaultQuery

        public boolean initDefaultQuery()
        Set selected user query to first default user query (if any)
        Returns:
        true if there's a default user query