} else if (model instanceof PageBody) {
UIPageBody uiPageBody = uiContainer.createUIComponent(context, UIPageBody.class, null, null);
uiPageBody.setStorageId(((PageBody) model).getStorageId());
uiComponent = uiPageBody;
} else if (model instanceof Application) {
Application application = (Application) model;
if (dashboard && application.getType() == ApplicationType.GADGET) {
Application<Gadget> ga = (Application<Gadget>) application;
UIGadget uiGadget = uiContainer.createUIComponent(context, UIGadget.class, null, null);
uiGadget.setStorageId(application.getStorageId());
toUIGadget(uiGadget, ga);
uiComponent = uiGadget;
} else {
UIPortlet uiPortlet = uiContainer.createUIComponent(context, UIPortlet.class, null, null);
uiPortlet.setStorageId(application.getStorageId());
if (application.getStorageName() != null) {
uiPortlet.setStorageName(application.getStorageName());
}
toUIPortlet(uiPortlet, application);
uiComponent = uiPortlet;
}
} else if (model instanceof Container) {