All Implemented Interfaces:
Serializable, Iterable<Component>, IEventSink, IEventSource, IFeedbackContributor, IConverterLocator, IMetadataContext<Serializable,Component>, IQueueRegion, IHeaderContributor, IRequestableComponent, IHierarchical<Component>, IClusterable

public class Carousel extends Panel
A generic plugin and component for cycling through images (with description and header text) like a carousel.
Author:
miha
See Also:
  • Constructor Details

    • Carousel

      public Carousel(String markupId, List<ICarouselImage> images)
      Construct.
      Parameters:
      markupId - the component id
      images - the list of images
    • Carousel

      public Carousel(String markupId, IModel<List<ICarouselImage>> model)
      Construct.
      Parameters:
      markupId - the component id
      model - the list of images
  • Method Details

    • onInitialize

      protected void onInitialize()
      Overrides:
      onInitialize in class MarkupContainer
    • onComponentTag

      protected void onComponentTag(ComponentTag tag)
      Overrides:
      onComponentTag in class Component
    • createPrevLabel

      protected IModel<String> createPrevLabel()
      Returns:
      label of previous button
    • createNextLabel

      protected IModel<String> createNextLabel()
      Returns:
      label of next button
    • newImageList

      protected Component newImageList(String wicketId)
      creates a new ICarouselImage list view
      Parameters:
      wicketId - The component id
      Returns:
      new list view.
    • newImage

      protected Component newImage(String markupId, ICarouselImage image)
      creates a new image element
      Parameters:
      markupId - the markup id of the header
      image - the current image for this header
      Returns:
      new image component
    • newDescription

      protected Component newDescription(String markupId, ICarouselImage image)
      creates a new image description element
      Parameters:
      markupId - the markup id of the header
      image - the current image for this header
      Returns:
      new description component
    • newHeader

      protected Component newHeader(String markupId, ICarouselImage image)
      creates a new image header element
      Parameters:
      markupId - the markup id of the header
      image - the current image for this header
      Returns:
      new header component
    • getInterval

      public final Duration getInterval()
      Returns:
      current interval as Duration
    • setInterval

      public final Carousel setInterval(Duration interval)
      The amount of time to delay between automatically cycling an item. If Duration.NONE or value is 0, carousel will not automatically cycle.
      Parameters:
      interval - The duration
      Returns:
      this instance for chaining
    • detachModel

      protected void detachModel()
      Overrides:
      detachModel in class Component