blob: 51b26f8562edc537fb377da94b3cecf4836469fd (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
/*****************************************************************************
* Copyright (c) 2010 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:
* Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation
*/
package org.eclipse.papyrus.diagram.clazz.custom.policies.itemsemantic;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.papyrus.diagram.clazz.custom.command.CClassifierTemplateParameterCreateCommand;
import org.eclipse.papyrus.diagram.clazz.custom.command.COperationTemplateParameterCreateCommand;
import org.eclipse.papyrus.diagram.clazz.custom.command.CTemplateParameterCreateCommand;
import org.eclipse.papyrus.diagram.clazz.edit.policies.TemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy;
import org.eclipse.papyrus.diagram.clazz.providers.UMLElementTypes;
/**
*
* specialization in order to call specific command
*
*/
public class CTemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy extends TemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy {
/**
*
* @see org.eclipse.papyrus.diagram.clazz.edit.policies.TemplateSignatureTemplateParameterCompartmentItemSemanticEditPolicy#getCreateCommand(org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest)
*
*/
protected Command getCreateCommand(CreateElementRequest req) {
if(UMLElementTypes.ClassifierTemplateParameter_3031 == req.getElementType()) {
return getGEFWrapper(new CClassifierTemplateParameterCreateCommand(req));
}
if(UMLElementTypes.OperationTemplateParameter_3035 == req.getElementType()) {
return getGEFWrapper(new COperationTemplateParameterCreateCommand(req));
}
if(UMLElementTypes.TemplateParameter_3016 == req.getElementType()) {
return getGEFWrapper(new CTemplateParameterCreateCommand(req));
}
return super.getCreateCommand(req);
}
}
|