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.gwtext.client.core.BaseConfig;
11: import com.gwtext.client.core.DomConfig;
12: import com.gwtext.client.util.JavaScriptObjectHelper;
13:
14: /**
15: * Configuration class for a Layer.
16: */
17: public class LayerConfig extends BaseConfig {
18:
19: /**
20: * CSS class to add to the element.
21: *
22: * @param cls the CSS class
23: */
24: public void setCls(String cls) {
25: JavaScriptObjectHelper.setAttribute(jsObj, "cls", cls);
26: }
27:
28: /**
29: * False to disable constrain to viewport (defaults to true)
30: *
31: * @param constrain true to constrain
32: */
33: public void setConstrain(boolean constrain) {
34: JavaScriptObjectHelper.setAttribute(jsObj, "constrain",
35: constrain);
36: }
37:
38: /**
39: * {@link com.gwtext.client.core.DomHelper} object config to create element with (defaults to {tag: "div", cls: "x-layer"}).
40: *
41: * @param domConfig the dom config
42: */
43: public void setDomConfig(DomConfig domConfig) {
44: JavaScriptObjectHelper.setAttribute(jsObj, "dh", domConfig
45: .getJsObject());
46: }
47:
48: /**
49: * True to create a shadow element with default class "x-layer-shadow". False turns off the shadow.
50: *
51: * @param shadow true to create shadow
52: */
53: public void setShadow(boolean shadow) {
54: JavaScriptObjectHelper.setAttribute(jsObj, "shadow", shadow);
55: }
56:
57: /**
58: * Pass a string with a shadow CSS class name.
59: *
60: * @param shadowCls shadow class
61: */
62: public void setShadowCls(String shadowCls) {
63: JavaScriptObjectHelper.setAttribute(jsObj, "shadow", shadowCls);
64: }
65:
66: /**
67: * Number of pixels to offset the shadow (defaults to 3).
68: *
69: * @param shadowOffest offset in pixels
70: */
71: public void setShadowOffest(int shadowOffest) {
72: JavaScriptObjectHelper.setAttribute(jsObj, "shadowOffest",
73: shadowOffest);
74: }
75:
76: /**
77: * False to disable the iframe shim in browsers which need one (defaults to true).
78: *
79: * @param shim false to disable shim
80: */
81: public void setShim(boolean shim) {
82: JavaScriptObjectHelper.setAttribute(jsObj, "shim", shim);
83: }
84:
85: /**
86: * Starting z-index (defaults to 11000).
87: *
88: * @param zindex the z-index
89: */
90: public void setZindex(int zindex) {
91: JavaScriptObjectHelper.setAttribute(jsObj, "zindex", zindex);
92: }
93: }
|