]> source.dussan.org Git - vaadin-framework.git/commitdiff
TabSheet example in Book examples.
authorMarko Grönroos <magi@iki.fi>
Wed, 27 May 2009 12:30:44 +0000 (12:30 +0000)
committerMarko Grönroos <magi@iki.fi>
Wed, 27 May 2009 12:30:44 +0000 (12:30 +0000)
svn changeset:8031/svn branch:6.0

src/com/vaadin/tests/book/BookTestApplication.java

index e0a6309f795a6f13c4acc3d27d52d68cacbcb009..9d116edbcdbbc94b178a34c749fa7419f2c7f925 100644 (file)
@@ -1022,7 +1022,22 @@ public class BookTestApplication extends com.vaadin.Application {
        }
 
        void example_TabSheet(Window main, String param) {
-               if (param.equals("icon")) {
+        if (param.equals("simple")) {
+            // Create an empty tab sheet.
+            TabSheet tabsheet = new TabSheet();
+            
+            // Create a component to put in a tab and put
+            // some content in it.
+            VerticalLayout myTab = new VerticalLayout();
+            myTab.addComponent(new Label("Hello, I am a Tab!"));
+            
+            // Add the component to the tab sheet as a new tab.
+            tabsheet.addTab(myTab);
+            
+            // Get the Tab holding the component and set its caption.
+            tabsheet.getTab(myTab).setCaption("My Tab");
+
+        } else if (param.equals("icon")) {
                        final TabSheet tabsheet = new TabSheet();
 
                        tabsheet.addTab(new Label("Contents of the first tab"),