From 474ede0ea660ea7fb245ec4c0fee11cddcbda44f Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Mon, 18 Jul 2011 15:31:04 +0000 Subject: [PATCH] #7128 Add TabSheet.addTab(Component,String) svn changeset:19827/svn branch:6.7 --- src/com/vaadin/ui/TabSheet.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/com/vaadin/ui/TabSheet.java b/src/com/vaadin/ui/TabSheet.java index 956eb6f97f..8a1fd43b9a 100644 --- a/src/com/vaadin/ui/TabSheet.java +++ b/src/com/vaadin/ui/TabSheet.java @@ -195,6 +195,26 @@ public class TabSheet extends AbstractComponentContainer { addTab(c); } + /** + * Adds a new tab into TabSheet. + * + * The first tab added to a tab sheet is automatically selected and a tab + * selection event is fired. + * + * If the component is already present in the tab sheet, changes its caption + * and returns the corresponding (old) tab, preserving other tab metadata. + * + * @param c + * the component to be added onto tab - should not be null. + * @param caption + * the caption to be set for the component and used rendered in + * tab bar + * @return the created {@link Tab} + */ + public Tab addTab(Component c, String caption) { + return addTab(c, caption, null); + } + /** * Adds a new tab into TabSheet. * -- 2.39.5