com.extjs.gxt.ui.client.widget
Class Layer

java.lang.Object
  extended by com.extjs.gxt.ui.client.core.El
      extended by com.extjs.gxt.ui.client.widget.Layer

public class Layer
extends El

An extended El object that supports a shadow and shim, constrain to viewport and automatic maintaining of shadow/shim positions.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.extjs.gxt.ui.client.core.El
El.VisMode
 
Field Summary
 
Fields inherited from class com.extjs.gxt.ui.client.core.El
dom
 
Constructor Summary
Layer()
          Creates a new layer instance.
Layer(com.google.gwt.user.client.Element element)
          Creates a new layer instance wrapping the specified element.
 
Method Summary
 El alignTo(com.google.gwt.user.client.Element align, java.lang.String pos, int[] offsets)
          Aligns the element with another element relative to the specified anchor points.
 El createShim()
          Creates an iframe shim for this element to keep selects and other windowed objects from showing through.
 void destroy()
           
 void disableShadow()
          Disables the shadow.
 void enableShadow(boolean show)
          Enables the shadow.
 void enableShim()
          Enables the shim.
 El getShim()
          Returns the layer's shim.
 void hideShadow()
          Hides the layer's shadow.
 void hideShim()
          Hides the shim.
 El setHeight(int height)
          Sets the elements height.
 El setHeight(int height, boolean adjust)
          Sets the elements height.
 El setHeight(java.lang.String height)
          Sets the elements height.
 El setLeft(int left)
          Sets the element's left position directly using CSS style (instead of El.setX(int)).
 El setLeftTop(int left, int top)
          Quick set left and top adding default units.
 El setSize(int width, int height)
          Sets the element's size.
 El setSize(Size size)
          Sets the element's size.
 El setTop(int top)
          Sets the element's top position directly using CSS style (instead of El.setY(int)).
 El setVisibility(boolean visible)
          Sets the elements css 'visibility' property.
 El setVisible(boolean visible)
          Sets the visibility of the element (see details).
 El setWidth(int width)
          Sets the element's width.
 El setWidth(int width, boolean adjust)
          Sets the elements's width.
 El setWidth(java.lang.String width)
          Sets the element's width.
 El setX(int x)
          Sets the X position of the element based on page coordinates.
 El setXY(int x, int y)
          Sets the elements position in page coordinates.
 El setY(int y)
          Sets the Y position of the element based on page coordinates.
 void sync(boolean show)
          Syncs the shadow and shim.
 El updateZIndex(int adj)
          Sets the element's z-index using XDOM.getTopZIndex() to ensure it has the highest values.
 
Methods inherited from class com.extjs.gxt.ui.client.core.El
addEventsSunk, addStyleName, addUnits, adjustForConstraints, appendChild, applyStyles, blink, blur, boxWrap, center, center, center, child, childElement, childNode, click, clip, cloneNode, createChild, createChild, disable, disableContextMenu, disableTextSelection, down, enable, enableDisplayMode, fadeIn, fadeOut, fadeToggle, findParent, findParentElement, findParentNode, firstChild, fly, fly, focus, getAlignToXY, getAnchorXY, getBorderWidth, getBottom, getBounds, getBounds, getChild, getChildIndex, getClientHeight, getClientWidth, getComputedHeight, getComputedWidth, getFrameWidth, getHeight, getHeight, getId, getInnerHtml, getIntStyleAttribute, getLayoutBounds, getLeft, getLeft, getMargins, getOffsetsTo, getOuterHtml, getPadding, getParent, getRegion, getRight, getScrollLeft, getScrollTop, getSize, getSize, getStyleAttribute, getStyleHeight, getStyleName, getStyleSize, getStyleWidth, getSubChild, getTextWidth, getTop, getTop, getValue, getWidth, getWidth, getX, getXY, getY, getZIndex, hasStyleName, insertBefore, insertBefore, insertBefore, insertChild, insertChild, insertFirst, insertFirst, insertFirst, insertHtml, insertInto, insertInto, insertSibling, insertSibling, is, isConnected, isMasked, isVisibility, isVisible, isVisible, lastChild, load, makePositionable, makePositionable, mask, nextSibling, offsetsTo, query, remove, removeChild, removeChildren, removeFromParent, removeStyleName, replaceStyleName, scrollIntoView, scrollTo, scrollTo, select, selectNode, setBorders, setBounds, setBounds, setBounds, setBounds, setDisplayed, setDisplayed, setElementAttribute, setElementAttribute, setElementAttribute, setFocus, setIconStyle, setId, setInnerHtml, setIntElementProperty, setPadding, setPagePosition, setScrollLeft, setScrollTop, setSize, setSize, setStyleAttribute, setStyleAttribute, setStyleName, setStyleName, setStyleSize, setTabIndex, setTitle, setValue, setVisibilityMode, setXY, setXY, setZIndex, slideIn, slideOut, subChild, toString, unclip, unmask, unwrap, up, update, wrap
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Layer

