GraphElement element = (GraphElement) model;
if (element instanceof Variable) {
return new VariableTreeEditPart((Variable) element);
}
if (element instanceof GroupElement) {
return new GroupElementTreeEditPart((GroupElement) element);
}
return element.getTypeDefinition().createTreeEditPart(element);
}