use of org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModel in project jo-client-platform by jo-source.
the class BeanRelationTreeModelImpl method clear.
@Override
public void clear() {
root.clear();
for (final Object relationModelObject : relationNodes.values()) {
final IBeanRelationNodeModel<?, ?> relationModel = (IBeanRelationNodeModel<?, ?>) relationModelObject;
relationModel.dispose();
}
for (final IDataModel dataModel : externalDataModels) {
dataModel.clear();
}
relationNodes.clear();
if (selection != null && !selection.getSelection().isEmpty()) {
setSelection(null);
}
}
use of org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModel 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;
}
use of org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModel in project jo-client-platform by jo-source.
the class BeanRelationGraphImpl method loadChildren.
@SuppressWarnings("unused")
private List<IBeanRelationNodeModel<Object, Object>> loadChildren(final IBeanRelationNodeModel<?, Object> beanRelationNodeModel) {
final List<IBeanRelationNodeModel<Object, Object>> childList = new LinkedList<IBeanRelationNodeModel<Object, Object>>();
for (final IEntityTypeId<Object> entityType : beanRelationNodeModel.getChildRelations()) {
final int childRelations = beanRelationNodeModel.getSize();
for (int i = 0; i < childRelations; i++) {
final IBeanRelationNodeModel<Object, Object> childRelationModel = relationTreeModel.getNode(beanRelationNodeModel.getChildEntityTypeId(), beanRelationNodeModel.getBean(i), entityType);
if (!childRelationModel.loadIfNotYetDone() && graph.getNodeCount() <= maxNodeCount) {
if (!beanRelationMap.containsValue(childRelationModel)) {
onBeansChanged(childRelationModel);
}
}
childList.add(childRelationModel);
}
}
return childList;
}
use of org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModel in project jo-client-platform by jo-source.
the class BeanRelationTreeModelImpl method cancelExecutions.
@Override
public void cancelExecutions() {
root.cancelExecutions();
for (final Object relationModelObject : relationNodes.values()) {
final IBeanRelationNodeModel<?, ?> relationModel = (IBeanRelationNodeModel<?, ?>) relationModelObject;
relationModel.cancelExecutions();
}
for (final IDataModel dataModel : externalDataModels) {
dataModel.cancelExecutions();
}
}
use of org.jowidgets.cap.ui.api.tree.IBeanRelationNodeModel in project jo-client-platform by jo-source.
the class BeanRelationTreeModelImpl method createValidationResult.
@Override
public IValidationResult createValidationResult() {
final IValidationResultBuilder builder = ValidationResult.builder();
builder.addResult(root.validate());
for (final Object relationModelObject : relationNodes.values()) {
final IBeanRelationNodeModel<?, ?> relationModel = (IBeanRelationNodeModel<?, ?>) relationModelObject;
builder.addResult(relationModel.validate());
}
for (final IDataModel dataModel : externalDataModels) {
builder.addResult(dataModel.validate());
}
return builder.build();
}
Aggregations