Class Shadow

  extended by
      extended by
          extended by com.gwtext.client.widgets.BaseExtWidget
              extended by com.gwtext.client.widgets.Shadow
All Implemented Interfaces:

public class Shadow
extends BaseExtWidget

Simple class that can provide a shadow effect for any element. Note that the element MUST be absolutely positioned, and the shadow does not provide any shimming. This should be used only in simple cases -- for more advanced functionality that can also provide the same shadow effect, see the Layer class.

Nested Class Summary
static class Shadow.Type
Field Summary
static Shadow.Type DROP
          Shadow on bottom right.
static Shadow.Type FRAME
          For 4-way shadow
static Shadow.Type SIDES
          Shadow on sides (default)
Fields inherited from class com.gwtext.client.widgets.BaseExtWidget
Constructor Summary
Shadow(java.lang.String mode, java.lang.String offset)
          Create a new Shadow.
Method Summary
 void hide()
          Hides this shadow.
 boolean isVisible()
          Returns true if the shadow is visible, else false.
 void realign(int left, int top, int width, int height)
          Direct alignment when values are already available.
 void setZIndex(int zindex)
          Adjust the z-index of this shadow.
 void show( element)
          Displays the shadow under the target element.
 void show(java.lang.String id)
          Displays the shadow under the target element.
Methods inherited from class com.gwtext.client.widgets.BaseExtWidget
equals, getEl, getElement, getJsObj, getOffsetHeight, getOffsetWidth, getTitle, hashCode, onAttach, onLoad, purgeListeners, setHeight, setJsObj, setTitle, setVisible, setWidth, toString
Methods inherited from class
doAttachChildren, doDetachChildren, getParent, isAttached, onBrowserEvent, onDetach, onUnload, removeFromParent, setElement
Methods inherited from class
addStyleDependentName, addStyleName, getAbsoluteLeft, getAbsoluteTop, getElement, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, isVisible, removeStyleDependentName, removeStyleName, setPixelSize, setSize, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setVisible, sinkEvents, unsinkEvents
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait

Field Detail


public static Shadow.Type SIDES
Shadow on sides (default)


public static Shadow.Type FRAME
For 4-way shadow


public static Shadow.Type DROP
Shadow on bottom right.

Constructor Detail


public Shadow(java.lang.String mode,
              java.lang.String offset)
Create a new Shadow.

mode - The shadow display mode. Supports the following options: sides: Shadow displays on both sides and bottom only, frame: Shadow displays equally on all four sides, drop: Traditional bottom-right drop shadow (default)
offset - the number of pixels to offset the shadow from the element (defaults to 4)
Method Detail


public void hide()
Hides this shadow.


public boolean isVisible()
Returns true if the shadow is visible, else false.

isVisible in class BaseExtWidget
true if shadow visible


public void realign(int left,
                    int top,
                    int width,
                    int height)
Direct alignment when values are already available. show(java.lang.String) must be called at least once before calling this method to ensure it is initialized.

left - The target element left position
top - The target element top position
width - The target element width
height - The target element height


public void setZIndex(int zindex)
Adjust the z-index of this shadow.

zindex - The new z-index


public void show(java.lang.String id)
Displays the shadow under the target element.

id - the element ID


public void show( element)
Displays the shadow under the target element.

element - the element