Package org.zkoss.stateless.state
Class ICardlayoutController
java.lang.Object
org.zkoss.stateless.state.ICardlayoutController
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 Summary
Modifier and TypeMethodDescriptionbuild()Returns the immutable cardlayout instance that the controller to build with.intReturns the index of the component in viewport.booleannext()Navigates to next component if possible.static ICardlayoutControllerof(ICardlayout owner) Returns the controller instance with the givencardlayoutbooleanprevious()Navigates to previous component if possible.voidsetSelectedIndex(int selectedIndex) Sets the selected index with the given selectedIndex.
-
Method Details
-
previous
public boolean previous()Navigates to previous component if possible. -
next
public boolean next()Navigates to next component if possible. -
of
Returns the controller instance with the givencardlayout- Parameters:
owner- The controller to control with
-
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
-