com.googlecode.wicket.jquery.ui.widget.menu
Class MenuBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
          extended by com.googlecode.wicket.jquery.core.JQueryBehavior
              extended by com.googlecode.wicket.jquery.ui.widget.menu.MenuBehavior
All Implemented Interfaces:
IJQueryAjaxAware, Serializable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, org.apache.wicket.util.io.IClusterable

public abstract class MenuBehavior
extends JQueryBehavior
implements IJQueryAjaxAware

Provides a jQuery menu behavior.

Since:
1.4.2, 1.6.2
Author:
Sebastien Briquet - sebfz1
See Also:
Serialized Form

Nested Class Summary
protected static class MenuBehavior.SelectEvent
          Provides an event object that will be broadcasted by the JQueryAjaxBehavior 'select' callback
 
Field Summary
 
Fields inherited from class com.googlecode.wicket.jquery.core.JQueryBehavior
method, options, selector
 
Constructor Summary
MenuBehavior(String selector)
          Constructor
MenuBehavior(String selector, Options options)
          Constructor
 
Method Summary
 void bind(org.apache.wicket.Component component)
           
protected abstract  Map<String,IMenuItem> getMenuItemMap()
          Gets the reference map of hash/menu-item.
protected  JQueryAjaxBehavior newOnSelectBehavior()
          Gets a new JQueryAjaxBehavior that acts as the 'select' javascript callback
 void onAjax(org.apache.wicket.ajax.AjaxRequestTarget target, JQueryEvent event)
           
 void onClick(org.apache.wicket.ajax.AjaxRequestTarget target, IMenuItem item)
          Triggered when a menu-item is clicked
 void onConfigure(org.apache.wicket.Component component)
           
 
Methods inherited from class com.googlecode.wicket.jquery.core.JQueryBehavior
$, $, $, getOption, on, on, renderHead, setOption, setOptions
 
Methods inherited from class com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
add, toString
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onEvent, onException, onRemove, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MenuBehavior

public MenuBehavior(String selector)
Constructor

Parameters:
selector - the html selector (ie: "#myId")

MenuBehavior

public MenuBehavior(String selector,
                    Options options)
Constructor

Parameters:
selector - the html selector (ie: "#myId")
options - the Options
Method Detail

getMenuItemMap

protected abstract Map<String,IMenuItem> getMenuItemMap()
Gets the reference map of hash/menu-item.

Returns:
the non-null Map

bind

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

onConfigure

public void onConfigure(org.apache.wicket.Component component)
Overrides:
onConfigure in class JQueryAbstractBehavior

onAjax

public void onAjax(org.apache.wicket.ajax.AjaxRequestTarget target,
                   JQueryEvent event)
Specified by:
onAjax in interface IJQueryAjaxAware

newOnSelectBehavior

protected JQueryAjaxBehavior newOnSelectBehavior()
Gets a new JQueryAjaxBehavior that acts as the 'select' javascript callback

Returns:
the JQueryAjaxBehavior

onClick

public void onClick(org.apache.wicket.ajax.AjaxRequestTarget target,
                    IMenuItem item)
Triggered when a menu-item is clicked

Parameters:
target - the AjaxRequestTarget
item - the IMenuItem


Copyright © 2013 7thWeb. All Rights Reserved.