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;
}
Aggregations