Interface ICarousel
-
- All Superinterfaces:
IAnyGroup<ICarousel>,IChildable<ICarousel,ICarouselitem<IAnyGroup>>,IComponent<ICarousel>,IHtmlBasedComponent<ICarousel>,IXulElement<ICarousel>
public interface ICarousel extends IXulElement<ICarousel>, IChildable<ICarousel,ICarouselitem<IAnyGroup>>, IAnyGroup<ICarousel>
ImmutableCarouselcomponent.A carousel (slideshow) container. Children must be
ICarouselitem.Support @Action
Name Action Type onSelect ActionData: RequestData
Denotes the user moved to another slide; the zero-based index of the new slide can be received fromRequestData.getData()with the key"index".onChanging ActionData: RequestData
Denotes a slide change is starting;RequestData.getData()carries the keys"fromIndex"and"toIndex". Not cancelable.- Since:
- 11.0.0
- Author:
- peaker
- See Also:
Carousel
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classICarousel.BuilderBuilds instances of typeICarousel.static classICarousel.UpdaterBuilds an updater of typeICarouselforUiAgent.smartUpdate(Locator, SmartUpdater).
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intgetActiveIndex()Returns the index of the currently active slide.default java.lang.StringgetEffect()Returns the transition effect used when moving between slides, or null when it was reset to the default.default intgetInterval()Returns the autoplay interval in milliseconds.default java.lang.StringgetOrient()Returns the orientation along which the slides advance, or null when it was reset to the default.default java.lang.StringgetWidgetClass()Returns the client widget class.default booleanisAutoplay()Returns whether the carousel advances through its slides automatically.default booleanisKeyboard()Returns whether the carousel reacts to left/right arrow keys when focused.default booleanisLoop()Returns whether the carousel wraps around from the last slide back to the first (and vice versa).default booleanisPause()Returns whether autoplay pauses while the cursor hovers over the carousel.default booleanisShowArrows()Returns whether the previous/next navigation arrows are shown.default booleanisShowIndicators()Returns whether the slide indicators (the position dots) are shown.static ICarouselof(java.lang.Iterable<? extends ICarouselitem<IAnyGroup>> children)Returns the instance with the givenICarouselitemchildren.static ICarouselof(ICarouselitem<IAnyGroup>... children)Returns the instance with the givenICarouselitemchildren.static ICarouselofId(java.lang.String id)Returns the instance with the given id.ICarouselwithActiveIndex(int activeIndex)Returns a copy ofthisimmutable component with the specifiedactiveIndex.ICarouselwithAutoplay(boolean autoplay)Returns a copy ofthisimmutable component with the specifiedautoplay.ICarouselwithEffect(java.lang.String effect)Returns a copy ofthisimmutable component with the specifiedeffect.ICarouselwithInterval(int interval)Returns a copy ofthisimmutable component with the specifiedinterval.ICarouselwithKeyboard(boolean keyboard)Returns a copy ofthisimmutable component with the specifiedkeyboard.ICarouselwithLoop(boolean loop)Returns a copy ofthisimmutable component with the specifiedloop.ICarouselwithOrient(java.lang.String orient)Returns a copy ofthisimmutable component with the specifiedorient.ICarouselwithPause(boolean pause)Returns a copy ofthisimmutable component with the specifiedpause.ICarouselwithShowArrows(boolean showArrows)Returns a copy ofthisimmutable component with the specifiedshowArrows.ICarouselwithShowIndicators(boolean showIndicators)Returns a copy ofthisimmutable component with the specifiedshowIndicators.-
Methods inherited from interface org.zkoss.stateless.sul.IChildable
getChildren, withChildren, withChildren
-
Methods inherited from interface org.zkoss.stateless.sul.IComponent
getAction, getActions, getClientAttributes, getId, getMold, getWidgetListeners, getWidgetOverrides, isVisible, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withAction, withActions, withActions, withClientAttribute, withClientAttributes, withId, withMold, withVisible, withWidgetClass, withWidgetListener, withWidgetListeners, withWidgetOverride, withWidgetOverrides
-
Methods inherited from interface org.zkoss.stateless.sul.IHtmlBasedComponent
getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getSkeleton, getStyle, getTabindex, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZIndex, isFocus, withClientAction, withDraggable, withDroppable, withFocus, withHeight, withHflex, withLeft, withRenderdefer, withSclass, withSkeleton, withStyle, withTabindex, withTabindex, withTooltiptext, withTop, withVflex, withWidth, withZclass, withZIndex
-
Methods inherited from interface org.zkoss.stateless.sul.IXulElement
getContext, getCtrlKeys, getPopup, getTooltip, withContext, withCtrlKeys, withPopup, withTooltip
-
-
-
-
Field Detail
-
DEFAULT
static final ICarousel DEFAULT
Constant for default attributes of this immutable component.
-
-
Method Detail
-
getWidgetClass
default java.lang.String getWidgetClass()
Returns the client widget class.Default:
"zul.wgt.Carousel"- Specified by:
getWidgetClassin interfaceIComponent<ICarousel>
-
getActiveIndex
default int getActiveIndex()
Returns the index of the currently active slide.Unlike
Carousel.getActiveIndex(), the stored value is returned as given; the clamp toslideCount - 1happens at render time only.Default:
0.
-
withActiveIndex
ICarousel withActiveIndex(int activeIndex)
Returns a copy ofthisimmutable component with the specifiedactiveIndex.Sets the index of the currently active slide.
Note:
UiAgent.smartUpdate(Locator, SmartUpdater)is not supported for this property —ICarousel.Updaterships the raw attribute while the initial render ships the value clamped toslideCount - 1. Push a whole component withUiAgent.replaceWith(Locator, IComponent)instead.- Parameters:
activeIndex- the zero-based index of the slide to activate. An index past the last slide is clamped toslideCount - 1when rendered.Default:
0.- Returns:
- A modified copy of the
thisobject - Throws:
org.zkoss.zk.ui.WrongValueException- ifactiveIndexis negative.
-
isAutoplay
default boolean isAutoplay()
Returns whether the carousel advances through its slides automatically.Default:
false.
-
withAutoplay
ICarousel withAutoplay(boolean autoplay)
Returns a copy ofthisimmutable component with the specifiedautoplay.Sets whether the carousel advances through its slides automatically.
- Parameters:
autoplay- true to start advancing slides automatically (using theinterval), false to leave navigation manual.Default:
false.- Returns:
- A modified copy of the
thisobject
-
getInterval
default int getInterval()
Returns the autoplay interval in milliseconds.Default:
5000.
-
withInterval
ICarousel withInterval(int interval)
Returns a copy ofthisimmutable component with the specifiedinterval.Sets the autoplay interval in milliseconds.
- Parameters:
interval- the autoplay interval in milliseconds; must be at least 500.Default:
5000.- Returns:
- A modified copy of the
thisobject - Throws:
org.zkoss.zk.ui.WrongValueException- ifintervalis less than 500ms.
-
isShowArrows
default boolean isShowArrows()
Returns whether the previous/next navigation arrows are shown.Default:
true.
-
withShowArrows
ICarousel withShowArrows(boolean showArrows)
Returns a copy ofthisimmutable component with the specifiedshowArrows.Sets whether the previous/next navigation arrows are shown.
- Parameters:
showArrows- true to display the navigation arrows, false to hide them.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isShowIndicators
default boolean isShowIndicators()
Returns whether the slide indicators (the position dots) are shown.Default:
true.
-
withShowIndicators
ICarousel withShowIndicators(boolean showIndicators)
Returns a copy ofthisimmutable component with the specifiedshowIndicators.Sets whether the slide indicators (the position dots) are shown.
- Parameters:
showIndicators- true to display the indicators, false to hide them.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isLoop
default boolean isLoop()
Returns whether the carousel wraps around from the last slide back to the first (and vice versa).Default:
true.
-
withLoop
ICarousel withLoop(boolean loop)
Returns a copy ofthisimmutable component with the specifiedloop.Sets whether the carousel wraps around from the last slide back to the first (and vice versa).
- Parameters:
loop- true to wrap around continuously, false to stop at the ends.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isPause
default boolean isPause()
Returns whether autoplay pauses while the cursor hovers over the carousel.Default:
true.
-
withPause
ICarousel withPause(boolean pause)
Returns a copy ofthisimmutable component with the specifiedpause.Sets whether autoplay pauses while the cursor hovers over the carousel.
- Parameters:
pause- true to pause autoplay on hover, false to keep advancing.Default:
true.- Returns:
- A modified copy of the
thisobject
-
isKeyboard
default boolean isKeyboard()
Returns whether the carousel reacts to left/right arrow keys when focused.Default:
true.
-
withKeyboard
ICarousel withKeyboard(boolean keyboard)
Returns a copy ofthisimmutable component with the specifiedkeyboard.Sets whether the carousel reacts to left/right arrow keys when focused.
- Parameters:
keyboard- true to enable arrow-key navigation, false to disable it.Default:
true.- Returns:
- A modified copy of the
thisobject
-
getOrient
@Nullable default java.lang.String getOrient()
Returns the orientation along which the slides advance, or null when it was reset to the default.Default:
"horizontal".
-
withOrient
ICarousel withOrient(@Nullable java.lang.String orient)
Returns a copy ofthisimmutable component with the specifiedorient.Sets the orientation along which the slides advance.
- Parameters:
orient- either"horizontal"or"vertical".Default:
"horizontal".- Returns:
- A modified copy of the
thisobject - Throws:
org.zkoss.zk.ui.WrongValueException- iforientis neither"horizontal"nor"vertical".
-
getEffect
@Nullable default java.lang.String getEffect()
Returns the transition effect used when moving between slides, or null when it was reset to the default.Default:
"slide".
-
withEffect
ICarousel withEffect(@Nullable java.lang.String effect)
Returns a copy ofthisimmutable component with the specifiedeffect.Sets the transition effect used when moving between slides.
- Parameters:
effect- one of"slide","fade"or"none".Default:
"slide".- Returns:
- A modified copy of the
thisobject - Throws:
org.zkoss.zk.ui.WrongValueException- ifeffectis none of"slide","fade"or"none".
-
of
static ICarousel of(java.lang.Iterable<? extends ICarouselitem<IAnyGroup>> children)
Returns the instance with the givenICarouselitemchildren.- Parameters:
children- The children ofICarouselitem
-
of
static ICarousel of(ICarouselitem<IAnyGroup>... children)
Returns the instance with the givenICarouselitemchildren.- Parameters:
children- The children ofICarouselitem
-
ofId
static ICarousel ofId(java.lang.String id)
Returns the instance with the given id.- Parameters:
id- The id to identify this component
-
-