Search in sources :

Example 1 with CubaTableState

use of com.haulmont.cuba.web.toolkit.ui.client.table.CubaTableState in project cuba by cuba-platform.

the class CubaTable method iterator.

@Override
public Iterator<Component> iterator() {
    List<Component> additionalConnectors = null;
    CubaTableState 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 : CubaTableState(com.haulmont.cuba.web.toolkit.ui.client.table.CubaTableState) AbstractComponent(com.vaadin.ui.AbstractComponent) Component(com.vaadin.ui.Component)

Aggregations

CubaTableState (com.haulmont.cuba.web.toolkit.ui.client.table.CubaTableState)1 AbstractComponent (com.vaadin.ui.AbstractComponent)1 Component (com.vaadin.ui.Component)1