org.odlabs.wiquery.ui.position
Class PositionOptions

java.lang.Object
  extended by org.odlabs.wiquery.ui.position.PositionOptions
All Implemented Interfaces:
Serializable, IComplexOption

public class PositionOptions
extends Object
implements IComplexOption

$Id$

Complex option to store the possible options for the position. This is used too for the option position into the Autocomplete component

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

Nested Class Summary
static class PositionOptions.Collision
          Enumeration of collision values
static class PositionOptions.Position
          Enumeration of position values
 
Constructor Summary
PositionOptions()
          Default constructor
 
Method Summary
 PositionOptions.Position getAt()
           
 PositionOptions.Collision getCollision()
           
 CharSequence getJavascriptOption()
          Method retrieving the javascript representation of this complex option
 PositionOptions.Position getMy()
           
 String getOf()
           
 PositionOffset getOffset()
           
protected  Options getOptions()
          Method retrieving the options
 boolean isBgiframe()
           
 PositionOptions setAt(PositionOptions.Position at)
          Defines which position on the target element to align the positioned element against: "horizontal vertical" alignment.
 PositionOptions setBgiframe(boolean bgiframe)
          Applies the bgiframe plugin when set to true.
 PositionOptions setBy(JsScopePositionEvent by)
          When specified the actual property setting is delegated to this callback.
 PositionOptions setCollision(PositionOptions.Collision collision)
          When the positioned element overflows the window in some direction, move it to an alternative position.
 PositionOptions setMy(PositionOptions.Position my)
          Defines which position on the element being positioned to align with the target element: "horizontal vertical" alignment.
 PositionOptions setOf(String of)
          Element to position against.
 PositionOptions setOffset(PositionOffset offset)
          Add these left-top values to the calculated position, eg.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PositionOptions

public PositionOptions()
Default constructor

Method Detail

getJavascriptOption

public CharSequence getJavascriptOption()
Description copied from interface: IComplexOption
Method retrieving the javascript representation of this complex option

Specified by:
getJavascriptOption in interface IComplexOption
Returns:
the javascript

getOptions

protected Options getOptions()
Method retrieving the options

Returns:
the options

setAt

public PositionOptions 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 PositionOptions 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 PositionOptions 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 PositionOptions 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 PositionOptions 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 PositionOptions 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 PositionOptions 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.