com.gwtext.client.core
Class BaseElement

java.lang.Object
  extended by com.gwtext.client.core.JsObject
      extended by com.gwtext.client.core.BaseElement
All Implemented Interfaces:
Fx
Direct Known Subclasses:
CompositeElement, ExtElement

public class BaseElement
extends JsObject
implements Fx

Represents a base Element in the DOM.


Field Summary
 
Fields inherited from class com.gwtext.client.core.JsObject
jsObj
 
Constructor Summary
protected BaseElement()
           
  BaseElement(com.google.gwt.core.client.JavaScriptObject jsObj)
           
 
Method Summary
 BaseElement addClass(java.lang.String className)
          Adds a CSS class to the element.
 BaseElement addClass(java.lang.String[] classNames)
          Adds CSS classes to the element.
 BaseElement addClassOnClick(java.lang.String className)
          Sets up event handlers to add and remove a css class when the mouse is down and then up on this element (a click effect).
 BaseElement addClassOnFocus(java.lang.String className)
          Sets up event handlers to add and remove a css class when this element has the focus
 BaseElement addClassOnOver(java.lang.String className)
           
 BaseElement addClassOnOver(java.lang.String className, boolean preventFlicker)
          Sets up event handlers to add and remove a css class when the mouse is over this element.
 KeyMap addKeyListener(int[] keyCodes, KeyListener listener)
          Convenience method for constructing a KeyMap.
 KeyMap addKeyListener(int keyCode, KeyListener listener)
          Convenience method for constructing a KeyMap.
 KeyMap addKeyListener(java.lang.String keys, KeyListener listener)
          Convenience method for constructing a KeyMap.
 KeyMap addKeyMap(KeyMapConfig config)
          Convenience method for constructing a KeyMap.
 void addListener(java.lang.String eventName, EventCallback cb)
          Appends an event handler.
 void addListener(java.lang.String eventName, EventCallback cb, ListenerConfig config)
          Appends an event handler.
 BaseElement alignTo(java.lang.String id, java.lang.String anchorPosition)
          Aligns this element with another element relative to the specified anchor points.
 BaseElement alignTo(java.lang.String id, java.lang.String anchorPosition, int[] offsetXY, boolean animate)
          Aligns this element with another element relative to the specified anchor points.
 BaseElement anchorTo(java.lang.String id, java.lang.String anchorPosition)
          Aligns this element with another element relative to the specified anchor points.
 BaseElement anchorTo(java.lang.String id, java.lang.String anchorPosition, int[] offsetXY, boolean animate, int bufferDelay)
          Aligns this element with another element relative to the specified anchor points.
 BaseElement animate(GenericConfig args)
          Perform animation on this element.
 BaseElement animate(GenericConfig args, float duration, Function onComplete, com.gwtext.client.animation.Easing easing, java.lang.String animType)
          Perform animation on this element.
 BaseElement applyStyles(java.lang.String style)
          More flexible version of setStyle(java.lang.String, java.lang.String) for setting style properties.
 BaseElement autoHeight()
          Measures the element's content height and updates height to match.
 BaseElement autoHeight(boolean animate, float duration, Function onComplete, com.gwtext.client.animation.Easing easing)
          Measures the element's content height and updates height to match.
 void clean()
          Removes worthless text nodes.
 void clean(boolean forceClean)
          Removes worthless text nodes.
 BaseElement clearOpacity()
          Clears any opacity settings from this element.
 BaseElement clip()
          Store the current overflow setting and clip overflow on the element - use unclip to remove.
 ExtElement createShim()
          Creates an iframe shim for this element to keep selects and other windowed objects from showing through.
 BaseElement enableDisplayMode()
          Convenience method for setVisibilityMode(Element.DISPLAY)
 BaseElement enableDisplayMode(java.lang.String display)
          Convenience method for setVisibilityMode(Element.DISPLAY)
 Fx fadeIn()
          Fade an element in (from transparent to opaque).
 Fx fadeIn(FxConfig config)
          Fade an element in (from transparent to opaque).
 Fx fadeOut()
          Fade an element out (from opaque to transparent) from the element's current opacity to 0.
 Fx fadeOut(FxConfig config)
          Fade an element out (from opaque to transparent).
 Fx frame()
          Shows a ripple of exploding, attenuating borders to draw attention to an Element.
 Fx frame(java.lang.String color, int count, FxConfig config)
          Shows a ripple of exploding, attenuating borders to draw attention to an Element.
 Fx ghost()
          Slides the element while fading it out of view.
 Fx ghost(java.lang.String anchorPosition, FxConfig config)
          Slides the element while fading it out of view.
 boolean hasActiveFx()
          Returns true if the element has any effects actively running or queued, else returns false.
 boolean hasFxBlock()
          Returns true if the element is currently blocking so that no other effect can be queued until this effect is finished, else returns false if blocking is not set.
 BaseElement hide()
          Hide this element - Uses display mode to determine whether to use "display" or "visibility".
 BaseElement hide(AnimationConfig animateConfig)
          Hide this element - Uses display mode to determine whether to use "display" or "visibility".
 BaseElement hide(boolean animate)
          Hide this element - Uses display mode to determine whether to use "display" or "visibility".
 Fx highlight()
          Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.
 Fx highlight(java.lang.String color, FxConfig config)
          Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.
 Fx highlight(java.lang.String color, java.lang.String attr, java.lang.String endColor, FxConfig config)
          Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.
 BaseElement move(Direction direction, int distance)
          Move this element relative to its current position.
 BaseElement move(Direction direction, int distance, AnimationConfig animateConfig)
          Move this element relative to its current position.
 BaseElement move(Direction direction, int distance, boolean animate)
          Move this element relative to its current position.
 BaseElement moveTo(int x, int y)
          Sets the position of the element in page coordinates, regardless of how the element is positioned.
 BaseElement moveTo(int x, int y, AnimationConfig animateConfig)
          Sets the position of the element in page coordinates, regardless of how the element is positioned.
 BaseElement moveTo(int x, int y, boolean animate)
          Sets the position of the element in page coordinates, regardless of how the element is positioned.
 Fx pause(int seconds)
          Creates a pause before any subsequent queued effects begin.
 Fx puff()
          Fades the element out while slowly expanding it in all directions.
 Fx puff(boolean remove, FxConfig config)
          Fades the element out while slowly expanding it in all directions.
 BaseElement radioClass(java.lang.String className)
          Adds a CSS class to this element and removes the same class(es) from all siblings.
 BaseElement radioClass(java.lang.String[] classNames)
          Adds one or more CSS classes to this element and removes the same class(es) from all siblings.
 void remove()
          Removes this element from the DOM and deletes it from the cache.
 void removeAllListeners()
          Removes all previous added listeners from this element.
 BaseElement removeClass(java.lang.String className)
          Removes the CSS classes from the element.
 BaseElement removeClass(java.lang.String[] classNames)
          Removes the CSS classes from the element.
 BaseElement repaint()
          Forces the browser to repaint this element.
 BaseElement replaceClass(java.lang.String oldClassName, java.lang.String newClassName)
          Replaces a CSS class on the element with another.
 Fx scale(int width, int height)
          Animates the transition of an element's dimensions from a starting height/width to an ending height/width.
 Fx scale(int width, int height, FxConfig config)
          Animates the transition of an element's dimensions from a starting height/width to an ending height/width.
 boolean scroll(Direction direction, int distance, AnimationConfig animateConfig)
          Scrolls this element the specified direction.
 boolean scroll(Direction direction, int distance, boolean animate)
          Scrolls this element the specified direction.
 BaseElement scrollTo(java.lang.String side, int value, AnimationConfig animateConfig)
          Scrolls this element the specified scroll point.
 BaseElement scrollTo(java.lang.String side, int value, boolean animate)
          Scrolls this element the specified scroll point.
 Fx sequenceFx()
          Ensures that all effects queued after sequenceFx is called on the element are run in sequence.
 BaseElement setBottom(java.lang.String bottom)
          Sets the element's CSS bottom style.
 BaseElement setBounds(int x, int y, int width, int height)
          Sets the element's position and size in one shot.
 BaseElement setBounds(int x, int y, int width, int height, AnimationConfig animateConfig)
          Sets the element's position and size in one shot.
 BaseElement setBounds(int x, int y, int width, int height, boolean animate)
          Sets the element's position and size in one shot.
 BaseElement setBox(Box box)
          Sets the element's box.
 BaseElement setBox(Box box, boolean adjust, AnimationConfig animateConfig)
          Sets the element's box.
 BaseElement setBox(Box box, boolean adjust, boolean animate)
          Sets the element's box.
 BaseElement setDisplayed(boolean value)
          Sets the CSS display property.
 BaseElement setHeight(int height, AnimationConfig animateConfig)
          Set the height of the element.
 BaseElement setHeight(int height, boolean animate)
          Set the height of the element.
 BaseElement setLeft(java.lang.String left)
          Sets the element's left position directly using CSS style (instead of setX).
 BaseElement setLeftTop(java.lang.String left, java.lang.String top)
          Quick set left and top adding default units.
 BaseElement setLocation(int x, int y, AnimationConfig animateConfig)
          Sets the position of the element in page coordinates, regardless of how the element is positioned.
 BaseElement setLocation(int x, int y, boolean animate)
          Sets the position of the element in page coordinates, regardless of how the element is positioned.
 BaseElement setOpacity(float opacity, AnimationConfig animateConfig)
          Set the opacity of the element.
 BaseElement setOpacity(float opacity, boolean animate)
          Set the opacity of the element.
 BaseElement setRegion(Region region, AnimationConfig animateConfig)
          Sets the element's position and size the the specified region.
 BaseElement setRegion(Region region, boolean animate)
          Sets the element's position and size the the specified region.
 BaseElement setRight(java.lang.String right)
          Sets the element's CSS right style.
 BaseElement setSize(int width, int height, AnimationConfig animateConfig)
          Set the size of the element.
 BaseElement setSize(int width, int height, boolean animate)
          Set the size of the element.
 BaseElement setStyle(java.lang.String style, java.lang.String value)
          Wrapper for setting style properties.
 BaseElement setStyles(GenericConfig styles)
          Wrapper for setting style properties.
 BaseElement setTop(java.lang.String top)
          Sets the element's top position directly using CSS style (instead of setY).
 BaseElement setVisibilityMode(boolean useVisibleProperty)
          Sets the element's visibility mode.
 BaseElement setVisible(boolean visible)
          Sets the visibility of the element.
 BaseElement setVisible(boolean visible, AnimationConfig animateConfig)
          Sets the visibility of the element.
 BaseElement setVisible(boolean visible, boolean animate)
          Sets the visibility of the element.
 BaseElement setWidth(int width, AnimationConfig animateConfig)
          Set the width of the element.
 BaseElement setWidth(int width, boolean animate)
          Set the width of the element.
 BaseElement setWidth(java.lang.String width, boolean animate)
          Set the width of the element.
 BaseElement setX(int x, AnimationConfig animateConfig)
          Sets the X position of the element based on page coordinates.
 BaseElement setX(int x, boolean animate)
          Sets the X position of the element based on page coordinates.
 BaseElement setXY(int x, int y, AnimationConfig animateConfig)
          Sets the position of the element in page coordinates, regardless of how the element is positioned.
 BaseElement setXY(int x, int y, boolean animate)
          Sets the position of the element in page coordinates, regardless of how the element is positioned.
 BaseElement setY(int y, AnimationConfig animateConfig)
          Sets the Y position of the element based on page coordinates.
 BaseElement setY(int y, boolean animate)
          Sets the Y position of the element based on page coordinates.
 Fx shift(int x, int y, int width, int height, FxConfig config)
          Animates the transition of any combination of an element's dimensions, xy position and/or opacity.
 BaseElement show(AnimationConfig animateConfig)
          Show this element - Uses display mode to determine whether to use "display" or "visibility".
 BaseElement show(boolean animate)
          Show this element - Uses display mode to determine whether to use "display" or "visibility".
 Fx slideIn()
          Slides the element into view.
 Fx slideIn(java.lang.String anchorPosition, FxConfig config)
          Slides the element into view.
 Fx slideOut()
          Slides the element out of view.
 Fx slideOut(boolean remove, java.lang.String anchorPosition, FxConfig config)
          Slides the element out of view.
 Fx stopFx()
          Stops any running effects and clears the element's internal effects queue if it contains any additional effects that haven't started yet.
 BaseElement swallowEvent(java.lang.String eventName)
          Stops the specified event from bubbling and optionally prevents the default action.
 BaseElement swallowEvent(java.lang.String eventName, boolean preventDefault)
          Stops the specified event from bubbling and optionally prevents the default action.
 Fx switchOff()
          Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television).
 Fx switchOff(boolean remove, FxConfig config)
          Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television).
 Fx syncFx()
          Ensures that all effects queued after syncFx is called on the element are run concurrently.
 BaseElement toggle(AnimationConfig animateConfig)
          Toggles the element's visibility or display, depending on visibility mode.
 BaseElement toggle(boolean animate)
          Toggles the element's visibility or display, depending on visibility mode.
 BaseElement toggleClass(java.lang.String className)
          Toggles the specified CSS class on this element (removes it if it already exists, otherwise adds it).
 void unselectable()
          Disables text selection for this element (normalized across browsers).
 void update(java.lang.String html)
          Update the innerHTML of this element.
 void update(java.lang.String html, boolean loadScripts)
          Update the innerHTML of this element, optionally searching for and processing scripts.
 com.google.gwt.user.client.Element wrap(DomConfig config)
          Creates and wraps this element with another element.
 
