Class ICardlayoutController

  • public class ICardlayoutController
    extends java.lang.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.

    • Method Detail

      • previous

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

        public boolean next()
        Navigates to next component if possible.
      • 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.

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