Search in sources :

Example 1 with IBeanRelationNodeModelBluePrint

use of org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModelBluePrint in project jo-client-platform by jo-source.

the class BeanRelationTreeModelImpl method getNode.

@Override
public <METHOD_PARENT_BEAN_TYPE, METHOD_CHILD_BEAN_TYPE> IBeanRelationNodeModel<METHOD_PARENT_BEAN_TYPE, METHOD_CHILD_BEAN_TYPE> getNode(final IEntityTypeId<METHOD_PARENT_BEAN_TYPE> parentEntityTypeId, final IBeanProxy<METHOD_PARENT_BEAN_TYPE> parentBean, final IEntityTypeId<METHOD_CHILD_BEAN_TYPE> childEntityTypeId) {
    final Tuple<IBeanProxy<METHOD_PARENT_BEAN_TYPE>, IEntityTypeId<METHOD_CHILD_BEAN_TYPE>> key;
    key = new Tuple<IBeanProxy<METHOD_PARENT_BEAN_TYPE>, IEntityTypeId<METHOD_CHILD_BEAN_TYPE>>(parentBean, childEntityTypeId);
    Object result = relationNodes.get(key);
    if (result == null) {
        final BeanRelationNodeModelBuilder<METHOD_PARENT_BEAN_TYPE, METHOD_CHILD_BEAN_TYPE, IBeanRelationNodeModelBluePrint<?, ?>> builder;
        builder = new BeanRelationNodeModelBuilder<METHOD_PARENT_BEAN_TYPE, METHOD_CHILD_BEAN_TYPE, IBeanRelationNodeModelBluePrint<?, ?>>(parentEntityTypeId, parentBean, childEntityTypeId);
        builder.setBeanProxyContext(beanProxyContext);
        nodeConfigurator.configureNode(childEntityTypeId, builder);
        final IBeanRelationNodeModel nodeModel = builder.build();
        registerListeners(nodeModel);
        result = nodeModel;
        relationNodes.put(key, result);
    }
    return (IBeanRelationNodeModel<METHOD_PARENT_BEAN_TYPE, METHOD_CHILD_BEAN_TYPE>) result;
}
Also used : IBeanRelationNodeModelBluePrint(org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModelBluePrint) IBeanRelationNodeModel(org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModel) IEntityTypeId(org.jowidgets.cap.ui.api.types.IEntityTypeId) IBeanProxy(org.jowidgets.cap.ui.api.bean.IBeanProxy)

Aggregations

IBeanProxy (org.jowidgets.cap.ui.api.bean.IBeanProxy)1 IBeanRelationNodeModel (org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModel)1 IBeanRelationNodeModelBluePrint (org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModelBluePrint)1 IEntityTypeId (org.jowidgets.cap.ui.api.types.IEntityTypeId)1