View Javadoc

1   /*
2    * Copyright 2006 Robert Hanson <iamroberthanson AT gmail.com>
3    * 
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * 
8    *    http://www.apache.org/licenses/LICENSE-2.0
9    * 
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  
17  package org.gwtwidgets.client.ext;
18  
19  import org.gwtwidgets.client.ext.impl.ExtDOMImpl;
20  import com.google.gwt.core.client.GWT;
21  import com.google.gwt.user.client.DOM;
22  import com.google.gwt.user.client.Element;
23  
24  
25  public class ExtDOM extends DOM
26  {
27      private static ExtDOMImpl impl;
28      static {
29          impl = (ExtDOMImpl) GWT.create(ExtDOMImpl.class);
30      }
31  
32  
33  
34      public static Element createElementNS (Namespace ns, String tag)
35      {
36          return impl.createElementNS(ns, tag);
37      }
38  
39      /***
40       * Set a namespace attr, using the namespace of the element.
41       */
42      public static void setAttributeNS (Element elem, String attr, String value)
43      {
44          impl.setAttributeNS(elem, attr, value);
45      }
46  
47      /***
48       * Set a namespace attr, using the namespace of the element.
49       */
50      public static void setIntAttributeNS (Element elem, String attr, int value)
51      {
52          setAttributeNS(elem, attr, Integer.toString(value));
53      }
54  
55  
56      public static void setAttributeNS (Namespace ns, Element elem, String attr, String value)
57      {
58          impl.setAttributeNS(ns, elem, attr, value);
59      }
60  
61  }