public Layer()
Creates a new layer instance.


Layer

public Layer(com.google.gwt.user.client.Element element)
Creates a new layer instance wrapping the specified element.

Parameters:
element - the element
Method Detail

alignTo

public El alignTo(com.google.gwt.user.client.Element align,
                  java.lang.String pos,
                  int[] offsets)
Description copied from class: El
Aligns the element with another element relative to the specified anchor points. Two values from the table below should be passed 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:

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
 

Overrides:
alignTo in class El
Parameters:
align - the element to align to
pos - the position to align to
offsets - the offsets or null
Returns:
this

createShim

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

Returns:
the new shim element

destroy

public void destroy()

disableShadow

public void disableShadow()
Disables the shadow.


enableShadow

public void enableShadow(boolean show)
Enables the shadow.

Parameters:
show - true to show

enableShim

public void enableShim()
Enables the shim.


getShim

public El getShim()
Returns the layer's shim.

Returns:
the shim

hideShadow

public void hideShadow()
Hides the layer's shadow.


hideShim

public void hideShim()
Hides the shim.


setHeight

public El setHeight(int height)
Description copied from class: El
Sets the elements height.

Overrides:
setHeight in class El
Parameters:
height - the height
Returns:
this

setHeight

public El setHeight(int height,
                    boolean adjust)
Description copied from class: El
Sets the elements height.

Overrides:
setHeight in class El
Parameters:
height - the height
adjust - true to adjust for box model issues
Returns:
this

setHeight

public El setHeight(java.lang.String height)
Description copied from class: El
Sets the elements height.

Overrides:
setHeight in class El
Parameters:
height - the height
Returns:
this

setLeft

public El setLeft(int left)
Description copied from class: El
Sets the element's left position directly using CSS style (instead of El.setX(int)).

Overrides:
setLeft in class El
Parameters:
left - the left value
Returns:
this

setLeftTop

public El setLeftTop(int left,
                     int top)
Description copied from class: El
Quick set left and top adding default units.

Overrides:
setLeftTop in class El
Parameters:
left - the left value
top - the top value
Returns:
this

setSize

public El setSize(int width,
                  int height)
Description copied from class: El
Sets the element's size.

Overrides:
setSize in class El
Parameters:
width - the new width
height - the new height
Returns:
this

setSize

public El setSize(Size size)
Description copied from class: El
Sets the element's size.

Overrides:
setSize in class El
Parameters:
size - the size
Returns:
this

setTop

public El setTop(int top)
Description copied from class: El
Sets the element's top position directly using CSS style (instead of El.setY(int)).

Overrides:
setTop in class El
Parameters:
top - the top value
Returns:
this

setVisibility

public El setVisibility(boolean visible)
Description copied from class: El
Sets the elements css 'visibility' property. Behavior is different than using the 'display' property.

Overrides:
setVisibility in class El
Parameters:
visible - true to show, false to hide
Returns:
this

setVisible

public El setVisible(boolean visible)
Description copied from class: El
Sets the visibility of the element (see details). If the vis mode is set to DISPLAY, it will use the display property to hide the element, otherwise it uses visibility. The default is to hide and show using the DISPLAY property.

Overrides:
setVisible in class El
Parameters:
visible - whether the element is visible
Returns:
this

setWidth

public El setWidth(int width)
Description copied from class: El
Sets the element's width.

Overrides:
setWidth in class El
Parameters:
width - the new width
Returns:
this

setWidth

public El setWidth(int width,
                   boolean adjust)
Description copied from class: El
Sets the elements's width.

Overrides:
setWidth in class El
Parameters:
width - the new width
adjust - true to adjust for box model issues
Returns:
this

setWidth

public El setWidth(java.lang.String width)
Description copied from class: El
Sets the element's width.

Overrides:
setWidth in class El
Parameters:
width - the new width
Returns:
this

setX

public El setX(int x)
Description copied from class: El
Sets the X position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates.

Overrides:
setX in class El
Parameters:
x - the x coordinate
Returns:
this

setXY

public El setXY(int x,
                int y)
Description copied from class: El
Sets the elements position in page coordinates.

Overrides:
setXY in class El
Parameters:
x - the x coordinate
y - the y coordinate
Returns:
this

setY

public El setY(int y)
Description copied from class: El
Sets the Y position of the element based on page coordinates. Element must be part of the DOM tree to have page coordinates.

Overrides:
setY in class El
Parameters:
y - the y coordinate
Returns:
this

sync

public void sync(boolean show)
Syncs the shadow and shim.

Overrides:
sync in class El
Parameters:
show - true to show

updateZIndex

public El updateZIndex(int adj)
Description copied from class: El
Sets the element's z-index using XDOM.getTopZIndex() to ensure it has the highest values.

Overrides:
updateZIndex in class El
Parameters:
adj - the adjustment to be applied to the z-index value
Returns:
this