use of com.haulmont.cuba.gui.components.Accordion in project cuba by cuba-platform.
the class AccordionLoader method createComponent.
@Override
public void createComponent() {
resultComponent = (Accordion) factory.createComponent(Accordion.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);
Accordion.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