Search in sources :

Example 1 with TabSheet

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

Aggregations

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