From 22bb93bd782e34844b257c14aae0ca3496022754 Mon Sep 17 00:00:00 2001 From: Julien Dramaix Date: Sat, 5 Mar 2011 19:36:37 +0000 Subject: [PATCH] check on presence of a possible existing widget on element constituting the tab widget before to create a new one --- .../client/plugins/widgets/TabPanelWidgetFactory.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TabPanelWidgetFactory.java b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TabPanelWidgetFactory.java index c1cf11a4..ce9e90cf 100644 --- a/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TabPanelWidgetFactory.java +++ b/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/widgets/TabPanelWidgetFactory.java @@ -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 { 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)); } -- 2.39.5