/***************************************************************************** * Copyright (c) 2012 CEA LIST. * * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * CEA LIST - Initial API and implementation * *****************************************************************************/ package org.eclipse.papyrus.uml.diagram.usecase.edit.policies; import org.eclipse.gef.commands.Command; import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest; import org.eclipse.papyrus.uml.diagram.usecase.edit.commands.CommentCreateCommandCN; import org.eclipse.papyrus.uml.diagram.usecase.edit.commands.ConstraintInComponentCreateCommand; import org.eclipse.papyrus.uml.diagram.usecase.edit.commands.UseCaseInComponentCreateCommand; import org.eclipse.papyrus.uml.diagram.usecase.providers.UMLElementTypes; /** * @generated */ public class SubjectComponentUsecasesItemSemanticEditPolicy extends UMLBaseItemSemanticEditPolicy { /** * @generated */ public SubjectComponentUsecasesItemSemanticEditPolicy() { super(UMLElementTypes.Classifier_2015); } /** * @generated */ protected Command getCreateCommand(CreateElementRequest req) { if(UMLElementTypes.UseCase_3009 == req.getElementType()) { return getGEFWrapper(new UseCaseInComponentCreateCommand(req)); } if(UMLElementTypes.Comment_3015 == req.getElementType()) { return getGEFWrapper(new CommentCreateCommandCN(req)); } if(UMLElementTypes.Constraint_3017 == req.getElementType()) { return getGEFWrapper(new ConstraintInComponentCreateCommand(req)); } return super.getCreateCommand(req); } }