installEditPolicy(EditPolicyRoles.CREATION_ROLE,
new CreationEditPolicy() {
public Command getCommand(Request request) {
if (understandsRequest(request)) {
if (request instanceof CreateViewAndElementRequest) {
CreateElementRequestAdapter adapter = ((CreateViewAndElementRequest) request)
.getViewAndElementDescriptor()
.getCreateElementRequestAdapter();
IElementType type = (IElementType) adapter
.getAdapter(IElementType.class);
if (type == OntoUML.diagram.providers.OntoUMLElementTypes.Property_2012) {
EditPart compartmentEditPart = getChildBySemanticHint(OntoUML.diagram.part.OntoUMLVisualIDRegistry
.getType(OntoUML.diagram.edit.parts.StructuralDatatypeAttributeCompartmentEditPart.VISUAL_ID));
return compartmentEditPart == null ? null