Search in sources :

Example 6 with BeanKey

use of org.jowidgets.cap.common.tools.bean.BeanKey in project jo-client-platform by jo-source.

the class BeanRelationNodeModelImpl method getParentBeanKeys.

private List<IBeanKey> getParentBeanKeys() {
    if (parentBean != null && !parentBean.isTransient() && !parentBean.isDummy()) {
        final List<IBeanKey> result = new LinkedList<IBeanKey>();
        result.add(new BeanKey(parentBean.getId(), parentBean.getVersion()));
        return result;
    } else {
        return Collections.emptyList();
    }
}
Also used : BeanKey(org.jowidgets.cap.common.tools.bean.BeanKey) IBeanKey(org.jowidgets.cap.common.api.bean.IBeanKey) IBeanKey(org.jowidgets.cap.common.api.bean.IBeanKey) LinkedList(java.util.LinkedList)

Example 7 with BeanKey

use of org.jowidgets.cap.common.tools.bean.BeanKey in project jo-client-platform by jo-source.

the class BeanTableModelImpl method getParentBeanKeys.

@Override
public List<IBeanKey> getParentBeanKeys() {
    if (parent == null) {
        return null;
    }
    final IBeanSelection<Object> beanSelection = parent.getBeanSelection();
    List<IBeanProxy<Object>> selection = beanSelection.getSelection();
    if (EmptyCheck.isEmpty(selection)) {
        return null;
    } else if (linkType == LinkType.SELECTION_FIRST) {
        selection = selection.subList(0, 1);
    }
    final List<IBeanKey> beanKeys = new LinkedList<IBeanKey>();
    for (final IBeanProxy<Object> proxy : selection) {
        if (proxy != null && !proxy.isDummy() && !proxy.isTransient() && !proxy.isLastRowDummy()) {
            beanKeys.add(new BeanKey(proxy.getId(), proxy.getVersion()));
        }
    }
    return beanKeys;
}
Also used : BeanKey(org.jowidgets.cap.common.tools.bean.BeanKey) IBeanKey(org.jowidgets.cap.common.api.bean.IBeanKey) IBeanKey(org.jowidgets.cap.common.api.bean.IBeanKey) LinkedList(java.util.LinkedList) IBeanProxy(org.jowidgets.cap.ui.api.bean.IBeanProxy)

Example 8 with BeanKey

use of org.jowidgets.cap.common.tools.bean.BeanKey in project jo-client-platform by jo-source.

the class SingleBeanModelImpl method getParentBeanKeys.

private List<IBeanKey> getParentBeanKeys() {
    if (parent == null) {
        return null;
    }
    final IBeanSelection<Object> beanSelection = parent.getBeanSelection();
    List<IBeanProxy<Object>> selection = beanSelection.getSelection();
    if (EmptyCheck.isEmpty(selection)) {
        return null;
    } else if (linkType == LinkType.SELECTION_FIRST) {
        selection = selection.subList(0, 1);
    }
    final List<IBeanKey> beanKeys = new LinkedList<IBeanKey>();
    for (final IBeanProxy<Object> proxy : selection) {
        if (proxy != null && !proxy.isDummy() && !proxy.isTransient()) {
            beanKeys.add(new BeanKey(proxy.getId(), proxy.getVersion()));
        }
    }
    return beanKeys;
}
Also used : BeanKey(org.jowidgets.cap.common.tools.bean.BeanKey) IBeanKey(org.jowidgets.cap.common.api.bean.IBeanKey) IBeanKey(org.jowidgets.cap.common.api.bean.IBeanKey) LinkedList(java.util.LinkedList) IBeanProxy(org.jowidgets.cap.ui.api.bean.IBeanProxy)

Aggregations

IBeanKey (org.jowidgets.cap.common.api.bean.IBeanKey)8 BeanKey (org.jowidgets.cap.common.tools.bean.BeanKey)8 ArrayList (java.util.ArrayList)4 LinkedList (java.util.LinkedList)4 List (java.util.List)4 IBeanDto (org.jowidgets.cap.common.api.bean.IBeanDto)4 IExecutorService (org.jowidgets.cap.common.api.service.IExecutorService)4 SyncResultCallback (org.jowidgets.cap.common.tools.execution.SyncResultCallback)4 Test (org.junit.Test)4 IBeanProxy (org.jowidgets.cap.ui.api.bean.IBeanProxy)3 HashMap (java.util.HashMap)1 Map (java.util.Map)1