From 6a1c4b4b348112a2f176403780b0e4dd6160df91 Mon Sep 17 00:00:00 2001 From: Johannes Dahlström Date: Thu, 12 Apr 2012 15:26:30 +0000 Subject: #8203 Improved javadoc, added null check svn changeset:23504/svn branch:6.8 --- src/com/vaadin/ui/TabSheet.java | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java index 334c4c886b..09d1002b48 100644 --- a/src/com/vaadin/ui/TabSheet.java +++ b/src/com/vaadin/ui/TabSheet.java @@ -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 - * index < 0 || index > {@link #getComponentCount()}. + * 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)); } /** -- cgit v1.2.3