use of com.haulmont.cuba.gui.xml.layout.ComponentLoader in project cuba by cuba-platform.
the class TabSheetLoader method createComponent.
@Override
public void createComponent() {
resultComponent = (TabSheet) factory.createComponent(TabSheet.NAME);
loadId(resultComponent, element);
// noinspection unchecked
List<Element> tabElements = element.elements("tab");
for (Element tabElement : tabElements) {
final String name = tabElement.attributeValue("id");
boolean lazy = Boolean.parseBoolean(tabElement.attributeValue("lazy"));
ComponentLoader tabComponentLoader = getLoader(tabElement, TabComponentLoader.class);
TabSheet.Tab tab;
if (lazy) {
tab = resultComponent.addLazyTab(name, tabElement, tabComponentLoader);
} else {
tabComponentLoader.createComponent();
Component tabComponent = tabComponentLoader.getResultComponent();
tab = resultComponent.addTab(name, tabComponent);
pendingLoadComponents.add(tabComponentLoader);
}
pendingLoadTabs.put(tabElement, tab);
}
}
Aggregations