Changeset 5111

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

Updated book tests: RichTestArea?, Forms.

Location:
trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebContent/ITMILL/themes/tests-book/styles.css

    r5106 r5111  
    88        background: white; 
    99} 
     10 
     11/*****************************************************************************/ 
     12/* For example_Forms()                                                       */ 
     13/*****************************************************************************/ 
     14.i-form { 
     15    border: thin solid; 
     16    padding: 5px 5px 5px 5px; 
     17} 
     18 
    1019 
    1120/*****************************************************************************/ 
  • 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} 
  • trunk/src/com/itmill/toolkit/tests/book/FormExample.java

    r5072 r5111  
    211211 
    212212        // The Commit button calls form.commit(). 
    213         Button commit = new Button("Commit"); 
    214         commit.addListener(new Button.ClickListener() { 
     213        Button commit = new Button("Commit", form, "commit"); 
     214        /*commit.addListener(new Button.ClickListener() { 
    215215            public void buttonClick(ClickEvent event) { 
    216216                form.setValidationVisible(true); 
    217217                form.commit(); 
    218218            } 
    219         }); 
     219        });*/ 
    220220 
    221221        // The Discard button calls form.discard().