}
else {
return;
}
final PropertyType ptype = prop.getType();
if(ptype.isModelRef()) {
// related one
final TreeItem branch = new TreeItem(getModelRefHtml((IModelRefProperty) prop));
parent.addItem(branch);
final Model m = ((IModelRefProperty) prop).getModel();
if(m != null) {
for(final IModelProperty nprop : m) {
addProp(nprop, branch, visited);
}
}
}
else if(ptype.isRelational()) {
// related many
final TreeItem branch = new TreeItem(getModelCollectionHtml((RelatedManyProperty) prop));
parent.addItem(branch);
for(final IndexedProperty ip : (RelatedManyProperty) prop) {
addProp(ip, branch, visited);
}
}
else {
// non-relational value property
assert ptype.isValue() == true;
// don't enumerate the id property (its redundant)
if(!Model.ID_PROPERTY.equals(prop.getPropertyName())) {
parent.addItem(getPropValueHtml((IPropertyValue) prop));
}
}