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:
09: package com.gwtext.client.util;
10:
11: import com.google.gwt.core.client.JavaScriptObject;
12: import com.gwtext.client.core.JsObject;
13:
14: /**
15: * CSS Rule class.
16: */
17: public class CSSRule extends JsObject {
18:
19: /**
20: * Constructs a new rule using a native object.
21: *
22: * @param jsObj the native object
23: */
24: public CSSRule(JavaScriptObject jsObj) {
25: super (jsObj);
26: }
27:
28: private static CSSRule instance(JavaScriptObject jsObj) {
29: return new CSSRule(jsObj);
30: }
31:
32: /**
33: * The CSS text.
34: *
35: * @return css text
36: */
37: public native String getCssText() /*-{
38: var rule = this.@com.gwtext.client.core.JsObject::getJsObj()();
39: return rule.cssText;
40: }-*/;
41:
42: /**
43: * Returns the parent rule.
44: *
45: * @return the parent rule
46: */
47: public native CSSRule getParentRule()/*-{
48: var rule = this.@com.gwtext.client.core.JsObject::getJsObj()();
49: var parentRule = rule.parentRule;
50: if(parentRule == null || parentRule === undefined) {
51: return null;
52: } else {
53: return @com.gwtext.client.util.CSSRule::instance(Lcom/google/gwt/core/client/JavaScriptObject;)(parentRule);
54: }
55: }-*/;
56: }
|