]> source.dussan.org Git - gwtquery.git/commitdiff
check on presence of a possible existing widget on element constituting the tab widge...
authorJulien Dramaix <julien.dramaix@gmail.com>
Sat, 5 Mar 2011 19:36:37 +0000 (19:36 +0000)
committerJulien Dramaix <julien.dramaix@gmail.com>
Sat, 5 Mar 2011 19:36:37 +0000 (19:36 +0000)
gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TabPanelWidgetFactory.java

index c1cf11a47124f163ffd64cbd221f07f28b75358c..ce9e90cfc15b1de27daf52853de5a5109f7e3fb1 100644 (file)
@@ -8,6 +8,7 @@ import com.google.gwt.user.client.ui.Button;
 import com.google.gwt.user.client.ui.HTMLPanel;
 import com.google.gwt.user.client.ui.RootPanel;
 import com.google.gwt.user.client.ui.TabPanel;
+import com.google.gwt.user.client.ui.Widget;
 
 /**
  * Factory used to create a {@link Button} widget. A {@link Button} is created
@@ -85,7 +86,12 @@ public class TabPanelWidgetFactory implements WidgetFactory<TabPanel> {
       Element tab = tabs.get(i);
       Element title = titles.get(i);
 
-      tabPanel.add(new HTMLPanel(tab.getString()), title != null
+      Widget tabWidget = $(tab).widget();
+      if (tabWidget == null){
+        tabWidget = new HTMLPanel(tab.getString());
+      }
+      
+      tabPanel.add(tabWidget, title != null
           ? title.getInnerText() : "Tab " + (i + 1));
 
     }