Changeset 5106
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebContent/ITMILL/themes/tests-book/styles.css
r4719 r5106 10 10 11 11 /*****************************************************************************/ 12 /* For example_Tree() */ 12 /* For example_Table() */ 13 /*****************************************************************************/ 14 /* Table rows contain three-row TextField components. */ 15 .i-table-components-inside .i-table-cell-content { 16 height: 54px; /* 3*18px = 54px. */ 17 } 18 19 /*****************************************************************************/ 20 /* For example_Tree() */ 13 21 /*****************************************************************************/ 14 22 -
trunk/src/com/itmill/toolkit/tests/book/BookTestApplication.java
r5100 r5106 57 57 import com.itmill.toolkit.ui.Window; 58 58 import com.itmill.toolkit.ui.Button.ClickEvent; 59 import com.itmill.toolkit.ui.Window.Notification; 59 60 60 61 public class BookTestApplication extends com.itmill.toolkit.Application { … … 140 141 "progress/window", "progress/thread", "progress", 141 142 "customlayout", "spacing", "margin", "clientinfo", 142 "fillinform/templates" };143 "fillinform/templates", "notification", "print"}; 143 144 for (int i = 0; i < examples.length; i++) { 144 145 main.addComponent(new Label("<a href='" + context.toString() + … … 215 216 } else if (example.equals("fillinform")) { 216 217 example_FillInForm(main, param); 218 } else if (example.equals("notification")) { 219 example_Notification(main, param); 220 } else if (example.equals("print")) { 221 example_Print(main, param); 217 222 } else { 218 223 ; // main.addComponent(new Label("Unknown test '"+example+"'.")); … … 1332 1337 } 1333 1338 } 1339 1340 void example_Notification(final Window main, String param) { 1341 final Window sub1 = new Window(""); 1342 main.addWindow(sub1); 1343 1344 sub1.showNotification("The default notification"); 1345 1346 //Notification notif = new Notification("Title"); 1347 } 1348 1349 void example_Print(final Window main, String param) { 1350 if (param != null && param.equals("simple")) { 1351 main.addComponent(new Label("<input type='button' onClick='print()' value='Click to Print'/>", Label.CONTENT_XHTML)); 1352 return; 1353 } 1354 1355 // A button to open the printer-friendly page. 1356 Button printButton = new Button("Click to Print"); 1357 main.addComponent(printButton); 1358 printButton.addListener(new Button.ClickListener() { 1359 public void buttonClick(ClickEvent event) { 1360 // Create a window that contains stuff you want to print. 1361 Window printWindow = new Window("Window to Print"); 1362 1363 // Have some content to print. 1364 printWindow.addComponent(new Label("Here's some dynamic content.")); 1365 1366 // To execute the print() JavaScript, we need to run it 1367 // from a custom layout. 1368 CustomLayout scriptLayout = new CustomLayout("printpage"); 1369 printWindow.addComponent (scriptLayout); 1370 1371 // Add the printing window as an application-level window. 1372 main.getApplication().addWindow(printWindow); 1373 1374 // Open the printing window as a new browser window 1375 main.open(new ExternalResource(printWindow.getURL()), "_new"); 1376 } 1377 }); 1378 1379 //main.addComponent(new Label("<p>Print this!</p>\n<script type='text/javascript'>print();</script>", Label.CONTENT_XHTML)); 1380 } 1334 1381 }
