Search in sources :

Example 1 with Accordion

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);
    }
}
Also used : Accordion(com.haulmont.cuba.gui.components.Accordion) Element(org.dom4j.Element) Component(com.haulmont.cuba.gui.components.Component) ComponentLoader(com.haulmont.cuba.gui.xml.layout.ComponentLoader)

Aggregations

Accordion (com.haulmont.cuba.gui.components.Accordion)1 Component (com.haulmont.cuba.gui.components.Component)1 ComponentLoader (com.haulmont.cuba.gui.xml.layout.ComponentLoader)1 Element (org.dom4j.Element)1