]> source.dussan.org Git - vaadin-framework.git/commitdiff
Better book example for RichTextArea.
authorMarko Grönroos <magi@iki.fi>
Fri, 31 Oct 2008 13:03:02 +0000 (13:03 +0000)
committerMarko Grönroos <magi@iki.fi>
Fri, 31 Oct 2008 13:03:02 +0000 (13:03 +0000)
svn changeset:5786/svn branch:trunk

WebContent/ITMILL/themes/tests-book/img/richtextarea-toolbar-fi.png [new file with mode: 0644]
WebContent/ITMILL/themes/tests-book/styles.css
src/com/itmill/toolkit/tests/book/BookTestApplication.java

diff --git a/WebContent/ITMILL/themes/tests-book/img/richtextarea-toolbar-fi.png b/WebContent/ITMILL/themes/tests-book/img/richtextarea-toolbar-fi.png
new file mode 100644 (file)
index 0000000..4bb791c
Binary files /dev/null and b/WebContent/ITMILL/themes/tests-book/img/richtextarea-toolbar-fi.png differ
index 9ec120b76779b27331e1359cf667fbd09546f9e3..43e609da71ff21db16ef26ff1c23c511c16819bd 100644 (file)
@@ -146,7 +146,7 @@ table.i-gridlayout-spacingexample {
 }
 
 .i-gridlayout-spacingexample td {
-    background: white;
+   background: white;
 }
 
 /*****************************************************************************/
@@ -165,3 +165,10 @@ table.i-gridlayout-spacingexample {
 .i-orderedlayout-marginexample1 { background: #d0d0ff; border: 1px;}
 .i-orderedlayout-marginexample2 { background: #ffd0d0; border: 1px;}
 .i-orderedlayout-marginexample table { background: white; }
+
+/*****************************************************************************/
+/* For example_RichTextArea()                                                */
+/*****************************************************************************/
+.i-richtextarea-richtextexample .gwt-ToggleButton .gwt-Image {
+  background-image: url(img/richtextarea-toolbar-fi.png) !important;
+}
index db84225e0712e776feb5d6b3915898a01ba369da..d9a2d4b79e501e751422ab2750ae6491fb51db89 100644 (file)
@@ -227,7 +227,7 @@ public class BookTestApplication extends com.itmill.toolkit.Application {
             } else if (example.equals("print")) {
                 example_Print(main, param);
             } else if (example.equals("richtextfield")) {
-                example_RichTextField(main, param);
+                example_RichTextArea(main, param);
             } else if (example.equals("querycontainer")) {
                 example_QueryContainer(main, param);
             } else if (example.equals("menubar")) {
@@ -1414,12 +1414,16 @@ public class BookTestApplication extends com.itmill.toolkit.Application {
         //main.addComponent(new Label("<p>Print this!</p>\n<script type='text/javascript'>print();</script>", Label.CONTENT_XHTML));
     }
 
-    void example_RichTextField(final Window main, String param) {
-        // Create the rich text area
+    void example_RichTextArea(final Window main, String param) {
+        main.setLayout(new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL));
+        
+        // Create a rich text area
         final RichTextArea rtarea = new RichTextArea();
+        rtarea.addStyleName("richtextexample");
+        //rtarea.setCaption("My Rich Text Area");
         
         // Set initial content as HTML
-        rtarea.setValue("<h1>Hello</h1>\n<p>This contains some text.</p>");
+        rtarea.setValue("<h1>Hello</h1>\n<p>This rich text area contains some text.</p>");
         
         // Show the text edited in the rich text area as HTML.
         final Button show = new Button("Show HTML");
@@ -1430,9 +1434,15 @@ public class BookTestApplication extends com.itmill.toolkit.Application {
             }
         });
 
-        main.addComponent(rtarea);
-        main.addComponent(show);
-        main.addComponent(html);
+        Panel rtPanel = new Panel("Rich Text Area");
+        rtPanel.addComponent(rtarea);
+        rtPanel.addComponent(show);
+
+        Panel valuePanel = new Panel("Value");
+        valuePanel.addComponent(html);
+        
+        main.addComponent(rtPanel);
+        main.addComponent(valuePanel);
     }
 
     void example_QueryContainer(final Window main, String param) {