Methods inherited from class com.gwtext.client.core.JsObject
getJsObj, getProperties, isCreated, setJsObj
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseElement

protected BaseElement()

BaseElement

public BaseElement(com.google.gwt.core.client.JavaScriptObject jsObj)
Method Detail

addClass

public BaseElement addClass(java.lang.String className)
Adds a CSS class to the element. Duplicate classes are automatically filtered out.

Parameters:
className - the CSS class to add
Returns:
this

addClass

public BaseElement addClass(java.lang.String[] classNames)
Adds CSS classes to the element. Duplicate classes are automatically filtered out.

Parameters:
classNames - an array of CSS classes
Returns:
this

addClassOnClick

public BaseElement addClassOnClick(java.lang.String className)
Sets up event handlers to add and remove a css class when the mouse is down and then up on this element (a click effect).

Parameters:
className - the CSS class to add
Returns:
this

addClassOnFocus

public BaseElement addClassOnFocus(java.lang.String className)
Sets up event handlers to add and remove a css class when this element has the focus

Parameters:
className - the CSS class to add
Returns:
this

addClassOnOver

public BaseElement addClassOnOver(java.lang.String className)

addClassOnOver

public BaseElement addClassOnOver(java.lang.String className,
                                  boolean preventFlicker)
Sets up event handlers to add and remove a css class when the mouse is over this element.

