org.odlabs.wiquery.ui.position
Class PositionBehavior

java.lang.Object
  extended by org.apache.wicket.behavior.Behavior
      extended by org.odlabs.wiquery.core.behavior.WiQueryAbstractBehavior
          extended by org.odlabs.wiquery.ui.position.PositionBehavior
All Implemented Interfaces:
Serializable, org.apache.wicket.IClusterable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, IWiQueryPlugin

public class PositionBehavior
extends WiQueryAbstractBehavior

$Id$

Behavior using the position utilities

Missing functionalities:

Since:
1.1
Author:
Julien Roche
See Also:
Serialized Form

Constructor Summary
PositionBehavior()
          Default constructor
 
Method Summary
 PositionOptions.Position getAt()
           
 PositionOptions.Collision getCollision()
           
 PositionOptions.Position getMy()
           
 String getOf()
           
 PositionOffset getOffset()
           
protected  Options getOptions()
          Method retrieving the options of the component
 boolean isBgiframe()
           
 void renderHead(org.apache.wicket.Component component, org.apache.wicket.markup.html.IHeaderResponse response)
           
 PositionBehavior setAt(PositionOptions.Position at)
          Defines which position on the target element to align the positioned element against: "horizontal vertical" alignment.
 PositionBehavior setBgiframe(boolean bgiframe)
          Applies the bgiframe plugin when set to true.
 PositionBehavior setBy(JsScopePositionEvent by)
          When specified the actual property setting is delegated to this callback.
 PositionBehavior setCollision(PositionOptions.Collision collision)
          When the positioned element overflows the window in some direction, move it to an alternative position.
 PositionBehavior setMy(PositionOptions.Position my)
          Defines which position on the element being positioned to align with the target element: "horizontal vertical" alignment.
 PositionBehavior setOf(String of)
          Element to position against.
 PositionBehavior setOffset(PositionOffset offset)
          Add these left-top values to the calculated position, eg.
 JsStatement statement()
          Returns the main JsStatement used to create the plugin.
 
Methods inherited from class org.odlabs.wiquery.core.behavior.WiQueryAbstractBehavior
bind, getComponent, onBind
 
Methods inherited from class org.apache.wicket.behavior.Behavior
afterRender, beforeRender, 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, toString, wait, wait, wait
 

Constructor Detail

PositionBehavior

public PositionBehavior()
Default constructor

Method Detail

renderHead

public void renderHead(org.apache.wicket.Component component,
                       org.apache.wicket.markup.html.IHeaderResponse response)
Specified by:
renderHead in interface org.apache.wicket.markup.html.IComponentAwareHeaderContributor
Overrides:
renderHead in class org.apache.wicket.behavior.Behavior

getOptions

protected Options getOptions()
Method retrieving the options of the component

Returns:
the options

statement

public JsStatement statement()
Description copied from interface: IWiQueryPlugin
Returns the main JsStatement used to create the plugin.

Specified by:
statement in interface IWiQueryPlugin
Specified by:
statement in class WiQueryAbstractBehavior
Returns:
The JsStatement corresponding to this component.

setAt

public PositionBehavior setAt(PositionOptions.Position at)
Defines which position on the target element to align the positioned element against: "horizontal vertical" alignment. A single value such as "right" will default to "right center", "top" will default to "center top" (following CSS convention). Acceptable values: "top", "center", "bottom", "left", "right". Example: "left top" or "center center"

Parameters:
at -
Returns:
the instance

getAt

public PositionOptions.Position getAt()
Returns:
the at option

setBgiframe

public PositionBehavior setBgiframe(boolean bgiframe)
Applies the bgiframe plugin when set to true. Only applies when bgiframe is actually loaded, nothing happens otherwise.

Parameters:
bgiframe -
Returns:
the instance

isBgiframe

public boolean isBgiframe()
Returns:
the bgiframe option

setCollision

public PositionBehavior setCollision(PositionOptions.Collision collision)
When the positioned element overflows the window in some direction, move it to an alternative position. Similar to my and at, this accepts a single value or a pair for horizontal/vertical, eg. "flip", "fit", "fit flip", "fit none".

Parameters:
collision -
Returns:
the instance

getCollision

public PositionOptions.Collision getCollision()
Returns:
the collision option

setMy

public PositionBehavior setMy(PositionOptions.Position my)
Defines which position on the element being positioned to align with the target element: "horizontal vertical" alignment. A single value such as "right" will default to "right center", "top" will default to "center top" (following CSS convention). Acceptable values: "top", "center", "bottom", "left", "right". Example: "left top" or "center center"

Parameters:
my -
Returns:
the instance

getMy

public PositionOptions.Position getMy()
Returns:
the my option

setOf

public PositionBehavior setOf(String of)
Element to position against. You can use a browser event object contains pageX and pageY values. Example: "#top-menu"

Parameters:
of -
Returns:
the instance

getOf

public String getOf()
Returns:
the of option

setOffset

public PositionBehavior setOffset(PositionOffset offset)
Add these left-top values to the calculated position, eg. "50 50" (left top) A single value such as "50" will apply to both.

Parameters:
offset -
Returns:
the instance

getOffset

public PositionOffset getOffset()
Returns:
the offset option

setBy

public PositionBehavior setBy(JsScopePositionEvent by)
When specified the actual property setting is delegated to this callback. Receives a single parameter which is a hash of top and left values for the position that should be set.

Parameters:
by -
Returns:
the instance


Copyright © 2012. All Rights Reserved.