Class CompositeADTabbox

All Implemented Interfaces:
IADTabbox, ISupportMask, UIPart

public class CompositeADTabbox extends AbstractADTabbox
Header and detail controller for AD_Tabs.
This class manage a list of tabs with the current selected tab as the visible ADTabpanel instance.
Child tabs of selected tab is shown in DetailPane using Tabbox.
Author:
Ashley G Ramdass, Low Heng Sin
  • Field Details

    • AD_TABBOX_ON_EDIT_DETAIL_ATTRIBUTE

      public static final String AD_TABBOX_ON_EDIT_DETAIL_ATTRIBUTE
      Execution attribute to hold reference to detail ADTabpanel that's handling onEditDetail event
      See Also:
    • ON_SELECTION_CHANGED_EVENT

      public static final String ON_SELECTION_CHANGED_EVENT
      tab selection change event
      See Also:
  • Constructor Details

    • CompositeADTabbox

      public CompositeADTabbox()
      default constructor
  • Method Details

    • createDetailPane

      protected DetailPane createDetailPane()
      Create detail panel at bottom
      Returns:
      DetailPane
    • onEditDetail

      protected void onEditDetail(int row, boolean formView)
      Edit current row of selected detail tab.
      Make selected detail tab the new header tab.
      Parameters:
      row -
      formView -
    • doCreatePart

      protected org.zkoss.zk.ui.Component doCreatePart(org.zkoss.zk.ui.Component parent)
      Create layout and setup listeners for bread crumb.
      Vertical layout with ADTabpanel as the only child component.
      Specified by:
      doCreatePart in class AbstractUIPart
      Parameters:
      parent - parent Component or null for root UI block
      Returns:
      Component
    • doAddTab

      protected void doAddTab(GridTab gTab, IADTabpanel tabPanel)
      Description copied from class: AbstractADTabbox
      Handle add new tab to UI.
      Override to implement add new tab to UI.
      Specified by:
      doAddTab in class AbstractADTabbox
    • updateSelectedIndex

      public boolean updateSelectedIndex(int oldIndex, int newIndex)
      Description copied from class: AbstractADTabbox
      Change selected tab index from oldIndex to newIndex.
      Delegate to AbstractADTabbox.doTabSelectionChanged(int, int).
      Specified by:
      updateSelectedIndex in interface IADTabbox
      Overrides:
      updateSelectedIndex in class AbstractADTabbox
      Returns:
      true if successfully switch to newIndex
    • updateTabState

      protected void updateTabState()
      Description copied from class: AbstractADTabbox
      Update UI state of tab (visibility, activation and if need invalidate)
      Specified by:
      updateTabState in class AbstractADTabbox
    • getSelectedTabpanel

      public IADTabpanel getSelectedTabpanel()
      Return the selected Tab Panel
      Returns:
      selected header IADTabpanel instance
    • getSelectedIndex

      public int getSelectedIndex()
      Description copied from interface: IADTabbox
      Get selected header tab index
      Returns:
      selected header tab index
    • setSelectionEventListener

      public void setSelectionEventListener(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> listener)
      Description copied from interface: IADTabbox
      Set event listener for tab selection change event
    • doTabSelectionChanged

      protected void doTabSelectionChanged(int oldIndex, int newIndex)
      Description copied from class: AbstractADTabbox
      Handle tab selection change event.
      Override to update UI for tab selection change.
      Specified by:
      doTabSelectionChanged in class AbstractADTabbox
    • getComponent

      public org.zkoss.zk.ui.Component getComponent()
      Description copied from interface: UIPart
      Get root component of UI block
      Returns:
      Component
    • findADTabpanel

      public IADTabpanel findADTabpanel(GridTab gTab)
      Description copied from interface: IADTabbox
      Find IADTabpanel by GridTab
      Returns:
      IADTabpanel instance for gTab or null if not found
    • onDetailRecord

      public void onDetailRecord()
      Description copied from interface: IADTabbox
      Edit current row of selected detail tab.
      The selected detail tab will become the new header tab.
    • isDetailActivated

      public boolean isDetailActivated()
      Returns:
      true if selected detail tab have been activated
    • isSortTab

      public boolean isSortTab()
      Description copied from interface: IADTabbox
      Is current selected header tab a sort tab
      Returns:
      true if current header tab is a sort tab
    • getSelectedDetailADTabpanel

      public IADTabpanel getSelectedDetailADTabpanel()
      Description copied from interface: IADTabbox
      Get IADTabpanel of selected detail tab
      Returns:
      the selected detail IADTabpanel instance
    • needSave

      public boolean needSave(boolean rowChange, boolean onlyRealChange)
      Description copied from interface: IADTabbox
      Is current selected header or detail tab has pending changes to save Call IADTabpanel.needSave(boolean, boolean)
      Returns:
      true if there are changes pending to be save
    • dataIgnore

      public void dataIgnore()
      Description copied from interface: IADTabbox
      Ignore/undo all pending changes
    • getSelectedGridTab

      public GridTab getSelectedGridTab()
      Description copied from interface: IADTabbox
      Get Grid of selected header tab
      Returns:
      GridTab instance of header tab
    • dataSave

      public boolean dataSave(boolean onSaveEvent)
      Description copied from interface: IADTabbox
      Save changes
      Returns:
      true if save is successful
    • setDetailPaneStatusMessage

      public void setDetailPaneStatusMessage(String status, boolean error)
      Description copied from interface: IADTabbox
      Update status text of DetailPane
    • getDirtyADTabpanel

      public IADTabpanel getDirtyADTabpanel()
      Description copied from interface: IADTabbox
      Get IADTabpanel that has pending changes to save
      Returns:
      dirty IADTabpanel that need save ( if any )
    • updateDetailPaneToolbar

      public void updateDetailPaneToolbar(boolean changed, boolean readOnly)
      Description copied from interface: IADTabbox
      Update state of detail pane toolbar.
      Call DetailPane.updateToolbar(boolean, boolean)
      Parameters:
      changed - true if header tab has changed
      readOnly - true if header tab is readonly
    • isDetailPaneLoaded

      public boolean isDetailPaneLoaded()
      Description copied from interface: IADTabbox
      Is detail pane loaded
      Returns:
      true if all the tabs of detail pane have been linked up with header tab
    • setDetailPaneSelectedTab

      public void setDetailPaneSelectedTab(int adTabNo, int currentRow)
      Description copied from interface: IADTabbox
      Set selected tab of DetailPane to tabIndex.
      currentRow - set current row of tab at tabIndex to currentRow