com.googlecode.wicket.jquery.ui.effect
Class JQueryEffectBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
          extended by com.googlecode.wicket.jquery.ui.effect.JQueryEffectBehavior
All Implemented Interfaces:
IJQueryAjaxAware, Serializable, org.apache.wicket.IClusterable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor

public class JQueryEffectBehavior
extends JQueryAbstractBehavior
implements IJQueryAjaxAware

Provides a specific jQuery behavior for playing effects.

Author:
Sebastien Briquet - sebfz1
See Also:
Serialized Form

Nested Class Summary
protected static class JQueryEffectBehavior.CallbackEvent
          Provides the event object that will be broadcasted by the JQueryAjaxBehavior callback
 
Constructor Summary
JQueryEffectBehavior(String selector, String effect)
          Constructor, with no option and a default speed of SPEED
JQueryEffectBehavior(String selector, String effect, int speed)
          Constructor, with no option
JQueryEffectBehavior(String selector, String effect, Options options)
          Constructor, with a default speed of SPEED
JQueryEffectBehavior(String selector, String effect, Options options, int speed)
          Constructor
 
Method Summary
protected  String $()
           
 String $(String effect)
          Gets the jQuery statement.
 String $(String effect, String options)
          Gets the jQuery statement.
 void bind(org.apache.wicket.Component component)
           
 boolean isCallbackEnabled()
          Indicates whether the callback should be triggered when the effect completes.
If true, the onEffectComplete(AjaxRequestTarget) event will be triggered.
protected  JQueryAjaxBehavior newCallbackBehavior()
          Gets the ajax behavior that will be triggered when the user has selected items
 void onAjax(org.apache.wicket.ajax.AjaxRequestTarget target, JQueryEvent event)
           
 void onEffectComplete(org.apache.wicket.ajax.AjaxRequestTarget target)
          Triggered when the effects is completed
 
Methods inherited from class com.googlecode.wicket.jquery.core.JQueryAbstractBehavior
add, beforeRender, renderHead, toString
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, canCallListenerInterface, canCallListenerInterface, detach, getStatelessHint, isEnabled, isTemporary, onComponentTag, onConfigure, onEvent, onException, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JQueryEffectBehavior

public JQueryEffectBehavior(String selector,
                            String effect)
Constructor, with no option and a default speed of SPEED

Parameters:
selector - the html selector (ie: '#myId')
effect - the effect to be played

JQueryEffectBehavior

public JQueryEffectBehavior(String selector,
                            String effect,
                            Options options)
Constructor, with a default speed of SPEED

Parameters:
selector - the html selector (ie: '#myId')
effect - the effect to be played
options - the options to be applied

JQueryEffectBehavior

public JQueryEffectBehavior(String selector,
                            String effect,
                            int speed)
Constructor, with no option

Parameters:
selector - the html selector (ie: '#myId')
effect - the effect to be played
speed - the speed of the effect

JQueryEffectBehavior

public JQueryEffectBehavior(String selector,
                            String effect,
                            Options options,
                            int speed)
Constructor

Parameters:
selector - the html selector (ie: '#myId')
effect - the effect to be played
options - the options to be applied
speed - the speed of the effect
Method Detail

isCallbackEnabled

public boolean isCallbackEnabled()
Indicates whether the callback should be triggered when the effect completes.
If true, the onEffectComplete(AjaxRequestTarget) event will be triggered.

Returns:
false by default

bind

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

onAjax

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

onEffectComplete

public void onEffectComplete(org.apache.wicket.ajax.AjaxRequestTarget target)
Triggered when the effects is completed

Parameters:
target - the AjaxRequestTarget
See Also:
isCallbackEnabled()

$

protected String $()
Specified by:
$ in class JQueryAbstractBehavior

$

public String $(String effect)
Gets the jQuery statement.

Parameters:
effect - the effect to be played
Returns:
Statement like 'jQuery(function() { ... })'

$

public String $(String effect,
                String options)
Gets the jQuery statement.

Parameters:
effect - the effect to be played
options - the options to be applied
Returns:
Statement like 'jQuery(function() { ... })'

newCallbackBehavior

protected JQueryAjaxBehavior newCallbackBehavior()
Gets the ajax behavior that will be triggered when the user has selected items

Returns:
the JQueryAjaxBehavior


Copyright © 2013 7thWeb. All Rights Reserved.