diff options
author | Marko Grönroos <magi@iki.fi> | 2008-10-31 13:03:02 +0000 |
---|---|---|
committer | Marko Grönroos <magi@iki.fi> | 2008-10-31 13:03:02 +0000 |
commit | bef8786d88f8fea4cdd43985c67b48a8cd200416 (patch) | |
tree | 12c93f92b2f5cc407a7ef50ea12a15bc9a77b3ec /src/com/itmill/toolkit/tests/book/BookTestApplication.java | |
parent | 9cfca00027b228290d252b91e1274438f01ea140 (diff) | |
download | vaadin-framework-bef8786d88f8fea4cdd43985c67b48a8cd200416.tar.gz vaadin-framework-bef8786d88f8fea4cdd43985c67b48a8cd200416.zip |
Better book example for RichTextArea.
svn changeset:5786/svn branch:trunk
Diffstat (limited to 'src/com/itmill/toolkit/tests/book/BookTestApplication.java')
-rw-r--r-- | src/com/itmill/toolkit/tests/book/BookTestApplication.java | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/com/itmill/toolkit/tests/book/BookTestApplication.java b/src/com/itmill/toolkit/tests/book/BookTestApplication.java index db84225e07..d9a2d4b79e 100644 --- a/src/com/itmill/toolkit/tests/book/BookTestApplication.java +++ b/src/com/itmill/toolkit/tests/book/BookTestApplication.java @@ -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) { |