Parameters:
className - the CSS class to add
preventFlicker - if set to true, it prevents flickering by filtering mouseout events for children elements
Returns:
this

addKeyListener

public KeyMap addKeyListener(int keyCode,
                             KeyListener listener)
Convenience method for constructing a KeyMap.

Parameters:
keyCode - the numeric key code
listener - the key listener
Returns:
the KeyMap created

addKeyListener

public KeyMap addKeyListener(int[] keyCodes,
                             KeyListener listener)
Convenience method for constructing a KeyMap.

Parameters:
keyCodes - array of key codes
listener - the key listener
Returns:
the KeyMap created

addKeyListener

public KeyMap addKeyListener(java.lang.String keys,
                             KeyListener listener)
Convenience method for constructing a KeyMap.

Parameters:
keys - a string with the keys to listen for
listener - the key listener
Returns:
the KeyMap created

addKeyMap

public KeyMap addKeyMap(KeyMapConfig config)
Convenience method for constructing a KeyMap.

Parameters:
config - the key map config
Returns:
the KeyMap created

addListener

public void addListener(java.lang.String eventName,
                        EventCallback cb)
Appends an event handler.

Parameters:
eventName - the type of event to append
cb - the event callback

addListener

public void addListener(java.lang.String eventName,
                        EventCallback cb,
                        ListenerConfig config)
Appends an event handler.

Parameters:
eventName - the type of event to append
cb - the event callback
config - the listener config

alignTo

public BaseElement alignTo(java.lang.String id,
                           java.lang.String anchorPosition)
Aligns this element with another element relative to the specified anchor points. If the other element is the document it aligns it to the viewport. The anchorPosition value is separated by a dash, the first value is used as the element's anchor point, and the second value is used as the target's anchor point. In addition to the anchor points, the position parameter also supports the "?" character. If "?" is passed at the end of the position string, the element will attempt to align as specified, but the position will be adjusted to constrain to the viewport if necessary. Note that the element being aligned might be swapped to align to a different position than that specified in order to enforce the viewport constraints. Following are all of the supported anchor positions:
Value  Description
 -----  -----------------------------
 tl     The top left corner (default)
 t      The center of the top edge
 tr     The top right corner
 l      The center of the left edge
 c      In the center of the element
 r      The center of the right edge
 bl     The bottom left corner
 b      The center of the bottom edge
 br     The bottom right corner
Example Usage:

 // align el to other-el using the default positioning ("tl-bl", non-constrained)
 el.alignTo("other-el");
 // align the top left corner of el with the top right corner of other-el (constrained to viewport)
 el.alignTo("other-el", "tr?");

 // align the bottom right corner of el with the center left edge of other-el
 el.alignTo("other-el", "br-l?");
 // align the center of el with the bottom left corner of other-el and
 // adjust the x position by -6 pixels (and the y position by 0)
 el.alignTo("other-el", "c-bl", new int[]{-6, 0});

