.getElementType(editHelperContext);
if (elementType == ElementTypeRegistry.getInstance().getType(
"org.eclipse.gmf.runtime.emf.type.core.default")) { //$NON-NLS-1$
elementType = null;
}
Command semanticCommand = getSemanticCommandSwitch(completedRequest);
if (elementType != null) {
if (semanticCommand != null) {
ICommand command = semanticCommand instanceof ICommandProxy ? ((ICommandProxy) semanticCommand)
.getICommand()
: new CommandProxy(semanticCommand);
completedRequest
.setParameter(
OntoUML.diagram.edit.helpers.OntoUMLBaseEditHelper.EDIT_POLICY_COMMAND,
command);
}
ICommand command = elementType.getEditCommand(completedRequest);
if (command != null) {
if (!(command instanceof CompositeTransactionalCommand)) {
TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost())
.getEditingDomain();
command = new CompositeTransactionalCommand(editingDomain,
command.getLabel()).compose(command);
}
semanticCommand = new ICommandProxy(command);
}
}
boolean shouldProceed = true;
if (completedRequest instanceof DestroyRequest) {
shouldProceed = shouldProceed((DestroyRequest) completedRequest);
}
if (shouldProceed) {
if (completedRequest instanceof DestroyRequest) {
TransactionalEditingDomain editingDomain = ((IGraphicalEditPart) getHost())
.getEditingDomain();
Command deleteViewCommand = new ICommandProxy(
new DeleteCommand(editingDomain, (View) getHost()
.getModel()));
semanticCommand = semanticCommand == null ? deleteViewCommand
: semanticCommand.chain(deleteViewCommand);
}