google-code-export / gwt-ext

Automatically exported from code.google.com/p/gwt-ext
0 stars 0 forks source link

TabPanel.getActiveTab() should return null if there are no active tabs. #47

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
This is the same as an earlier issue with getTab(String).
My fix looks like:

$ svn diff TabPanel.java 
Index: TabPanel.java
===================================================================
--- TabPanel.java       (revision 407)
+++ TabPanel.java       (working copy)
@@ -188,11 +188,13 @@
     }-*/;

     public TabPanelItem getActiveTab() {
-        return new TabPanelItem(getActiveTab(jsObj));
+        JavaScriptObject tab = getActiveTab(jsObj);
+        return tab == null ? null : new TabPanelItem(tab);
     }

     private native JavaScriptObject getActiveTab(JavaScriptObject tp) /*-{
-        return tp.getActiveTab();
+        var tab = tp.getActiveTab();
+        return tab ? tab : null;
     }-*/;

Original issue reported on code.google.com by asgill...@gmail.com on 1 Aug 2007 at 4:45

GoogleCodeExporter commented 9 years ago

Original comment by sanjiv.j...@gmail.com on 1 Aug 2007 at 12:53