Parameters:
id - the element to align to
anchorPosition - the element's anchor point
Returns:
this

alignTo

public BaseElement alignTo(java.lang.String id,
                           java.lang.String anchorPosition,
                           int[] offsetXY,
                           boolean animate)
Aligns this element with another element relative to the specified anchor points. If the other element is the document it aligns it to the viewport. The anchorPosition value is separated by a dash, the first value is used as the element's anchor point, and the second value is used as the target's anchor point. In addition to the anchor points, the position parameter also supports the "?" character. If "?" is passed at the end of the position string, the element will attempt to align as specified, but the position will be adjusted to constrain to the viewport if necessary. Note that the element being aligned might be swapped to align to a different position than that specified in order to enforce the viewport constraints. Following are all of the supported anchor positions:
Value  Description
 -----  -----------------------------
 tl     The top left corner (default)
 t      The center of the top edge
 tr     The top right corner
 l      The center of the left edge
 c      In the center of the element
 r      The center of the right edge
 bl     The bottom left corner
 b      The center of the bottom edge
 br     The bottom right corner
Example Usage:

 // align el to other-el using the default positioning ("tl-bl", non-constrained)
 el.alignTo("other-el");
 // align the top left corner of el with the top right corner of other-el (constrained to viewport)
 el.alignTo("other-el", "tr?");

 // align the bottom right corner of el with the center left edge of other-el
 el.alignTo("other-el", "br-l?");
 // align the center of el with the bottom left corner of other-el and
 // adjust the x position by -6 pixels (and the y position by 0)
 el.alignTo("other-el", "c-bl", new int[]{-6, 0});

Parameters:
id - the element to align to
anchorPosition - the element's anchor point
offsetXY - offset the positioning by [x, y]
animate - true for the default animation
Returns:
this

anchorTo

public BaseElement anchorTo(java.lang.String id,
                            java.lang.String anchorPosition)
Aligns this element with another element relative to the specified anchor points. If the other element is the document it aligns it to the viewport.

Parameters:
id - the element to align to
anchorPosition - the element's anchor point
Returns:
this

anchorTo

public BaseElement anchorTo(java.lang.String id,
                            java.lang.String anchorPosition,
                            int[] offsetXY,
                            boolean animate,
                            int bufferDelay)
Aligns this element with another element relative to the specified anchor points. If the other element is the document it aligns it to the viewport.

Parameters:
id - the element to align to
anchorPosition - the element's anchor point
offsetXY - offset the positioning by [x, y]
animate - true for the default animation
bufferDelay - buffer delay
Returns:
this

animate

public BaseElement animate(GenericConfig args)
Perform animation on this element. For example :
 GenericConfig animArgs = new GenericConfig();
 GenericConfig widthArgs = new GenericConfig();
 widthArgs.setProperty("from", 600);
 widthArgs.setProperty("to", 0);
 animArgs.setProperty("width", widthArgs);
 el.animate(animArgs);
 

Parameters:
args - animation control args
Returns:
this

animate

public BaseElement animate(GenericConfig args,
                           float duration,
                           Function onComplete,
                           com.gwtext.client.animation.Easing easing,
                           java.lang.String animType)
Perform animation on this element.

Parameters:
args - animation control args
duration - how long the animation lasts in seconds (defaults to .35)
onComplete - function to call when animation completes
easing - Easing method to use (defaults to easeOut) easeOut. See http://developer.yahoo.com/yui/docs/YAHOO.util.Easing.html
animType - 'run' is the default. Can also be 'color', 'motion', or 'scroll'
Returns:
this

applyStyles

public BaseElement applyStyles(java.lang.String style)
More flexible version of setStyle(java.lang.String, java.lang.String) for setting style properties.

Parameters:
style - a style specification string, e.g. "width:100px"
Returns:
this

autoHeight

public BaseElement autoHeight()
Measures the element's content height and updates height to match. Note: this function uses setTimeout so the new height may not be available immediately.

Returns:
this

autoHeight

public BaseElement autoHeight(boolean animate,
                              float duration,
                              Function onComplete,
                              com.gwtext.client.animation.Easing easing)
Measures the element's content height and updates height to match. Note: this function uses setTimeout so the new height may not be available immediately.

Parameters:
animate - animate the transition (defaults to false)
duration - length of the animation in seconds (defaults to .35)
onComplete - Function to call when animation completes
easing - Easing method to use (defaults to easeOut)
Returns:
this

clean

public void clean()
Removes worthless text nodes.


clean

public void clean(boolean forceClean)
Removes worthless text nodes.

Parameters:
forceClean - by default the element keeps track if it has been cleaned already so you can call this over and over. However, if you update the element and need to force a reclean, you can pass true.

clearOpacity

public BaseElement clearOpacity()
Clears any opacity settings from this element. Required in some cases for IE.

Returns:
this

clip

public BaseElement clip()
Store the current overflow setting and clip overflow on the element - use unclip to remove.

Returns:
this

createShim

public ExtElement createShim()
Creates an iframe shim for this element to keep selects and other windowed objects from showing through.

Returns:
the new shim element

enableDisplayMode

public BaseElement enableDisplayMode()
Convenience method for setVisibilityMode(Element.DISPLAY)

Returns:
this

enableDisplayMode

public BaseElement enableDisplayMode(java.lang.String display)
Convenience method for setVisibilityMode(Element.DISPLAY)

Parameters:
display - what to set display to when visible
Returns:
this

hide

public BaseElement hide()
Hide this element - Uses display mode to determine whether to use "display" or "visibility". See setVisible(boolean).

Returns:
this

hide

public BaseElement hide(boolean animate)
Hide this element - Uses display mode to determine whether to use "display" or "visibility". See setVisible(boolean).

Parameters:
animate - true for the default animation
Returns:
this

hide

public BaseElement hide(AnimationConfig animateConfig)
Hide this element - Uses display mode to determine whether to use "display" or "visibility". See setVisible(boolean).

Parameters:
animateConfig - the animation config
Returns:
this

move

