diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic')
2 files changed, 86 insertions, 86 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDefaultNamedElementItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDefaultNamedElementItemSemanticEditPolicy.java index 6b912fdfdf8..f9f299bb927 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDefaultNamedElementItemSemanticEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDefaultNamedElementItemSemanticEditPolicy.java @@ -1,45 +1,45 @@ -/*****************************************************************************
- * 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.uml.diagram.deployment.custom.edit.policies.itemsemantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest;
-import org.eclipse.papyrus.commands.wrappers.GMFtoGEFCommandWrapper;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.deployment.custom.edit.command.BranchDependenctReorientCommand;
-import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.DependencyBranchEditPart;
-
-/**
- * this class has been specialized in order to manage reconnection of multidependency
- *
- */
-public class CustomDefaultNamedElementItemSemanticEditPolicy extends DefaultSemanticEditPolicy {
-
- public static final String VISUAL_ID_KEY = "visual_id";
-
- @Override
- protected Command getSemanticCommand(IEditCommandRequest request) {
- if (request instanceof ReorientRelationshipRequest) {
- if (DependencyBranchEditPart.VISUAL_ID == getVisualID(request)) {
- return new GMFtoGEFCommandWrapper(new BranchDependenctReorientCommand((ReorientRelationshipRequest)request));
- }
- }
- return super.getSemanticCommand(request);
- }
-
- protected String getVisualID(IEditCommandRequest request) {
- return (String) request.getParameter(VISUAL_ID_KEY);
- }
-}
+/***************************************************************************** + * 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.uml.diagram.deployment.custom.edit.policies.itemsemantic; + +import org.eclipse.gef.commands.Command; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.ReorientRelationshipRequest; +import org.eclipse.papyrus.commands.wrappers.GMFtoGEFCommandWrapper; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.uml.diagram.deployment.custom.edit.command.BranchDependenctReorientCommand; +import org.eclipse.papyrus.uml.diagram.deployment.edit.parts.DependencyBranchEditPart; + +/** + * this class has been specialized in order to manage reconnection of multidependency + * + */ +public class CustomDefaultNamedElementItemSemanticEditPolicy extends DefaultSemanticEditPolicy { + + public static final String VISUAL_ID_KEY = "visual_id"; + + @Override + protected Command getSemanticCommand(IEditCommandRequest request) { + if (request instanceof ReorientRelationshipRequest) { + if (DependencyBranchEditPart.VISUAL_ID == getVisualID(request)) { + return new GMFtoGEFCommandWrapper(new BranchDependenctReorientCommand((ReorientRelationshipRequest)request)); + } + } + return super.getSemanticCommand(request); + } + + protected String getVisualID(IEditCommandRequest request) { + return (String) request.getParameter(VISUAL_ID_KEY); + } +} diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java index aaabe83fb62..2b8d87e31f3 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.deployment/custom-src/org/eclipse/papyrus/uml/diagram/deployment/custom/edit/policies/itemsemantic/CustomDependencyBranchSemanticEditPolicy.java @@ -1,41 +1,41 @@ -/*****************************************************************************
- * Copyright (c) 2013 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:
- * Nizar GUEDIDI (CEA LIST) - Initial API and implementation
- /*****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.deployment.custom.edit.policies.itemsemantic;
-
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.commands.UnexecutableCommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest;
-import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy;
-import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes;
-
-
-/**
- * this class is used to forbid the creation of a dependency branch on a dependency branch.
- *
- */
-public class CustomDependencyBranchSemanticEditPolicy extends DefaultSemanticEditPolicy {
-
- @Override
- protected Command getSemanticCommand(IEditCommandRequest request) {
- if (request instanceof CreateRelationshipRequest) {
- IElementType type = ((CreateRelationshipRequest) request).getElementType();
- if (UMLElementTypes.Dependency_BranchEdge == type) {
- return UnexecutableCommand.INSTANCE;
- }
- }
- return super.getSemanticCommand(request);
- }
-
-}
+/***************************************************************************** + * Copyright (c) 2013 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: + * Nizar GUEDIDI (CEA LIST) - Initial API and implementation + /*****************************************************************************/ +package org.eclipse.papyrus.uml.diagram.deployment.custom.edit.policies.itemsemantic; + +import org.eclipse.gef.commands.Command; +import org.eclipse.gef.commands.UnexecutableCommand; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest; +import org.eclipse.gmf.runtime.emf.type.core.requests.IEditCommandRequest; +import org.eclipse.papyrus.infra.gmfdiag.common.editpolicies.DefaultSemanticEditPolicy; +import org.eclipse.papyrus.uml.diagram.deployment.providers.UMLElementTypes; + + +/** + * this class is used to forbid the creation of a dependency branch on a dependency branch. + * + */ +public class CustomDependencyBranchSemanticEditPolicy extends DefaultSemanticEditPolicy { + + @Override + protected Command getSemanticCommand(IEditCommandRequest request) { + if (request instanceof CreateRelationshipRequest) { + IElementType type = ((CreateRelationshipRequest) request).getElementType(); + if (UMLElementTypes.Dependency_BranchEdge == type) { + return UnexecutableCommand.INSTANCE; + } + } + return super.getSemanticCommand(request); + } + +} |