Package org.zkoss.zul

Class Tabbox

    • Constructor Detail

      • Tabbox

        public Tabbox()
    • Method Detail

      • getEngine

        public TabboxEngine getEngine()
                               throws UiException
        Returns the implementation tabbox engine.
        Throws:
        UiException - if failed to load the engine.
        Since:
        7.0.0
      • setEngine

        public void setEngine​(TabboxEngine engine)
        Sets the tabbox engine for ListModel
        Since:
        7.0.0
      • newTabboxEngine

        protected TabboxEngine newTabboxEngine()
                                        throws UiException
        Instantiates the default tabbox engine. It is called, if setEngine(org.zkoss.zul.impl.TabboxEngine) is not called with non-null engine.

        By default, it looks up the library property called org.zkoss.zul.tabbox.engine.class. If found, the value is assumed to be the class name of the tabbox engine (it must implement TabboxEngine). If not found, UiException is thrown.

        Derived class might override this method to provide your own default class.

        Throws:
        UiException - if failed to instantiate the engine
        Since:
        7.0.0
      • getSelectableModel

        public Selectable<java.lang.Object> getSelectableModel()
      • setModel

        public void setModel​(ListModel<?> model)
        Sets the list model associated with this t. If a non-null model is assigned, no matter whether it is the same as the previous, it will always cause re-render. [ZK EE]
        Parameters:
        model - the list model to associate, or null to dissociate any previous model.
        Throws:
        UiException - if failed to initialize with the model
        Since:
        7.0.0
      • getTabboxRenderer

        public <T> TabboxRenderer<T> getTabboxRenderer()
        Returns the renderer to render each tab and tabpanel, or null if the default renderer is used.
        Since:
        7.0.0
      • setTabboxRenderer

        public void setTabboxRenderer​(TabboxRenderer<?> renderer)
        Sets the renderer which is used to render each tab and tabpanel if getModel() is not null. [ZK EE]

        Note: changing a render will not cause the tabbox to re-render. If you want it to re-render, you could assign the same model again (i.e., setModel(null) and than setModel(oldModel)), or fire an ListDataEvent event.

        Parameters:
        renderer - the renderer, or null to use the default.
        Throws:
        UiException - if failed to initialize with the model
        Since:
        7.0.0
      • setTabboxRenderer

        public void setTabboxRenderer​(java.lang.String clsnm)
                               throws java.lang.ClassNotFoundException,
                                      java.lang.NoSuchMethodException,
                                      java.lang.IllegalAccessException,
                                      java.lang.InstantiationException,
                                      java.lang.reflect.InvocationTargetException
        Sets the renderer by use of a class name. It creates an instance automatically. [ZK EE]
        Throws:
        java.lang.ClassNotFoundException
        java.lang.NoSuchMethodException
        java.lang.IllegalAccessException
        java.lang.InstantiationException
        java.lang.reflect.InvocationTargetException
        Since:
        7.0.0
        See Also:
        setTabboxRenderer(TabboxRenderer)
      • onInitRender

        public void onInitRender()
      • postOnInitRender

        public void postOnInitRender()
        Component internal use only.
        Since:
        7.0.0
      • getModel

        public <T> ListModel<T> getModel()
        Returns the model associated with this selectbox, or null if this selectbox is not associated with any list data model.
      • getTabs

        public Tabs getTabs()
        Returns the tabs that this tabbox owns.
      • getToolbar

        public Toolbar getToolbar()
        Returns the auxiliary toolbar that this tabbox owns.
        Since:
        3.6.3
      • getTabpanels

        public Tabpanels getTabpanels()
        Returns the tabpanels that this tabbox owns.
      • isTabscroll

        public boolean isTabscroll()
        Returns whether the tab scrolling is enabled. Default: true.
        Since:
        3.5.0
      • setTabscroll

        public void setTabscroll​(boolean tabscroll)
        Sets whether to enable the tab scrolling. When enabled, if tab list is wider than tab bar, left, right arrow will appear.
        Since:
        3.5.0
      • isMaximalHeight

        public boolean isMaximalHeight()
        Returns whether to use maximum height of all tabpanel in initial phase.

        Default: false.

        Since:
        7.0.0
      • setMaximalHeight

        public void setMaximalHeight​(boolean maximalHeight)
        Sets whether to use maximum height of all tabpanel in initial phase.

        The Client ROD feature will be disabled if it is set to true.

        Since:
        7.0.0
      • getPanelSpacing

        public java.lang.String getPanelSpacing()
        Returns the spacing between Tabpanel. This is used by certain molds, such as accordion.

        Default: null (no spacing).

      • setPanelSpacing

        public void setPanelSpacing​(java.lang.String panelSpacing)
        Sets the spacing between Tabpanel. This is used by certain molds, such as accordion.
      • getSelectedIndex

        public int getSelectedIndex()
        Returns the selected index.
      • setSelectedIndex

        public void setSelectedIndex​(int j)
        Sets the selected index.
      • getSelectedPanel

        public Tabpanel getSelectedPanel()
        Returns the selected tab panel.
      • setSelectedPanel

        public void setSelectedPanel​(Tabpanel panel)
        Sets the selected tab panel.
      • getSelectedTab

        public Tab getSelectedTab()
        Returns the selected tab.
      • setSelectedTab

        public void setSelectedTab​(Tab tab)
        Sets the selected tab.
      • getOrient

        public java.lang.String getOrient()
        Returns the orient.

        Default: "top".

        Note: only the default mold supports it (not supported if accordion).

      • setOrient

        public void setOrient​(java.lang.String orient)
                       throws WrongValueException
        Sets the orient.
        Parameters:
        orient - either "top", "left", "bottom or "right".
        Throws:
        WrongValueException
        Since:
        7.0.0 "horizontal" is renamed to "top" and "vertical" is renamed to "left".
      • isHorizontal

        public boolean isHorizontal()
        Returns whether it is a horizontal tabbox.
        Since:
        3.0.3
      • isTop

        public boolean isTop()
        Returns whether it is the top orientation.
        Since:
        7.0.0
      • isBottom

        public boolean isBottom()
        Returns whether it is the bottom orientation.
        Since:
        7.0.0
      • isVertical

        public boolean isVertical()
        Returns whether it is a vertical tabbox.
        Since:
        3.0.3
      • isLeft

        public boolean isLeft()
        Returns whether it is the left orientation.
        Since:
        7.0.0
      • isRight

        public boolean isRight()
        Returns whether it is the right orientation.
        Since:
        7.0.0
      • clearSelectedTab

        protected void clearSelectedTab()
      • clone

        public java.lang.Object clone()
        Description copied from interface: Component
        Clones the component. All of its children and descendants are cloned. Also, ID are preserved.
        Specified by:
        clone in interface Component
        Overrides:
        clone in class XulElement
        Returns:
        the new component. Notice that it doesn't belong to any page, nor desktop. It doesn't have a parent, either.