01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08: package com.gwtext.client.widgets;
09:
10: import com.google.gwt.core.client.JavaScriptObject;
11: import com.google.gwt.user.client.Element;
12: import com.gwtext.client.core.ExtElement;
13:
14: /**
15: * An extended {@link ExtElement} object that supports a shadow and shim, constrain to viewport and automatic maintaining of shadow/shim positions.
16: */
17: public class Layer extends ExtElement {
18:
19: /**
20: * Create a new Layer.
21: *
22: * @param config the layer config
23: */
24: public Layer(LayerConfig config) {
25: this (config, null);
26: }
27:
28: /**
29: * Create a new Layer.
30: *
31: * @param config the layer config
32: * @param existingEl an existing element
33: */
34: public Layer(LayerConfig config, Element existingEl) {
35: jsObj = create(config.getJsObj(), existingEl);
36: }
37:
38: public Layer(JavaScriptObject jsObj) {
39: super (jsObj);
40: }
41:
42: public static Layer instance(JavaScriptObject jsObj) {
43: return new Layer(jsObj);
44: }
45:
46: private static native JavaScriptObject create(
47: JavaScriptObject config, Element existingEl) /*-{
48: return new $wnd.Ext.Layer(config, existingEl);
49: }-*/;
50:
51: /**
52: * Sets the z-index of this layer and adjusts any shadow and shim z-indexes. The layer z-index is automatically
53: * incremented by two more than the value passed in so that it always shows above any shadow or shim (the shadow element,
54: * if any, will be assigned z-index + 1, and the shim element, if any, will be assigned the unmodified z-index).
55: *
56: * @param zindex the z index
57: */
58: public native void setZIndex(int zindex) /*-{
59: var layer = this.@com.gwtext.client.core.JsObject::getJsObj()();
60: layer.setZIndex(zindex);
61: }-*/;
62: }
|