]> source.dussan.org Git - vaadin-framework.git/commitdiff
Updated book examples. Table examples, formatting.
authorMarko Grönroos <magi@iki.fi>
Fri, 29 Aug 2008 11:10:46 +0000 (11:10 +0000)
committerMarko Grönroos <magi@iki.fi>
Fri, 29 Aug 2008 11:10:46 +0000 (11:10 +0000)
svn changeset:5304/svn branch:trunk

WebContent/ITMILL/themes/tests-book/styles.css
src/com/itmill/toolkit/tests/book/BookTestApplication.java
src/com/itmill/toolkit/tests/book/TableExample.java
src/com/itmill/toolkit/tests/book/TableExample1.java

index c33cbb36f36a656379729ff2f3b65ec643b75274..9ec120b76779b27331e1359cf667fbd09546f9e3 100644 (file)
        height: 54px; /* 3*18px = 54px. */
 }
 
+/******************************************************************************
+ * For TableCellStyle.java.
+ ******************************************************************************/
+/* Center the text in header. */
+.i-table-header-cell {
+    text-align: center;
+}
+
+/* Basic style for all cells. */
+.i-table-checkerboard .i-table-cell-content {
+    text-align: center;
+    vertical-align: middle;
+    padding-top: 12px;
+    width: 20px;
+    height: 28px;
+}
+
+/* Style specifically for the row header cells. */
+.i-table-cell-content-rowheader {
+       background: #E7EDF3 url(../default/table/img/header-bg.png) repeat-x scroll 0 0;
+}
+
+/* Style specifically for the "white" cells. */
+.i-table-cell-content-white {
+    background: white;
+    color: black;
+}
+
+/* Style specifically for the "black" cells. */
+.i-table-cell-content-black {
+    background: black;
+    color: white;
+}
+
 /*****************************************************************************/
 /* For example_Tree()                                                        */
 /*****************************************************************************/
index e91841099b5b69ad7cea8f101ba1bdbcf3f194f2..db84225e0712e776feb5d6b3915898a01ba369da 100644 (file)
@@ -588,6 +588,12 @@ public class BookTestApplication extends com.itmill.toolkit.Application {
                 main.addComponent(new TableEditable());
             } else if (param.equals("bean")) {
                 main.addComponent(new TableEditableBean());
+            } else if (param.equals("long")) {
+                main.addComponent(new TableExample());
+            } else if (param.equals("cellstyle")) {
+                main.addComponent(new TableCellStyle());
+            } else if (param.equals("huge")) {
+                main.addComponent(new TableHuge());
             } else if (param.equals("paging")) {
                 PagingTable table = new PagingTable();
                 table.addContainerProperty("Column 1", String.class, null);
index cac01d204c82be4f10f5a49b1456b6db588764de..80c5dad3b0c3e418cd9456b893eced295c613cef 100644 (file)
@@ -26,19 +26,16 @@ public class TableExample extends CustomComponent {
         layout.addComponent(table);
 
         /* Define the names, data types, and default values of columns. */
-        table.addContainerProperty("First Name", String.class,
-                "(no first name)");
-        table.addContainerProperty("Last Name", String.class, "(no last name)");
-        table.addContainerProperty("Year", Integer.class, null);
+        table.addContainerProperty("First Name", String.class,  "(no first name)");
+        table.addContainerProperty("Last Name",  String.class,  "(no last name)");
+        table.addContainerProperty("Year",       Integer.class, null);
 
         /* We use these entries to generate random items in a table. */
-        final String[] firstnames = new String[] { "Donald", "Patty", "Sally",
-                "Douglas" };
-        final String[] lastnames = new String[] { "Smith", "Jones", "   Adams",
-                "Knuth" };
+        final String[] firstnames = new String[] { "Donald", "Patty", "Sally", "Douglas" };
+        final String[] lastnames  = new String[] { "Smith", "Jones", "Adams", "Knuth" };
 
         /* Add some items in the table and assign them an Item ID (IID). */
-        for (int i = 0; i < 500; i++) {
+        for (int i = 0; i < 1000; i++) {
             /* Add a randomly generated item in the Table. */
             table.addItem(new Object[] {
                         firstnames[(int) (Math.random() * (firstnames.length - 0.01))],
index 6b76a89df96df8891a2204eea238e0be0aedc278..52d1513394942a7216e2a4715e3b2b6121063605 100644 (file)
@@ -4,10 +4,7 @@
 
 package com.itmill.toolkit.tests.book;
 
-import com.itmill.toolkit.data.Property;
-import com.itmill.toolkit.data.Property.ValueChangeEvent;
 import com.itmill.toolkit.ui.CustomComponent;
-import com.itmill.toolkit.ui.Label;
 import com.itmill.toolkit.ui.OrderedLayout;
 import com.itmill.toolkit.ui.Table;