public BaseElement move(Direction direction,
                        int distance)
Move this element relative to its current position.

Parameters:
direction - the direction
distance - how far to move the element in pixels
Returns:
this

move

public BaseElement move(Direction direction,
                        int distance,
                        boolean animate)
Move this element relative to its current position.

Parameters:
direction - the direction
distance - how far to move the element in pixels
animate - true for the default animation
Returns:
this

move

public BaseElement move(Direction direction,
                        int distance,
                        AnimationConfig animateConfig)
Move this element relative to its current position.

Parameters:
direction - the direction
distance - how far to move the element in pixels
animateConfig - the animation config
Returns:
this

moveTo

public BaseElement moveTo(int x,
                          int y)
Sets the position of the element in page coordinates, regardless of how the element is positioned. the element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
x - X value for new position (coordinates are page-based)
y - Y value for new position (coordinates are page-based)
Returns:
this

moveTo

public BaseElement moveTo(int x,
                          int y,
                          boolean animate)
Sets the position of the element in page coordinates, regardless of how the element is positioned. the element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
x - X value for new position (coordinates are page-based)
y - Y value for new position (coordinates are page-based)
animate - true to animate
Returns:
this

moveTo

public BaseElement moveTo(int x,
                          int y,
                          AnimationConfig animateConfig)
Sets the position of the element in page coordinates, regardless of how the element is positioned. the element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
x - X value for new position (coordinates are page-based)
y - Y value for new position (coordinates are page-based)
animateConfig - the animcation config
Returns:
this

radioClass

public BaseElement radioClass(java.lang.String className)
Adds a CSS class to this element and removes the same class(es) from all siblings.

Parameters:
className - the CSS class to add
Returns:
this

radioClass

public BaseElement radioClass(java.lang.String[] classNames)
Adds one or more CSS classes to this element and removes the same class(es) from all siblings.

Parameters:
classNames - the CSS classes to add
Returns:
this

remove

public void remove()
Removes this element from the DOM and deletes it from the cache.


removeAllListeners

public void removeAllListeners()
Removes all previous added listeners from this element.


removeClass

public BaseElement removeClass(java.lang.String className)
Removes the CSS classes from the element.

Parameters:
className - the CSS class to remove
Returns:
this

removeClass

public BaseElement removeClass(java.lang.String[] classNames)
Removes the CSS classes from the element.

Parameters:
classNames - the CSS classes to remove
Returns:
this

repaint

public BaseElement repaint()
Forces the browser to repaint this element.

Returns:
this

replaceClass

public BaseElement replaceClass(java.lang.String oldClassName,
                                java.lang.String newClassName)
Replaces a CSS class on the element with another. If the old name does not exist, the new name will simply be added.

Parameters:
oldClassName - the CSS class to replace
newClassName - the replacement CSS class
Returns:
this

scroll

public boolean scroll(Direction direction,
                      int distance,
                      boolean animate)
Scrolls this element the specified direction. Does bounds checking to make sure the scroll is within this element's scrollable range.

Parameters:
direction - the direction
distance - how far to scroll the element in pixels
animate - true to animate
Returns:
true if a scroll was triggered or false if the element was scrolled as far as it could go.

scroll

public boolean scroll(Direction direction,
                      int distance,
                      AnimationConfig animateConfig)
Scrolls this element the specified direction. Does bounds checking to make sure the scroll is within this element's scrollable range.

Parameters:
direction - the direction
distance - how far to scroll the element in pixels
animateConfig - the animation config
Returns:
true if a scroll was triggered or false if the element was scrolled as far as it could go.

scrollTo

public BaseElement scrollTo(java.lang.String side,
                            int value,
                            boolean animate)
Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll().

Parameters:
side - Either "left" for scrollLeft values or "top" for scrollTop values.
value - the new scroll value
animate - true for the default animation
Returns:
this

scrollTo

public BaseElement scrollTo(java.lang.String side,
                            int value,
                            AnimationConfig animateConfig)
Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll().

Parameters:
side - Either "left" for scrollLeft values or "top" for scrollTop values.
value - the new scroll value
animateConfig - the animation config
Returns:
this

setBottom

public BaseElement setBottom(java.lang.String bottom)
Sets the element's CSS bottom style.

Parameters:
bottom - the bottom CSS property value
Returns:
this

setBounds

public BaseElement setBounds(int x,
                             int y,
                             int width,
                             int height)
Sets the element's position and size in one shot.

Parameters:
x - X value for new position (coordinates are page-based)
y - Y value for new position (coordinates are page-based)
width - the new width
height - the new height
Returns:
this

setBounds

public BaseElement setBounds(int x,
                             int y,
                             int width,
                             int height,
                             boolean animate)
Sets the element's position and size in one shot. If animation is true then width, height, x and y will be animated concurrently.

Parameters:
x - X value for new position (coordinates are page-based)
y - Y value for new position (coordinates are page-based)
width - the new width
height - the new height
animate - true to animate
Returns:
this

setBounds

public BaseElement setBounds(int x,
                             int y,
                             int width,
                             int height,
                             AnimationConfig animateConfig)
Sets the element's position and size in one shot. If animation is true then width, height, x and y will be animated concurrently.

Parameters:
x - X value for new position (coordinates are page-based)
y - Y value for new position (coordinates are page-based)
width - the new width
height - the new height
animateConfig - the animation config
Returns:
this

setBox

public BaseElement setBox(Box box)
Sets the element's box. Use getBox() on another element to get a box obj.

Parameters:
box - the box to fill {x, y, width, height}
Returns:
this

setBox

public BaseElement setBox(Box box,
                          boolean adjust,
                          boolean animate)
Sets the element's box. Use getBox() on another element to get a box obj. If animate is true then width, height, x and y will be animated concurrently.

Parameters:
box - the box to fill {x, y, width, height}
adjust - Whether to adjust for box-model issues automatically
animate - true for the default animation
Returns:
this

setBox

public BaseElement setBox(Box box,
                          boolean adjust,
                          AnimationConfig animateConfig)
