if (model instanceof UiDocumentNode) {
return new UiDocumentEditPart((UiDocumentNode) model, mDisplay);
} else if (model instanceof UiElementNode) {
UiElementNode node = (UiElementNode) model;
if (node.getDescriptor().hasChildren()) {
return new UiLayoutEditPart(node);
}
return new UiViewEditPart(node);
}
return null;