blob: f26339b0488fee44f8346a0fcb3de650ddad408c [file] [log] [blame]
package org.eclipse.uml2.diagram.clazz.edit.policies;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.uml2.diagram.clazz.edit.commands.OperationCreateCommand;
import org.eclipse.uml2.diagram.clazz.providers.UMLElementTypes;
import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
*/
public class ClassOperationsItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy {
/**
* @generated
*/
protected Command getCreateCommand(CreateElementRequest req) {
if (UMLElementTypes.Operation_3002 == req.getElementType()) {
if (req.getContainmentFeature() == null) {
req.setContainmentFeature(UMLPackage.eINSTANCE.getClass_OwnedOperation());
}
return getGEFWrapper(new OperationCreateCommand(req));
}
return super.getCreateCommand(req);
}
}