Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/edit/policies/PortLayoutEditPolicy.java')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/edit/policies/PortLayoutEditPolicy.java122
1 files changed, 61 insertions, 61 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/edit/policies/PortLayoutEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/edit/policies/PortLayoutEditPolicy.java
index 9a2a1882411..ae6dc590bb0 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/edit/policies/PortLayoutEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.composite/custom-src/org/eclipse/papyrus/uml/diagram/composite/custom/edit/policies/PortLayoutEditPolicy.java
@@ -1,61 +1,61 @@
-/*****************************************************************************
- * Copyright (c) 2009-2011 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:
- * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.EditPolicy;
-import org.eclipse.gef.Request;
-import org.eclipse.gef.commands.Command;
-import org.eclipse.gef.editpolicies.LayoutEditPolicy;
-import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
-import org.eclipse.gef.requests.CreateRequest;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.composite.edit.parts.PortAppliedStereotypeEditPart;
-import org.eclipse.papyrus.uml.diagram.composite.edit.parts.PortEditPart;
-import org.eclipse.papyrus.uml.diagram.composite.edit.parts.PortNameEditPart;
-import org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry;
-
-/**
- * This edit policy replaces the GMF generated edit policy for Port.
- * In particular it installs {@link ExternalLabelPrimaryDragRoleEditPolicy} on
- * children that are external label.
- * The code generated by GMF can be found in {@link PortEditPart#createLayoutEditPolicy()}.
- */
-public class PortLayoutEditPolicy extends LayoutEditPolicy {
-
- @Override
- protected EditPolicy createChildEditPolicy(EditPart child) {
- View childView = (View) child.getModel();
- switch (UMLVisualIDRegistry.getVisualID(childView)) {
- case PortNameEditPart.VISUAL_ID:
- case PortAppliedStereotypeEditPart.VISUAL_ID:
- return new ExternalLabelPrimaryDragRoleEditPolicy();
- }
- EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
- if (result == null) {
- result = new NonResizableEditPolicy();
- }
- return result;
- }
-
- @Override
- protected Command getMoveChildrenCommand(Request request) {
- return null;
- }
-
- @Override
- protected Command getCreateCommand(CreateRequest request) {
- return null;
- }
-}
+/*****************************************************************************
+ * Copyright (c) 2009-2011 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:
+ * Yann Tanguy (CEA LIST) yann.tanguy@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.composite.custom.edit.policies;
+
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.EditPolicy;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.editpolicies.LayoutEditPolicy;
+import org.eclipse.gef.editpolicies.NonResizableEditPolicy;
+import org.eclipse.gef.requests.CreateRequest;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.uml.diagram.composite.edit.parts.PortAppliedStereotypeEditPart;
+import org.eclipse.papyrus.uml.diagram.composite.edit.parts.PortEditPart;
+import org.eclipse.papyrus.uml.diagram.composite.edit.parts.PortNameEditPart;
+import org.eclipse.papyrus.uml.diagram.composite.part.UMLVisualIDRegistry;
+
+/**
+ * This edit policy replaces the GMF generated edit policy for Port.
+ * In particular it installs {@link ExternalLabelPrimaryDragRoleEditPolicy} on
+ * children that are external label.
+ * The code generated by GMF can be found in {@link PortEditPart#createLayoutEditPolicy()}.
+ */
+public class PortLayoutEditPolicy extends LayoutEditPolicy {
+
+ @Override
+ protected EditPolicy createChildEditPolicy(EditPart child) {
+ View childView = (View) child.getModel();
+ switch (UMLVisualIDRegistry.getVisualID(childView)) {
+ case PortNameEditPart.VISUAL_ID:
+ case PortAppliedStereotypeEditPart.VISUAL_ID:
+ return new ExternalLabelPrimaryDragRoleEditPolicy();
+ }
+ EditPolicy result = child.getEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE);
+ if (result == null) {
+ result = new NonResizableEditPolicy();
+ }
+ return result;
+ }
+
+ @Override
+ protected Command getMoveChildrenCommand(Request request) {
+ return null;
+ }
+
+ @Override
+ protected Command getCreateCommand(CreateRequest request) {
+ return null;
+ }
+}

Back to the top