Search in sources :

Example 1 with CubaTreeTableState

use of com.haulmont.cuba.web.toolkit.ui.client.treetable.CubaTreeTableState in project cuba by cuba-platform.

the class CubaTreeTable method iterator.

@Override
public Iterator<Component> iterator() {
    List<Component> additionalConnectors = null;
    CubaTreeTableState tableState = getState(false);
    if (tableState.presentations != null) {
        additionalConnectors = new LinkedList<>();
        additionalConnectors.add((Component) tableState.presentations);
    }
    if (tableState.contextMenu != null) {
        if (additionalConnectors == null) {
            additionalConnectors = new LinkedList<>();
        }
        additionalConnectors.add((Component) tableState.contextMenu);
    }
    if (tableState.customPopup != null) {
        if (additionalConnectors == null) {
            additionalConnectors = new LinkedList<>();
        }
        additionalConnectors.add((Component) tableState.customPopup);
    }
    if (additionalConnectors == null) {
        return super.iterator();
    } else if (visibleComponents != null) {
        return Iterables.concat(visibleComponents, additionalConnectors).iterator();
    } else {
        return additionalConnectors.iterator();
    }
}
Also used : CubaTreeTableState(com.haulmont.cuba.web.toolkit.ui.client.treetable.CubaTreeTableState) AbstractComponent(com.vaadin.ui.AbstractComponent) Component(com.vaadin.ui.Component)

Aggregations

CubaTreeTableState (com.haulmont.cuba.web.toolkit.ui.client.treetable.CubaTreeTableState)1 AbstractComponent (com.vaadin.ui.AbstractComponent)1 Component (com.vaadin.ui.Component)1