Show
Ignore:
Timestamp:
07/22/08 08:33:43 (4 months ago)
Author:
magi@…
Message:

Updated book tests: RichTestArea?, Forms.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/com/itmill/toolkit/tests/book/BookTestApplication.java

    r5106 r5111  
    5050import com.itmill.toolkit.ui.PopupDateField; 
    5151import com.itmill.toolkit.ui.ProgressIndicator; 
     52import com.itmill.toolkit.ui.RichTextArea; 
    5253import com.itmill.toolkit.ui.Select; 
    5354import com.itmill.toolkit.ui.TabSheet; 
     
    141142                        "progress/window", "progress/thread", "progress", 
    142143                        "customlayout", "spacing", "margin", "clientinfo", 
    143                         "fillinform/templates", "notification", "print"}; 
     144                        "fillinform/templates", "notification", "print", 
     145                        "richtextfield"}; 
    144146                for (int i = 0; i < examples.length; i++) { 
    145147                    main.addComponent(new Label("<a href='" + context.toString() + 
     
    220222            } else if (example.equals("print")) { 
    221223                example_Print(main, param); 
     224            } else if (example.equals("richtextfield")) { 
     225                example_RichTextField(main, param); 
    222226            } else { 
    223227                ; // main.addComponent(new Label("Unknown test '"+example+"'.")); 
     
    13791383        //main.addComponent(new Label("<p>Print this!</p>\n<script type='text/javascript'>print();</script>", Label.CONTENT_XHTML)); 
    13801384    } 
     1385 
     1386    void example_RichTextField(final Window main, String param) { 
     1387        // Create the rich text area 
     1388        final RichTextArea rtarea = new RichTextArea(); 
     1389         
     1390        // Set initial content as HTML 
     1391        rtarea.setValue("<h1>Hello</h1>\n<p>This contains some text.</p>"); 
     1392         
     1393        // Show the text edited in the rich text area as HTML. 
     1394        final Button show = new Button("Show HTML"); 
     1395        final Label html = new Label((String) rtarea.getValue()); 
     1396        show.addListener(new Button.ClickListener() { 
     1397            public void buttonClick(ClickEvent event) { 
     1398                html.setValue(rtarea.getValue()); 
     1399            } 
     1400        }); 
     1401 
     1402        main.addComponent(rtarea); 
     1403        main.addComponent(show); 
     1404        main.addComponent(html); 
     1405    } 
    13811406}