Sets the element's box. Use getBox() on another element to get a box obj. If animate is true then width, height, x and y will be animated concurrently.

Parameters:
box - the box to fill {x, y, width, height}
adjust - Whether to adjust for box-model issues automatically
animateConfig - the animation config
Returns:
this

setDisplayed

public BaseElement setDisplayed(boolean value)
Sets the CSS display property. Uses originalDisplay if the specified value is a boolean true.

Parameters:
value - Boolean value to display the element using its default display
Returns:
this

setHeight

public BaseElement setHeight(int height,
                             boolean animate)
Set the height of the element.

Parameters:
height - the new height
animate - true to animate
Returns:
this

setHeight

public BaseElement setHeight(int height,
                             AnimationConfig animateConfig)
Set the height of the element.

Parameters:
height - the new height
animateConfig - the animation config
Returns:
this

setLeft

public BaseElement setLeft(java.lang.String left)
Sets the element's left position directly using CSS style (instead of setX).

Parameters:
left - the left CSS property value
Returns:
this

setLeftTop

public BaseElement setLeftTop(java.lang.String left,
                              java.lang.String top)
Quick set left and top adding default units.

Parameters:
left - the left CSS property value
top - the top CSS property value
Returns:
this

setLocation

public BaseElement setLocation(int x,
                               int y,
                               boolean animate)
Sets the position of the element in page coordinates, regardless of how the element is positioned. the element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
x - X value for new position (coordinates are page-based)
y - Y value for new position (coordinates are page-based)
animate - true to animate
Returns:
this

setLocation

public BaseElement setLocation(int x,
                               int y,
                               AnimationConfig animateConfig)
Sets the position of the element in page coordinates, regardless of how the element is positioned. the element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
x - X value for new position (coordinates are page-based)
y - Y value for new position (coordinates are page-based)
animateConfig - the animation config
Returns:
this

setOpacity

public BaseElement setOpacity(float opacity,
                              boolean animate)
Set the opacity of the element.

Parameters:
opacity - the new opacity. 0 = transparent, .5 = 50% visibile, 1 = fully visible, etc
animate - true to animate
Returns:
this

setOpacity

public BaseElement setOpacity(float opacity,
                              AnimationConfig animateConfig)
Set the opacity of the element.

Parameters:
opacity - the new opacity. 0 = transparent, .5 = 50% visibile, 1 = fully visible, etc
animateConfig - the animation config
Returns:
this

setRegion

public BaseElement setRegion(Region region,
                             boolean animate)
Sets the element's position and size the the specified region. If animation is true then width, height, x and y will be animated concurrently.

Parameters:
region - the region to fill
animate - true to animate
Returns:
this

setRegion

public BaseElement setRegion(Region region,
                             AnimationConfig animateConfig)
Sets the element's position and size the the specified region. If animation is true then width, height, x and y will be animated concurrently.

Parameters:
region - the region to fill
animateConfig - the animation config
Returns:
this

setRight

public BaseElement setRight(java.lang.String right)
Sets the element's CSS right style.

Parameters:
right - the right CSS property value
Returns:
this

setSize

public BaseElement setSize(int width,
                           int height,
                           boolean animate)
Set the size of the element. If animation is true, both width an height will be animated concurrently.

Parameters:
width - the new width
height - the new height
animate - true to animate
Returns:
this

setSize

public BaseElement setSize(int width,
                           int height,
                           AnimationConfig animateConfig)
Set the size of the element. If animation is true, both width an height will be animated concurrently.

Parameters:
width - the new width
height - the new height
animateConfig - the animation config
Returns:
this

setStyle

public BaseElement setStyle(java.lang.String style,
                            java.lang.String value)
Wrapper for setting style properties.

Parameters:
style - the style property to be set
value - the value to apply to the given property
Returns:
this

setStyles

public BaseElement setStyles(GenericConfig styles)
Wrapper for setting style properties.

Parameters:
styles - the style property to be set
Returns:
this

setTop

public BaseElement setTop(java.lang.String top)
Sets the element's top position directly using CSS style (instead of setY).

Parameters:
top - the top CSS property value
Returns:
this

setVisibilityMode

public BaseElement setVisibilityMode(boolean useVisibleProperty)
Sets the element's visibility mode. When setVisible() is called it will use this to determine whether to set the visibility or the display property.

Parameters:
useVisibleProperty - true to use VISIBILITY, false for DISPLAY
Returns:
this

setVisible

public BaseElement setVisible(boolean visible)
Sets the visibility of the element. If the visibilityMode is set to Element.DISPLAY, it will use the display property to hide the element, otherwise it uses visibility. the default is to hide and show using the visibility property.

Parameters:
visible - Whether the element is visible
Returns:
this

setVisible

public BaseElement setVisible(boolean visible,
                              boolean animate)
Sets the visibility of the element. If the visibilityMode is set to Element.DISPLAY, it will use the display property to hide the element, otherwise it uses visibility. the default is to hide and show using the visibility property.

Parameters:
visible - Whether the element is visible
animate - true to animate
Returns:
this

setVisible

public BaseElement setVisible(boolean visible,
                              AnimationConfig animateConfig)
Sets the visibility of the element. If the visibilityMode is set to Element.DISPLAY, it will use the display property to hide the element, otherwise it uses visibility. the default is to hide and show using the visibility property.

Parameters:
visible - Whether the element is visible
animateConfig - the animation config
Returns:
this

setWidth

public BaseElement setWidth(int width,
                            boolean animate)
Set the width of the element.

Parameters:
width - the new width
animate - true to animate
Returns:
this

setWidth

public BaseElement setWidth(java.lang.String width,
                            boolean animate)
Set the width of the element.

Parameters:
width - the new width
animate - true to animate
Returns:
this

setWidth

public BaseElement setWidth(int width,
                            AnimationConfig animateConfig)
Set the width of the element.

Parameters:
width - the new width
animateConfig - the animation config
Returns:
this

setX

public BaseElement setX(int x,
                        boolean animate)
