/**
* @generated
*/
protected Command getSemanticCommand(IEditCommandRequest request) {
IEditCommandRequest completedRequest = completeRequest(request);
Object editHelperContext = completedRequest.getEditHelperContext();
if (editHelperContext instanceof View
|| (editHelperContext instanceof IEditHelperContext && ((IEditHelperContext) editHelperContext)
.getEObject() instanceof View)) {
// no semantic commands are provided for pure design elements
return null;
}
if (editHelperContext == null) {
editHelperContext = ViewUtil
.resolveSemanticElement((View) getHost().getModel());
}
IElementType elementType = ElementTypeRegistry.getInstance()
.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);