summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-04-12 15:26:30 +0000
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-04-12 15:26:30 +0000
commit6a1c4b4b348112a2f176403780b0e4dd6160df91 (patch)
tree770fdb70efa9698df8a008ed1846dd4e334c95c5
parent780c5d6be068cad400e39df6d6b3f5b533d0366c (diff)
downloadvaadin-framework-6a1c4b4b348112a2f176403780b0e4dd6160df91.tar.gz
vaadin-framework-6a1c4b4b348112a2f176403780b0e4dd6160df91.zip
#8203 Improved javadoc, added null check
svn changeset:23504/svn branch:6.8
-rw-r--r--src/com/vaadin/ui/TabSheet.java17
1 files 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
- * <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));
}
/**