Sets the X position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
x - X position of the element
animate - true to animate
Returns:
this

setX

public BaseElement setX(int x,
                        AnimationConfig animateConfig)
Sets the X position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
x - X position of the element
animateConfig - the animation config
Returns:
this

setXY

public BaseElement setXY(int x,
                         int y,
                         boolean animate)
Sets the position of the element in page coordinates, regardless of how the element is positioned. the element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
x - X position of the element
y - Y position of the element
animate - true to animate
Returns:
this

setXY

public BaseElement setXY(int x,
                         int y,
                         AnimationConfig animateConfig)
Sets the position of the element in page coordinates, regardless of how the element is positioned. the element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
x - X position of the element
y - Y position of the element
animateConfig - the animation config
Returns:
this

setY

public BaseElement setY(int y,
                        boolean animate)
Sets the Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
y - Y position of the element
animate - true to animate
Returns:
this

setY

public BaseElement setY(int y,
                        AnimationConfig animateConfig)
Sets the Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).

Parameters:
y - Y position of the element
animateConfig - the animation config
Returns:
this

show

public BaseElement show(boolean animate)
Show this element - Uses display mode to determine whether to use "display" or "visibility". See setVisible(boolean).

Parameters:
animate - true to animate
Returns:
this

show

public BaseElement show(AnimationConfig animateConfig)
Show this element - Uses display mode to determine whether to use "display" or "visibility". See setVisible(boolean).

Parameters:
animateConfig - the animation config
Returns:
this

swallowEvent

public BaseElement swallowEvent(java.lang.String eventName)
Stops the specified event from bubbling and optionally prevents the default action.

Parameters:
eventName - the event name
Returns:
this

swallowEvent

public BaseElement swallowEvent(java.lang.String eventName,
                                boolean preventDefault)
Stops the specified event from bubbling and optionally prevents the default action.

Parameters:
eventName - the event name
preventDefault - true to prevent the default action too
Returns:
this

toggle

public BaseElement toggle(boolean animate)
Toggles the element's visibility or display, depending on visibility mode.

Parameters:
animate - true to animate
Returns:
this

toggle

public BaseElement toggle(AnimationConfig animateConfig)
Toggles the element's visibility or display, depending on visibility mode.

Parameters:
animateConfig - the animation config
Returns:
this

toggleClass

public BaseElement toggleClass(java.lang.String className)
Toggles the specified CSS class on this element (removes it if it already exists, otherwise adds it).

Parameters:
className - the CSS class to toggle
Returns:
this

unselectable

public void unselectable()
Disables text selection for this element (normalized across browsers).


update

public void update(java.lang.String html)
Update the innerHTML of this element.

Parameters:
html - the new HTML

update

public void update(java.lang.String html,
                   boolean loadScripts)
Update the innerHTML of this element, optionally searching for and processing scripts.

Parameters:
html - the new HTML
loadScripts - true to look for and process scripts

wrap

public com.google.gwt.user.client.Element wrap(DomConfig config)
Creates and wraps this element with another element.

Parameters:
config - DomHelper element config object for the wrapper element
Returns:
this

fadeIn

public Fx fadeIn()
Description copied from interface: Fx
Fade an element in (from transparent to opaque).

 // default: fade in from opacity 0 to 100%
 el.fadeIn();
 

Specified by:
fadeIn in interface Fx
Returns:
this

fadeIn

