]> source.dussan.org Git - vaadin-framework.git/commitdiff
#8203 Improved javadoc, added null check
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Thu, 12 Apr 2012 15:26:30 +0000 (15:26 +0000)
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>
Thu, 12 Apr 2012 15:26:30 +0000 (15:26 +0000)
svn changeset:23504/svn branch:6.8

src/com/vaadin/ui/TabSheet.java

index 334c4c886bf2d1ff206dfe0704896426d7e51c76..09d1002b484a6de6400b4d277d4b70d2e7170bd9 100644 (file)
@@ -557,7 +557,8 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
      * 
      * @param c
      *            the component
-     * @return
+     * @return The tab instance associated with the given component, or null if
+     *         the tabsheet does not contain the component.
      */
     public Tab getTab(Component c) {
         return tabs.get(c);
@@ -603,17 +604,19 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
      * @param tab
      */
     public void setSelectedTab(Tab tab) {
-        setSelectedTab(tab.getComponent());
+        if (tab != null) {
+            setSelectedTab(tab.getComponent());
+        }
     }
 
     /**
-     * Sets the selected tab, identified by its position. Does nothing if
-     * <code>index &lt; 0 || index &gt; {@link #getComponentCount()}</code>.
+     * Sets the selected tab, identified by its position. Does nothing if the
+     * position is out of bounds.
      * 
-     * @param index
+     * @param position
      */
-    public void setSelectedTab(int index) {
-        setSelectedTab(getTab(index));
+    public void setSelectedTab(int position) {
+        setSelectedTab(getTab(position));
     }
 
     /**