Search in sources :

Example 1 with CubaTreeTableState

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

the class CubaTreeTable method iterator.

@Override
@Nonnull
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.widgets.client.treetable.CubaTreeTableState) AbstractComponent(com.vaadin.ui.AbstractComponent) Component(com.vaadin.ui.Component) Nonnull(javax.annotation.Nonnull)

Aggregations

CubaTreeTableState (com.haulmont.cuba.web.widgets.client.treetable.CubaTreeTableState)1 AbstractComponent (com.vaadin.ui.AbstractComponent)1 Component (com.vaadin.ui.Component)1 Nonnull (javax.annotation.Nonnull)1