public Fx fadeIn(FxConfig config)
Description copied from interface: Fx
Fade an element in (from transparent to opaque). The ending opacity can be specified using the "endOpacity" config option.

 // fade in from opacity 0 to 75% over 2 seconds
 el.fadeIn(new FxConfig() {
 {
    setEndOpacity(0.75);
    setDuration(2);
 });
 

Specified by:
fadeIn in interface Fx
Parameters:
config - the Fx config
Returns:
this

fadeOut

public Fx fadeOut()
Description copied from interface: Fx
Fade an element out (from opaque to transparent) from the element's current opacity to 0.

Specified by:
fadeOut in interface Fx
Returns:
this

fadeOut

public Fx fadeOut(FxConfig config)
Description copied from interface: Fx
Fade an element out (from opaque to transparent). The ending opacity can be specified using the "endOpacity" config option.

 // fade out from the element's current opacity to 25% over 2 seconds
 el.fadeOut(new FxConfig() {
 {
    setEndOpacity(0.25);
    setDuration(2);
 });
 

Specified by:
fadeOut in interface Fx
Parameters:
config - the Fx config
Returns:
this

frame

public Fx frame()
Description copied from interface: Fx
Shows a ripple of exploding, attenuating borders to draw attention to an Element.

Specified by:
frame in interface Fx
Returns:
this

frame

public Fx frame(java.lang.String color,
                int count,
                FxConfig config)
Description copied from interface: Fx
Shows a ripple of exploding, attenuating borders to draw attention to an Element.

 // 3 red ripples lasting 3 seconds total
 el.frame("ff0000", 3, new FxConfig() {
                     {
                         setDurtion(3);
                     }));
 

Specified by:
frame in interface Fx
Parameters:
color - he color of the border. Should be a 6 char hex color without the leading # (defaults to light blue: 'C3DAF9').
count - The number of ripples to display (defaults to 1)
config - the Fx config
Returns:
this

ghost

public Fx ghost()
Description copied from interface: Fx
Slides the element while fading it out of view.

Specified by:
ghost in interface Fx
Returns:
this

ghost

public Fx ghost(java.lang.String anchorPosition,
                FxConfig config)
Description copied from interface: Fx
Slides the element while fading it out of view.

Specified by:
ghost in interface Fx
Parameters:
anchorPosition - the anchor position
config - the Fx config
Returns:
true

hasActiveFx

public boolean hasActiveFx()
Description copied from interface: Fx
Returns true if the element has any effects actively running or queued, else returns false.

Specified by:
hasActiveFx in interface Fx
Returns:
True if element has active effects, else false

hasFxBlock

public boolean hasFxBlock()
Description copied from interface: Fx
Returns true if the element is currently blocking so that no other effect can be queued until this effect is finished, else returns false if blocking is not set. This is commonly used to ensure that an effect initiated by a user action runs to completion prior to the same effect being restarted (e.g., firing only one effect even if the user clicks several times).

Specified by:
hasFxBlock in interface Fx
Returns:
True if blocking, else false

highlight

public Fx highlight()
Description copied from interface: Fx
Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.

Specified by:
highlight in interface Fx
Returns:
this

highlight

public Fx highlight(java.lang.String color,
                    FxConfig config)
Description copied from interface: Fx
Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color.

Specified by:
highlight in interface Fx
Parameters:
color - The highlight color. Should be a 6 char hex color without the leading # (defaults to yellow: 'ffff9c')
config - the Fx config
Returns:
this

highlight

public Fx highlight(java.lang.String color,
                    java.lang.String attr,
                    java.lang.String endColor,
                    FxConfig config)
Description copied from interface: Fx
Highlights the Element by setting a color (applies to the background-color by default, but can be changed using the "attr" config option) and then fading back to the original color. If no original color is available, you should provide the "endColor" config option which will be cleared after the animation.

 // highlight foreground text to blue for 2 seconds
 el.highlight("0000ff", "color", "ffffff", new FxConfig() {{
                        setDuration(3)
                        }});

Specified by:
highlight in interface Fx
Parameters:
color - The highlight color. Should be a 6 char hex color without the leading # (defaults to yellow: 'ffff9c')
attr - the attribute. Can be any valid CSS property (attribute) that supports a color value. Default is 'background-color'
endColor - the end color
config - the Fx config
Returns:
this

pause

public Fx pause(int seconds)
Description copied from interface: Fx
Creates a pause before any subsequent queued effects begin. If there are no effects queued after the pause it will have no effect.

Specified by:
pause in interface Fx
Parameters:
seconds - The length of time to pause (in seconds)
Returns:
this

puff

public Fx puff()
Description copied from interface: Fx
Fades the element out while slowly expanding it in all directions. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document.

Specified by:
puff in interface Fx
Returns:
this

puff

public Fx puff(boolean remove,
               FxConfig config)
Description copied from interface: Fx
Fades the element out while slowly expanding it in all directions. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. The element can be removed from the DOM using the 'remove' config option if desired.

Specified by:
puff in interface Fx
Parameters:
remove - true to remove element
config - the Fx config
Returns:
this

scale

public Fx scale(int width,
                int height)
Description copied from interface: Fx
Animates the transition of an element's dimensions from a starting height/width to an ending height/width.

Specified by:
scale in interface Fx
Parameters:
width - The new width
height - The new height
Returns:
this

scale

public Fx scale(int width,
                int height,
                FxConfig config)
Description copied from interface: Fx
Animates the transition of an element's dimensions from a starting height/width to an ending height/width.

Specified by:
scale in interface Fx
Parameters:
width - The new width
height - The new height
config - the Fx config
Returns:
this

sequenceFx

public Fx sequenceFx()
Description copied from interface: Fx
Ensures that all effects queued after sequenceFx is called on the element are run in sequence. This is the opposite of syncFx.

Specified by:
sequenceFx in interface Fx
Returns:
this

shift

public Fx shift(int x,
                int y,
                int width,
                int height,
                FxConfig config)
Description copied from interface: Fx
Animates the transition of any combination of an element's dimensions, xy position and/or opacity. Any of these properties not specified in the config object will not be changed. This effect requires that at least one new dimension, position or opacity setting must be passed in on the config object in order for the function to have any effect.

Specified by:
shift in interface Fx
Parameters:
x - X postionion
y - Y position
width - the new width
height - the new height
config - the Fx config
Returns:
this

slideIn

public Fx slideIn()
Description copied from interface: Fx
Slides the element into view. An anchor point can be optionally passed to set the point of origin for the slide effect. This function automatically handles wrapping the element with a fixed-size container if needed. Slides in from top by default.

Specified by:
slideIn in interface Fx
Returns:
this

slideIn

public Fx slideIn(java.lang.String anchorPosition,
                  FxConfig config)
Description copied from interface: Fx
Slides the element into view. An anchor point can be optionally passed to set the point of origin for the slide effect. This function automatically handles wrapping the element with a fixed-size container if needed.

Specified by:
slideIn in interface Fx
Parameters:
anchorPosition - the anchor position
config - the Fx config
Returns:
this

slideOut

public Fx slideOut()
Description copied from interface: Fx
Slides the element out of view. An anchor point can be optionally passed to set the end point for the slide effect. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. This function automatically handles wrapping the element with a fixed-size container if needed.

Specified by:
slideOut in interface Fx
Returns:
this

slideOut

public Fx slideOut(boolean remove,
                   java.lang.String anchorPosition,
                   FxConfig config)
Description copied from interface: Fx
Slides the element out of view. An anchor point can be optionally passed to set the end point for the slide effect. When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. This function automatically handles wrapping the element with a fixed-size container if needed.

Specified by:
slideOut in interface Fx
Parameters:
remove - true to remove element from the DOM
anchorPosition - the anchor position
config - the Fx config
Returns:
this

stopFx

public Fx stopFx()
Description copied from interface: Fx
Stops any running effects and clears the element's internal effects queue if it contains any additional effects that haven't started yet.

Specified by:
stopFx in interface Fx
Returns:
this

switchOff

public Fx switchOff()
Description copied from interface: Fx
Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television). When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document.

Specified by:
switchOff in interface Fx
Returns:
this

switchOff

public Fx switchOff(boolean remove,
                    FxConfig config)
Description copied from interface: Fx
Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television). When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still take up space in the document.

Specified by:
switchOff in interface Fx
Parameters:
remove - true to remove element from the DOM
config - the Fx config
Returns:
this

syncFx

public Fx syncFx()
Description copied from interface: Fx
Ensures that all effects queued after syncFx is called on the element are run concurrently. This is the opposite of sequenceFx.

Specified by:
syncFx in interface Fx
Returns:
this