/** * Creates the contents of the Widget. These are nested Widgets. * * @param widget The Widget to create the contents for */ @SuppressWarnings("unchecked") private void createContents(Widget widget) { for (Iterator it = template.getContents().iterator(); it.hasNext(); ) { WidgetTemplate wt = (WidgetTemplate) it.next(); WidgetFactory wf = new WidgetFactory(); Widget w = wf.create(wt); createEvents(w, wt); widget.getContents().add(w); } }