Class ICardlayoutController

java.lang.Object
org.zkoss.stateless.state.ICardlayoutController

public class ICardlayoutController extends Object
An ICardlayout controller to control card navigation.

Note: this class is not thread-safe, so when it's used in multi-threading environment, the developer should handle the threading issue.

Author:
katherine
  • Method Details

    • previous

      public boolean previous()
      Navigates to previous component if possible.
    • next

      public boolean next()
      Navigates to next component if possible.
    • of

      public static ICardlayoutController of(ICardlayout owner)
      Returns the controller instance with the given cardlayout
      Parameters:
      owner - The controller to control with
    • build

      public ICardlayout build()
      Returns the immutable cardlayout instance that the controller to build with.
    • getSelectedIndex

      public int getSelectedIndex()
      Returns the index of the component in viewport.
    • setSelectedIndex

      public void setSelectedIndex(int selectedIndex)
      Sets the selected index with the given selectedIndex.

      Note: Unlike other component, "deselect" is unnecessary in Cardlayout. So the index value can't be negative, if do so, it will occur an UiException.

      Parameters:
      selectedIndex - The index of the component to be displayed in the viewport