Class TabsBehavior

  • All Implemented Interfaces:
    com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware, JQueryDestroyListener.IDestroyable, Serializable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, org.apache.wicket.util.io.IClusterable

    public abstract class TabsBehavior
    extends JQueryUIBehavior
    implements com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware
    Provides a jQuery tabs behavior.
    Note, this class has almost the same code as AccordionBehavior
    Since:
    1.2.1
    Author:
    Sebastien Briquet - sebfz1
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String METHOD  
      • Fields inherited from class com.googlecode.wicket.jquery.core.JQueryBehavior

        method, options, selector
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void activate​(int index, org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Activates the selected tab, identified by the index
      void bind​(org.apache.wicket.Component component)  
      void disable​(int index, org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Disables a tab, identified by its index.
      void disable​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Disables all tabs
      void enable​(int index, org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Enables a tab, identified by its index
      void enable​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
      Enables all tabs
      protected abstract List<org.apache.wicket.extensions.markup.html.tabs.ITab> getTabs()
      Gets the reference List of ITabs.
      Usually the model object of the component on which this TabsBehavior is bound to.
      protected List<org.apache.wicket.extensions.markup.html.tabs.ITab> getVisibleTabs()
      Gets a read-only ITab List having its visible flag set to true.
      protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior newOnActivateAjaxBehavior​(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
      Gets a new JQueryAjaxBehavior that will be wired to the 'activate' event
      protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior newOnActivatingAjaxBehavior​(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
      Gets a new JQueryAjaxBehavior that will be wired to the 'beforeActivate' event
      void onAjax​(org.apache.wicket.ajax.AjaxRequestTarget target, com.googlecode.wicket.jquery.core.JQueryEvent event)  
      void onConfigure​(org.apache.wicket.Component component)  
      • Methods inherited from class com.googlecode.wicket.jquery.core.JQueryBehavior

        $, $, $, $, beforeRender, detach, getMethod, getOption, getOptions, getSelector, off, on, on, register, remove, renderHead, setOption, setOption, setOption, setOptions, setSelector
      • Methods inherited from class com.googlecode.wicket.jquery.core.JQueryAbstractBehavior

        add, getJQueryLibrarySettings, renderOnDomReadyScript, renderPriorityHeaderItem, toString
      • Methods inherited from class org.apache.wicket.behavior.Behavior

        afterRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onComponentTag, onEvent, onException, onRemove, onTag, unbind
    • Constructor Detail

      • TabsBehavior

        public TabsBehavior​(String selector,
                            ITabsListener listener)
        Constructor
        Parameters:
        selector - the html selector (ie: "#myId")
        listener - the ITabsListener
      • TabsBehavior

        public TabsBehavior​(String selector,
                            com.googlecode.wicket.jquery.core.Options options,
                            ITabsListener listener)
        Constructor
        Parameters:
        selector - the html selector (ie: "#myId")
        options - the Options
        listener - the ITabsListener
    • Method Detail

      • getTabs

        protected abstract List<org.apache.wicket.extensions.markup.html.tabs.ITab> getTabs()
        Gets the reference List of ITabs.
        Usually the model object of the component on which this TabsBehavior is bound to.
        Returns:
        a non-null List
      • getVisibleTabs

        protected List<org.apache.wicket.extensions.markup.html.tabs.ITab> getVisibleTabs()
        Gets a read-only ITab List having its visible flag set to true.
        Returns:
        a List of ITabs
      • bind

        public void bind​(org.apache.wicket.Component component)
        Overrides:
        bind in class org.apache.wicket.behavior.Behavior
      • activate

        public void activate​(int index,
                             org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Activates the selected tab, identified by the index
        Parameters:
        index - the tab's index
        handler - the IPartialPageRequestHandler
      • enable

        public void enable​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Enables all tabs
        Parameters:
        handler - the IPartialPageRequestHandler
      • enable

        public void enable​(int index,
                           org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Enables a tab, identified by its index
        Parameters:
        index - the tab's index
        handler - the IPartialPageRequestHandler
      • disable

        public void disable​(org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Disables all tabs
        Parameters:
        handler - the IPartialPageRequestHandler
      • disable

        public void disable​(int index,
                            org.apache.wicket.core.request.handler.IPartialPageRequestHandler handler)
        Disables a tab, identified by its index. The selected tab cannot be disabled.
        Parameters:
        index - the tab's index
        handler - the IPartialPageRequestHandler
      • onAjax

        public void onAjax​(org.apache.wicket.ajax.AjaxRequestTarget target,
                           com.googlecode.wicket.jquery.core.JQueryEvent event)
        Specified by:
        onAjax in interface com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware
      • newOnActivateAjaxBehavior

        protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior newOnActivateAjaxBehavior​(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
        Gets a new JQueryAjaxBehavior that will be wired to the 'activate' event
        Parameters:
        source - the IJQueryAjaxAware
        Returns:
        a new OnActivateAjaxBehavior by default
      • newOnActivatingAjaxBehavior

        protected com.googlecode.wicket.jquery.core.ajax.JQueryAjaxBehavior newOnActivatingAjaxBehavior​(com.googlecode.wicket.jquery.core.ajax.IJQueryAjaxAware source)
        Gets a new JQueryAjaxBehavior that will be wired to the 'beforeActivate' event
        Parameters:
        source - the IJQueryAjaxAware
        Returns:
        a new OnActivateAjaxBehavior by default