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

public class Collapsible extends Panel
A Collapsible panel contains a list of ITab implementations that are collapsed and can be opened by click on title.

Example:

 List tabs=new ArrayList();
 tabs.add(new AbstractTab(new Model<String>("first tab")) {
   public Panel getPanel(String panelId)
   {
     return new TabPanel1(panelId);
   }
 });

 tabs.add(new AbstractTab(new Model<String>("second tab")) {
   public Panel getPanel(String panelId)
   {
     return new TabPanel2(panelId);
   }
 });

 add(new Collapsible("tabs", tabs));

 <div wicket:id="collapsible"></div>
 
Author:
miha
See Also:
  • Constructor Details

    • Collapsible

      public Collapsible(String markupId, List<ITab> tabs)
      Construct. Marks the first tab active.
      Parameters:
      markupId - mandatory parameter
      tabs - mandatory parameter
    • Collapsible

      public Collapsible(String markupId, List<ITab> tabs, IModel<Integer> activeTab)
      Construct.
      Parameters:
      markupId - mandatory parameter
      tabs - mandatory parameter
      activeTab - mandatory parameter
  • Method Details

    • onInitialize

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

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

      protected Component newTabList(String markupId, List<ITab> tabs)
      creates a new tab list.
      Parameters:
      markupId - The components markup id
      Returns:
      the list view component (default: Loop)
    • getActiveCssClassNameAppender

      protected CssClassNameAppender getActiveCssClassNameAppender()
      Returns:
      the active state css class name as CssClassNameAppender.
    • newContainer

      protected Component newContainer(String markupId, ITab tab, Collapsible.State state)
      creates a new content container.
      Parameters:
      markupId - The markup id of the content container
      tab - the current ITab implementation to render
      state - the current tab state
      Returns:
      new container.
    • newTitle

      protected Component newTitle(String markupId, ITab tab, Collapsible.State state)
      creates a new title component.
      Parameters:
      markupId - The markup id of the content container
      tab - the current ITab implementation to render
      state - the current tab state
      Returns:
      new title label