summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-04-05 12:08:08 +0000
committerJohannes Dahlström <johannes.dahlstrom@vaadin.com>2012-04-05 12:08:08 +0000
commit35a223e3a3da7e1094cec585421898c8150e23c1 (patch)
tree2b1d7c2331582e782ba56d9dea53eebff20aca4e
parentf7feb7b15aae9abb360c799dc7bf873a0d5a68ef (diff)
downloadvaadin-framework-35a223e3a3da7e1094cec585421898c8150e23c1.tar.gz
vaadin-framework-35a223e3a3da7e1094cec585421898c8150e23c1.zip
#8203 Added TabSheet#setSelectedTab(int) and TabSheet#setSelectedTab(TabSheet.Tab)
svn changeset:23408/svn branch:6.8
-rw-r--r--src/com/vaadin/ui/TabSheet.java23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java
index 70fa95ba97..cb89c5e0c8 100644
--- a/src/com/vaadin/ui/TabSheet.java
+++ b/src/com/vaadin/ui/TabSheet.java
@@ -581,7 +581,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
/**
* Sets the selected tab. The tab is identified by the tab content
- * component.
+ * component. Does nothing if the tabsheet doesn't contain the component.
*
* @param c
*/
@@ -595,6 +595,27 @@ public class TabSheet extends AbstractComponentContainer implements Focusable,
}
/**
+ * Sets the selected tab. The tab is identified by the corresponding
+ * {@link Tab Tab} instance. Does nothing if the tabsheet doesn't contain
+ * the given tab.
+ *
+ * @param tab
+ */
+ public void setSelectedTab(Tab tab) {
+ setSelectedTab(tab.getComponent());
+ }
+
+ /**
+ * Sets the selected tab, identified by its position. Does nothing if
+ * <code>index &lt; 0 || index &gt; {@link #getComponentCount()}</code>.
+ *
+ * @param index
+ */
+ public void setSelectedTab(int index) {
+ setSelectedTab(getTab(index));
+ }
+
+ /**
* Checks if the current selection is valid, and updates the selection if
* the previously selected component is not visible and enabled. The first
* visible and enabled tab is selected if the current selection is empty or