Class ADSortTab

java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Div
org.adempiere.webui.component.Panel
org.adempiere.webui.adwindow.ADSortTab
All Implemented Interfaces:
Serializable, Cloneable, IADTabpanel, Evaluatee, org.zkoss.zk.ui.Component, org.zkoss.zk.ui.ext.Scope, org.zkoss.zk.ui.sys.ComponentCtrl

public class ADSortTab extends Panel implements IADTabpanel
Tab to maintain Order/Sequence
Author:
Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL FR [ 1779410 ] VSortTab: display ID for not visible columns, victor.perez@e-evolution.com, e-Evolution FR [ 2826406 ] The Tab Sort without parent column
  • https://sourceforge.net/p/adempiere/feature-requests/776/ Zk Port, Low Heng Sin, Juan David Arboleda : Refactoring Yes and No List to work with multiple choice.
  • 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
      protected static final CLogger
      Logger
      protected Listbox
       
      protected SimpleListModel
       
      protected Listbox
       
      protected SimpleListModel
       

      Fields inherited from class org.adempiere.webui.component.Panel

      HORIZONTAL, VERTICAL

      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

      Fields inherited from interface org.adempiere.webui.adwindow.IADTabpanel

      ATTR_ON_ACTIVATE_POSTED, ON_ACTIVATE_EVENT
    • Constructor Summary

      Constructors
      Constructor
      Description
      default constructor
    • Method Summary

      Modifier and Type
      Method
      Description
      void
      activate(boolean b)
      Activate/deactivate this IADTabpanel instance.
      Call by init or after tab selection changed.
      void
      afterSave(boolean onSaveEvent)
      Handle after save event
      void
      Layout fields of the tab panel
      boolean
      dataSave(boolean onSaveEvent)
      Save changes.
      Call GridTab.dataSave(boolean)
      void
      Dynamic update of every field's UI properties ( visibility, filter and mandatory ).
      void
      editRecord(boolean b)
      Deprecated, for removal: This API element is subject to removal in a future version.
      get_ValueAsString(String variableName)
      Get Variable Value
      Get parent detail pane
      Get display logic
      Get GridTab of tab
      Get GridView component
      int
      Get record id of current row
      Get table name
      int
      Get tab level
      int
      Get tab no
      Get title of tab
      List<org.zkoss.zul.Button>
      Get toolbar buttons
      Get tree panel component
      void
      init(AbstractADWindowContent winPanel, GridTab gridTab)
      Initiate
      boolean
      Is tab panel have been activated
      boolean
      Is tab has changes
      boolean
      Is current row not stall
      boolean
      Is tab panel in detail pane mode
      boolean
      Is customize grid button enable
      boolean
      Is process button enable
      boolean
      Is quick form enabled
      boolean
      Is tab panel showing grid view
      void
      Load data
      protected void
      migrateLists(Listbox listFrom, Listbox listTo, int endIndex)
      Move an item from listFrom to listTo.
      protected void
      migrateValueAcrossLists(org.zkoss.zk.ui.event.Event event)
      Move an item between yes and no list.
      Delegate to migrateLists(Listbox, Listbox, int)
      protected void
      migrateValueWithinYesList(int endIndex, List<org.adempiere.webui.adwindow.ADSortTab.ListElement> selObjects)
      Move items within Yes List with Drag Event and Multiple Choice
      protected void
      migrateValueWithinYesList(org.zkoss.zk.ui.event.Event event)
      Move an item within Yes List
      boolean
      needSave(boolean rowChange, boolean onlyRealChange)
      boolean
      Handle enter key event
      void
      Execute query through the backed GridTab instance.
      void
      query(boolean currentRows, int currentDays, int i)
      void
      Refresh data through the backed GridTab instance.
      void
      Set AD Window content part that own this ADSortTab instance.
      void
      Reset detail data grid when current record of parent tab is new and not saved yet.
      Call GridTab.resetDetailForNewParentRecord()
      void
      Save changes to db.
      void
      Set the DetailPane part that own this IADTabpanel instance
      void
      setDetailPaneMode(boolean detailMode)
      Turn on/off detail mode, i.e whether tab panel is currently a header or detail tab of the window.
      void
      setIsChanged(boolean value)
      Set tab change status.
      void
      setTabNo(int tabNo)
      Set tab number/sequence within an AD_Window
      void
      Switch between grid and form view
      void
      updateDetailToolbar(org.zkoss.zul.Toolbar toolbar)
      Update DetailPane toolbar buttons state
      void
      Update ADWindowToolbar buttons state

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

      clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, renderProperties, 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, getZclass, 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, onPageAttached, onPageDetached, 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

      Methods inherited from interface org.zkoss.zk.ui.Component

      addEventListener, addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientAttribute, getClientDataAttribute, getDefinition, getDesktop, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getShadowVariable, getShadowVariable, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, query, queryAll, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setWidgetClass, setWidgetListener, setWidgetOverride

      Methods inherited from interface org.adempiere.webui.adwindow.IADTabpanel

      isDetailVisible

      Methods inherited from interface org.zkoss.zk.ui.ext.Scope

      addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute
    • Field Details

    • Constructor Details

      • ADSortTab

        public ADSortTab()
        default constructor
    • Method Details

      • init

        public void init(AbstractADWindowContent winPanel, GridTab gridTab)
        Initiate
        Specified by:
        init in interface IADTabpanel
        Parameters:
        winPanel -
        gridTab -
      • loadData

        public void loadData()
        Load data
      • setIsChanged

        public void setIsChanged(boolean value)
        Set tab change status.
        Parameters:
        value - true for dirty/changed state, false otherwise
      • isChanged

        public boolean isChanged()
        Is tab has changes
        Returns:
        true if tab has changes
      • migrateValueAcrossLists

        protected void migrateValueAcrossLists(org.zkoss.zk.ui.event.Event event)
        Move an item between yes and no list.
        Delegate to migrateLists(Listbox, Listbox, int)
        Parameters:
        event -
      • migrateLists

        protected void migrateLists(Listbox listFrom, Listbox listTo, int endIndex)
        Move an item from listFrom to listTo.
        Parameters:
        listFrom -
        listTo -
        endIndex - destination index
      • migrateValueWithinYesList

        protected void migrateValueWithinYesList(org.zkoss.zk.ui.event.Event event)
        Move an item within Yes List
        Parameters:
        event - event
      • migrateValueWithinYesList

        protected void migrateValueWithinYesList(int endIndex, List<org.adempiere.webui.adwindow.ADSortTab.ListElement> selObjects)
        Move items within Yes List with Drag Event and Multiple Choice
        Parameters:
        endIndex - move items after endIndex
        selObjects - selected items to move
      • registerAPanel

        public void registerAPanel(AbstractADWindowContent panel)
        Set AD Window content part that own this ADSortTab instance.
        Parameters:
        panel -
      • saveData

        public void saveData()
        Save changes to db.
      • activate

        public void activate(boolean b)
        Description copied from interface: IADTabpanel
        Activate/deactivate this IADTabpanel instance.
        Call by init or after tab selection changed.
        Specified by:
        activate in interface IADTabpanel
      • createUI

        public void createUI()
        Description copied from interface: IADTabpanel
        Layout fields of the tab panel
        Specified by:
        createUI in interface IADTabpanel
      • dynamicDisplay

        public void dynamicDisplay(int i)
        Description copied from interface: IADTabpanel
        Dynamic update of every field's UI properties ( visibility, filter and mandatory ).
        Specified by:
        dynamicDisplay in interface IADTabpanel
        Parameters:
        i - optional column name
      • editRecord

        @Deprecated(forRemoval=true, since="11") public void editRecord(boolean b)
        Deprecated, for removal: This API element is subject to removal in a future version.
      • getDisplayLogic

        public String getDisplayLogic()
        Description copied from interface: IADTabpanel
        Get display logic
        Specified by:
        getDisplayLogic in interface IADTabpanel
        Returns:
        display logic
      • getGridTab

        public GridTab getGridTab()
        Description copied from interface: IADTabpanel
        Get GridTab of tab
        Specified by:
        getGridTab in interface IADTabpanel
        Returns:
        GridTab instance that back this IADTabpanel instance
      • getTabLevel

        public int getTabLevel()
        Description copied from interface: IADTabpanel
        Get tab level
        Specified by:
        getTabLevel in interface IADTabpanel
        Returns:
        tab level
      • getTableName

        public String getTableName()
        Description copied from interface: IADTabpanel
        Get table name
        Specified by:
        getTableName in interface IADTabpanel
        Returns:
        table name from GridTab
      • getRecord_ID

        public int getRecord_ID()
        Description copied from interface: IADTabpanel
        Get record id of current row
        Specified by:
        getRecord_ID in interface IADTabpanel
        Returns:
        record ID of current row
      • getTitle

        public String getTitle()
        Description copied from interface: IADTabpanel
        Get title of tab
        Specified by:
        getTitle in interface IADTabpanel
        Returns:
        title of tab
      • isCurrent

        public boolean isCurrent()
        Description copied from interface: IADTabpanel
        Is current row not stall
        Specified by:
        isCurrent in interface IADTabpanel
        Returns:
        true if refresh is not needed
      • query

        public void query()
        Description copied from interface: IADTabpanel
        Execute query through the backed GridTab instance.
        Specified by:
        query in interface IADTabpanel
      • query

        public void query(boolean currentRows, int currentDays, int i)
        Description copied from interface: IADTabpanel
        Specified by:
        query in interface IADTabpanel
      • refresh

        public void refresh()
        Description copied from interface: IADTabpanel
        Refresh data through the backed GridTab instance.
        Specified by:
        refresh in interface IADTabpanel
      • switchRowPresentation

        public void switchRowPresentation()
        Description copied from interface: IADTabpanel
        Switch between grid and form view
        Specified by:
        switchRowPresentation in interface IADTabpanel
      • get_ValueAsString

        public String get_ValueAsString(String variableName)
        Description copied from interface: Evaluatee
        Get Variable Value
        Specified by:
        get_ValueAsString in interface Evaluatee
        Parameters:
        variableName - name
        Returns:
        value
      • afterSave

        public void afterSave(boolean onSaveEvent)
        Description copied from interface: IADTabpanel
        Handle after save event
        Specified by:
        afterSave in interface IADTabpanel
      • onEnterKey

        public boolean onEnterKey()
        Description copied from interface: IADTabpanel
        Handle enter key event
        Specified by:
        onEnterKey in interface IADTabpanel
        Returns:
        true if the event is process
      • isGridView

        public boolean isGridView()
        Description copied from interface: IADTabpanel
        Is tab panel showing grid view
        Specified by:
        isGridView in interface IADTabpanel
        Returns:
        true if current presentation of the tab panel is grid/list view
      • isActivated

        public boolean isActivated()
        Description copied from interface: IADTabpanel
        Is tab panel have been activated
        Specified by:
        isActivated in interface IADTabpanel
        Returns:
        true if the tab panel have been activated
      • setDetailPaneMode

        public void setDetailPaneMode(boolean detailMode)
        Description copied from interface: IADTabpanel
        Turn on/off detail mode, i.e whether tab panel is currently a header or detail tab of the window.
        Specified by:
        setDetailPaneMode in interface IADTabpanel
      • isDetailPaneMode

        public boolean isDetailPaneMode()
        Description copied from interface: IADTabpanel
        Is tab panel in detail pane mode
        Specified by:
        isDetailPaneMode in interface IADTabpanel
        Returns:
        true if the panel is in detail mode (i.e a tab in DetailPane)
      • getGridView

        public GridView getGridView()
        Description copied from interface: IADTabpanel
        Get GridView component
        Specified by:
        getGridView in interface IADTabpanel
        Returns:
        GridView instance
      • needSave

        public boolean needSave(boolean rowChange, boolean onlyRealChange)
        Description copied from interface: IADTabpanel
        Specified by:
        needSave in interface IADTabpanel
        Returns:
        true if there are pending changes
      • dataSave

        public boolean dataSave(boolean onSaveEvent)
        Description copied from interface: IADTabpanel
        Save changes.
        Call GridTab.dataSave(boolean)
        Specified by:
        dataSave in interface IADTabpanel
        Returns:
        true if the save operation completed successfully
      • setTabNo

        public void setTabNo(int tabNo)
        Description copied from interface: IADTabpanel
        Set tab number/sequence within an AD_Window
        Specified by:
        setTabNo in interface IADTabpanel
      • getTabNo

        public int getTabNo()
        Description copied from interface: IADTabpanel
        Get tab no
        Specified by:
        getTabNo in interface IADTabpanel
        Returns:
        tab no ( ad_tab.tabno )
      • setDetailPane

        public void setDetailPane(DetailPane detailPane)
        Description copied from interface: IADTabpanel
        Set the DetailPane part that own this IADTabpanel instance
        Specified by:
        setDetailPane in interface IADTabpanel
      • getDetailPane

        public DetailPane getDetailPane()
        Description copied from interface: IADTabpanel
        Get parent detail pane
        Specified by:
        getDetailPane in interface IADTabpanel
        Returns:
        the DetailPane part that own this IADTabpanel instance
      • resetDetailForNewParentRecord

        public void resetDetailForNewParentRecord()
        Description copied from interface: IADTabpanel
        Reset detail data grid when current record of parent tab is new and not saved yet.
        Call GridTab.resetDetailForNewParentRecord()
        Specified by:
        resetDetailForNewParentRecord in interface IADTabpanel
      • getTreePanel

        public ADTreePanel getTreePanel()
        Description copied from interface: IADTabpanel
        Get tree panel component
        Specified by:
        getTreePanel in interface IADTabpanel
        Returns:
        ADTreePanel instance
      • isEnableQuickFormButton

        public boolean isEnableQuickFormButton()
        Description copied from interface: IADTabpanel
        Is quick form enabled
        Specified by:
        isEnableQuickFormButton in interface IADTabpanel
        Returns:
        true if Quick Form Button is Enabled
      • getToolbarButtons

        public List<org.zkoss.zul.Button> getToolbarButtons()
        Description copied from interface: IADTabpanel
        Get toolbar buttons
        Specified by:
        getToolbarButtons in interface IADTabpanel
        Returns:
        List of toolbar buttons
      • isEnableCustomizeButton

        public boolean isEnableCustomizeButton()
        Description copied from interface: IADTabpanel
        Is customize grid button enable
        Specified by:
        isEnableCustomizeButton in interface IADTabpanel
        Returns:
        true if customize grid button is enabled
      • isEnableProcessButton

        public boolean isEnableProcessButton()
        Description copied from interface: IADTabpanel
        Is process button enable
        Specified by:
        isEnableProcessButton in interface IADTabpanel
        Returns:
        true if process Button is Enabled
      • updateToolbar

        public void updateToolbar(ADWindowToolbar toolbar)
        Description copied from interface: IADTabpanel
        Update ADWindowToolbar buttons state
        Specified by:
        updateToolbar in interface IADTabpanel
        Parameters:
        toolbar - - ADWindowToolbar
      • updateDetailToolbar

        public void updateDetailToolbar(org.zkoss.zul.Toolbar toolbar)
        Description copied from interface: IADTabpanel
        Update DetailPane toolbar buttons state
        Specified by:
        updateDetailToolbar in interface IADTabpanel
        Parameters:
        toolbar - - Toolbar