From: Marko Grönroos Date: Fri, 31 Oct 2008 13:03:02 +0000 (+0000) Subject: Better book example for RichTextArea. X-Git-Tag: 6.7.0.beta1~3886 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bef8786d88f8fea4cdd43985c67b48a8cd200416;p=vaadin-framework.git Better book example for RichTextArea. svn changeset:5786/svn branch:trunk --- 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 index 0000000000..4bb791c856 Binary files /dev/null and b/WebContent/ITMILL/themes/tests-book/img/richtextarea-toolbar-fi.png differ diff --git a/WebContent/ITMILL/themes/tests-book/styles.css b/WebContent/ITMILL/themes/tests-book/styles.css index 9ec120b767..43e609da71 100644 --- a/WebContent/ITMILL/themes/tests-book/styles.css +++ b/WebContent/ITMILL/themes/tests-book/styles.css @@ -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; +} 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("

Print this!

\n", 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("

Hello

\n

This contains some text.

"); + rtarea.setValue("

Hello

\n

This rich text area contains some text.

"); // 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) {