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.wwrapper;
18  
19  import com.google.gwt.user.client.DOM;
20  import com.google.gwt.user.client.Element;
21  import com.google.gwt.user.client.ui.HTMLPanel;
22  
23  public class WPanel extends HTMLPanel implements WrappedWidget
24  {
25      private static final String WIDGET_TYPE = "panel";
26  
27      
28      public WPanel (String id)
29          throws ElementNotFoundException
30      {
31          super("");
32  
33          Element e = DOM.getElementById(id);
34          if (e == null) {
35              throw new ElementNotFoundException(id);
36          }
37  
38          setElement(e);
39          WBuilder.resetElement(this);
40      }
41  
42      public WPanel (Element element)
43      {
44          super("");
45          setElement(element);
46          WBuilder.resetElement(this);
47      }
48  
49      public String getWidgetType ()
50      {
51          return WIDGET_TYPE;
52      }
53  
54  }