From 407608dc09bee90373837c06069f5ee91eb4b77c Mon Sep 17 00:00:00 2001 From: Mickael ADAM Date: Mon, 25 Apr 2016 15:35:54 +0200 Subject: Cast error at getBorderItemLocator() for LabelEditPart - add cast test at getBorderItemLocator - Remove Resizable label case in PapyrusLabelEditPart - fix port locator for sysml case Change-Id: I04940ee79dcfaa4d4f9ccb657227ac9a3e131322 Signed-off-by: Mickael ADAM --- .../diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java | 5 +++-- .../common/edit/part/AppliedStereotypeAffixedLabelEditPart.java | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'plugins/sysml') diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java index eb927fc474b..f21cb9de9ad 100644 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java +++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-sysml/org/eclipse/papyrus/sysml/diagram/common/edit/part/FlowPortAffixedLabelNameEditPart.java @@ -57,7 +57,7 @@ public class FlowPortAffixedLabelNameEditPart extends AbstractElementLabelEditPa IFigure parentFigure = getFigure().getParent(); if (parentFigure != null && parentFigure.getLayoutManager() != null) { Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure()); - return (IBorderItemLocator) constraint; + return constraint instanceof IBorderItemLocator ? (IBorderItemLocator) constraint : null; } return null; } @@ -97,7 +97,7 @@ public class FlowPortAffixedLabelNameEditPart extends AbstractElementLabelEditPa return new PapyrusWrappingLabel(); } - + /** * @see org.eclipse.papyrus.infra.gmfdiag.common.editpart.PapyrusLabelEditPart#getDefaultTextAlignment() * @@ -107,6 +107,7 @@ public class FlowPortAffixedLabelNameEditPart extends AbstractElementLabelEditPa protected int getDefaultTextAlignment() { return PositionConstants.LEFT; } + /** * {@inheritDoc} */ diff --git a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java index 8d037e64241..fca51315244 100644 --- a/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java +++ b/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.common/src-common-uml/org/eclipse/papyrus/uml/diagram/common/edit/part/AppliedStereotypeAffixedLabelEditPart.java @@ -49,7 +49,7 @@ public class AppliedStereotypeAffixedLabelEditPart extends AbstractElementLabelE IFigure parentFigure = getFigure().getParent(); if (parentFigure != null && parentFigure.getLayoutManager() != null) { Object constraint = parentFigure.getLayoutManager().getConstraint(getFigure()); - return (IBorderItemLocator) constraint; + return constraint instanceof IBorderItemLocator ? (IBorderItemLocator) constraint : null; } return null; } -- cgit v1.2.3