Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreperico2010-01-08 16:11:45 +0000
committereperico2010-01-08 16:11:45 +0000
commit11820ea771de548f3f31aee73ed00022c3ff1242 (patch)
treebf52f3e2552ed1d14e4fb93fccc842b28d4dc9ec
parente899d226c1b7cf588361f661be4c0be78540faf0 (diff)
downloadorg.eclipse.papyrus-11820ea771de548f3f31aee73ed00022c3ff1242.tar.gz
org.eclipse.papyrus-11820ea771de548f3f31aee73ed00022c3ff1242.tar.xz
org.eclipse.papyrus-11820ea771de548f3f31aee73ed00022c3ff1242.zip
Task 297816: [SysML] Provide a Parametric diagram - manage figure's label with custom parser, format code
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateParameterViewCommand.java37
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CreateParameterEditPolicy.java19
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CenteredWrappedLabel.java34
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintPropertyParser.java4
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ParameterParser.java162
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgen31
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgraph12
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/Property2CreateCommand.java10
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyEditPart.java20
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyNameEditPart.java (renamed from plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/WrappingLabelEditPart.java)33
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyEditPart.java16
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyNameEditPart.java3
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/SysmlEditPartFactory.java4
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java4
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorUtil.java2
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdater.java36
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlVisualIDRegistry.java5
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlParserProvider.java34
-rw-r--r--plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlViewProvider.java12
19 files changed, 350 insertions, 128 deletions
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateParameterViewCommand.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateParameterViewCommand.java
index df127fb2b45..e61eb033a16 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateParameterViewCommand.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/command/CreateParameterViewCommand.java
@@ -10,7 +10,7 @@
* Contributors:
* Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
*
- *****************************************************************************/
+ *****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.parametric.command;
import org.eclipse.emf.ecore.EObject;
@@ -24,7 +24,6 @@ import org.eclipse.papyrus.sysml.diagram.parametric.edit.commands.Property2Creat
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-
public class CreateParameterViewCommand extends Command {
/** The compartment which graphically contains the Constraint to create */
@@ -38,7 +37,7 @@ public class CreateParameterViewCommand extends Command {
/** The type of local condition to create */
private IHintedType type;
-
+
public CreateParameterViewCommand() {
super();
}
@@ -46,20 +45,22 @@ public class CreateParameterViewCommand extends Command {
public CreateParameterViewCommand(String label) {
super(label);
}
-
+
/**
* Constructor a new action to create the local condition and corresponding views.
*
* @param conditionType
- * the type of the local condition : precondition (Constraint_3011) or postcondition (Constraint_3012)
+ * the type of the local condition : precondition (Constraint_3011) or postcondition
+ * (Constraint_3012)
* @param graphicalParent
- * the parent edit part which graphically contains the condition
+ * the parent edit part which graphically contains the condition
* @param containerAction
- * the action which owns the local condition to create
+ * the action which owns the local condition to create
* @param actionPart
- * the part of the action owning the condition
+ * the part of the action owning the condition
*/
- public CreateParameterViewCommand(IHintedType conditionType, ConstraintPropertyEditPart graphicalParent, EObject containerAction, EditPart actionPart) {
+ public CreateParameterViewCommand(IHintedType conditionType, ConstraintPropertyEditPart graphicalParent,
+ EObject containerAction, EditPart actionPart) {
elementCreationCommand = getElementCreationCommand(containerAction, conditionType);
compartment = graphicalParent;
type = conditionType;
@@ -69,14 +70,15 @@ public class CreateParameterViewCommand extends Command {
* Get the Command to create the constraint element
*
* @param containerAction
- * the action which owns the local condition to create
+ * the action which owns the local condition to create
* @param conditionType
- * the type of the local condition : precondition (Constraint_3011) or postcondition (Constraint_3012)
+ * the type of the local condition : precondition (Constraint_3011) or postcondition
+ * (Constraint_3012)
* @return the command to create model element or null
*/
private static ICommandProxy getElementCreationCommand(EObject containerAction, IHintedType conditionType) {
CreateElementRequest createElementReq = new CreateElementRequest(containerAction, conditionType);
- if(SysmlElementTypes.Property_3002.equals(conditionType)) {
+ if (SysmlElementTypes.Property_3002.equals(conditionType)) {
Property2CreateCommand cmd = new Property2CreateCommand(createElementReq);
return new ICommandProxy(cmd);
} else {
@@ -97,9 +99,9 @@ public class CreateParameterViewCommand extends Command {
@Override
public void execute() {
Object property = null;
- if(elementCreationCommand != null) {
- //elementCreationCommand.execute();
- //property = elementCreationCommand.getICommand().getCommandResult().getReturnValue();
+ if (elementCreationCommand != null) {
+ // elementCreationCommand.execute();
+ // property = elementCreationCommand.getICommand().getCommandResult().getReturnValue();
}
// TODO Do we need to add the property graphically in the class
}
@@ -111,13 +113,12 @@ public class CreateParameterViewCommand extends Command {
*/
@Override
public void undo() {
- if(viewsCreationCommand != null) {
+ if (viewsCreationCommand != null) {
viewsCreationCommand.undo();
}
- if(elementCreationCommand != null) {
+ if (elementCreationCommand != null) {
elementCreationCommand.undo();
}
}
-
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CreateParameterEditPolicy.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CreateParameterEditPolicy.java
index a670a271f08..2a97405b479 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CreateParameterEditPolicy.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/edit/policies/CreateParameterEditPolicy.java
@@ -10,7 +10,7 @@
* Contributors:
* Emilien Perico (Atos Origin) emilien.perico@atosorigin.com - Initial API and implementation
*
- *****************************************************************************/
+ *****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
import org.eclipse.emf.ecore.EObject;
@@ -27,7 +27,6 @@ import org.eclipse.papyrus.sysml.diagram.parametric.command.CreateParameterViewC
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
-
/**
* Custom CreateParameterEditPolicy.
*/
@@ -36,18 +35,19 @@ public class CreateParameterEditPolicy extends AbstractEditPolicy {
public CreateParameterEditPolicy() {
super();
}
-
+
@Override
public Command getCommand(Request request) {
- if(RequestConstants.REQ_CREATE.equals(request.getType()) && request instanceof CreateUnspecifiedTypeRequest) {
- CreateUnspecifiedTypeRequest creationRequest = (CreateUnspecifiedTypeRequest)request;
+ if (RequestConstants.REQ_CREATE.equals(request.getType()) && request instanceof CreateUnspecifiedTypeRequest) {
+ CreateUnspecifiedTypeRequest creationRequest = (CreateUnspecifiedTypeRequest) request;
EditPart parentEditPart = getHost();
- if(parentEditPart instanceof ConstraintPropertyEditPart) {
- ConstraintPropertyEditPart compartementPart = (ConstraintPropertyEditPart)parentEditPart;
- EObject action = ViewUtil.resolveSemanticElement((View)getHost().getModel());
+ if (parentEditPart instanceof ConstraintPropertyEditPart) {
+ ConstraintPropertyEditPart compartementPart = (ConstraintPropertyEditPart) parentEditPart;
+ EObject action = ViewUtil.resolveSemanticElement((View) getHost().getModel());
for (Object obj : creationRequest.getElementTypes()) {
if (SysmlElementTypes.Property_3002.equals(obj)) {
- return new CreateParameterViewCommand((IHintedType) SysmlElementTypes.Property_3002, compartementPart, action, getHost());
+ return new CreateParameterViewCommand((IHintedType) SysmlElementTypes.Property_3002,
+ compartementPart, action, getHost());
}
}
}
@@ -55,5 +55,4 @@ public class CreateParameterEditPolicy extends AbstractEditPolicy {
return super.getCommand(request);
}
-
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CenteredWrappedLabel.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CenteredWrappedLabel.java
new file mode 100644
index 00000000000..8c3527909da
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/figures/CenteredWrappedLabel.java
@@ -0,0 +1,34 @@
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.figures;
+
+import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
+
+/**
+ * This class is a {@link WrappingLabel}, which default behavior is set differently :
+ *
+ * The text is centered and automatically wraps on several lines.
+ */
+public class CenteredWrappedLabel extends WrappingLabel {
+
+ /**
+ * Construct an empty wrapping label with customized alignment.
+ */
+ public CenteredWrappedLabel() {
+ super();
+ setTextJustification(WrappingLabel.CENTER);
+ setAlignment(WrappingLabel.CENTER);
+ setTextWrap(true);
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintPropertyParser.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintPropertyParser.java
index 0c6c8ccf391..9896996f136 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintPropertyParser.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ConstraintPropertyParser.java
@@ -15,7 +15,7 @@ package org.eclipse.papyrus.sysml.diagram.parametric.parsers;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.papyrus.diagramprofile.parsers.ResourceEObjectParserProvider;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.WrappingLabelEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart;
import org.eclipse.uml2.uml.UMLPackage;
public class ConstraintPropertyParser extends ResourceEObjectParserProvider {
@@ -32,7 +32,7 @@ public class ConstraintPropertyParser extends ResourceEObjectParserProvider {
@Override
public String getTargetType() {
- return String.valueOf(WrappingLabelEditPart.VISUAL_ID);
+ return String.valueOf(ConstraintPropertyNameEditPart.VISUAL_ID);
}
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ParameterParser.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ParameterParser.java
new file mode 100644
index 00000000000..bbd513742c9
--- /dev/null
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/ParameterParser.java
@@ -0,0 +1,162 @@
+/*****************************************************************************
+ * Copyright (c) 2009 Atos Origin.
+ *
+ *
+ * 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:
+ * Atos Origin - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.sysml.diagram.parametric.parsers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EAttribute;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
+import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
+import org.eclipse.uml2.uml.Element;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * A specific parser for displaying an Activity's Parameter. This parser refreshes the text
+ * displayed for the Parameter.
+ */
+public class ParameterParser extends MessageFormatParser implements ISemanticParser {
+
+ /** The String format for displaying a parameter with its type */
+ private static final String TYPED_PARAMETER_FORMAT = "%s: %s";
+
+ /** The String format for displaying a parameter with no type */
+ private static final String UNTYPED_PARAMETER_FORMAT = "%s";
+
+ public ParameterParser(EAttribute[] features, EAttribute[] editableFeatures) {
+ super(features, editableFeatures);
+ }
+
+ public ParameterParser(EAttribute[] features) {
+ super(features);
+ }
+
+ public ParameterParser() {
+ super(new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() });
+ }
+
+ protected EStructuralFeature getEStructuralFeature(Object notification) {
+ EStructuralFeature featureImpl = null;
+ if (notification instanceof Notification) {
+ Object feature = ((Notification) notification).getFeature();
+ if (feature instanceof EStructuralFeature) {
+ featureImpl = (EStructuralFeature) feature;
+ }
+ }
+ return featureImpl;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.AbstractParser#isAffectingEvent(java.lang.Object
+ * , int)
+ */
+ public boolean isAffectingEvent(Object event, int flags) {
+ EStructuralFeature feature = getEStructuralFeature(event);
+ return isValidFeature(feature);
+
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.papyrus.diagram.sequence.parsers.MessageFormatParser#getPrintString(org.eclipse
+ * .core.runtime.IAdaptable, int)
+ */
+ public String getPrintString(IAdaptable element, int flags) {
+ Object obj = element.getAdapter(EObject.class);
+
+ Property property = null;
+ // TODO another custom parser will be needed to manage equation in ConstraintProperty
+ if (obj instanceof ConstraintProperty) {
+ property = ((ConstraintProperty) obj).getBase_Property();
+ } else if (obj instanceof Property) {
+ property = (Property) obj;
+ }
+
+ if (property != null) {
+ String name = property.getName();
+ if (name == null) {
+ name = " ";
+ }
+ if (property.getType() != null) {
+ String type = property.getType().getName();
+ if (type == null) {
+ type = "";
+ }
+ return String.format(TYPED_PARAMETER_FORMAT, name, type);
+ } else {
+ return String.format(UNTYPED_PARAMETER_FORMAT, name);
+ }
+ }
+ return " ";
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#areSemanticElementsAffected
+ * (org.eclipse.emf.ecore.EObject, java.lang.Object)
+ */
+ public boolean areSemanticElementsAffected(EObject listener, Object notification) {
+ EStructuralFeature feature = getEStructuralFeature(notification);
+ return isValidFeature(feature);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see
+ * org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser#getSemanticElementsBeingParsed
+ * (org.eclipse.emf.ecore.EObject)
+ */
+ public List<?> getSemanticElementsBeingParsed(EObject element) {
+ List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
+ Property property = null;
+ if (element instanceof ConstraintProperty) {
+ property = ((ConstraintProperty) element).getBase_Property();
+ } else if (element instanceof Property) {
+ property = (Property) element;
+ }
+ if (property != null) {
+ semanticElementsBeingParsed.add(property);
+ if (property.getType() != null) {
+ semanticElementsBeingParsed.add(property.getType());
+ }
+ }
+ return semanticElementsBeingParsed;
+ }
+
+ /**
+ * Determines if the given feature has to be taken into account in this parser
+ *
+ * @param feature
+ * the feature to test
+ * @return true if is valid, false otherwise
+ */
+ private boolean isValidFeature(EStructuralFeature feature) {
+ return UMLPackage.eINSTANCE.getNamedElement_Name().equals(feature)
+ || UMLPackage.eINSTANCE.getTypedElement_Type().equals(feature);
+ }
+
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgen b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgen
index 4adfe9b49f5..40a577ccd70 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgen
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgen
@@ -31,6 +31,7 @@
visualID="3002"
editPartClassName="Property2EditPart"
itemSemanticEditPolicyClassName="Property2ItemSemanticEditPolicy"
+ notationViewFactoryClassName="PropertyViewFactory"
canonicalEditPolicyClassName="Property2CanonicalEditPolicy"
graphicalNodeEditPolicyClassName="Property2GraphicalNodeEditPolicy"
createCommandClassName="Property2CreateCommand"
@@ -63,7 +64,8 @@
xsi:type="gmfgen:GenExternalNodeLabel"
visualID="5003"
editPartClassName="PropertyName2EditPart"
- itemSemanticEditPolicyClassName="PropertyName2ItemSemanticEditPolicy">
+ itemSemanticEditPolicyClassName="PropertyName2ItemSemanticEditPolicy"
+ notationViewFactoryClassName="PropertyNameViewFactory">
<diagramRunTimeClass
href="../../../plugin/org.eclipse.gmf.runtime.notation/model/notation.genmodel#//notation/Node"/>
<viewmap
@@ -71,7 +73,7 @@
figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
<modelFacet
xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
+ parser="/0/@labelParsers/@implementations.2">
<metaFeatures
href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
</modelFacet>
@@ -94,7 +96,7 @@
<viewmap
xsi:type="gmfgen:InnerClassViewmap"
className="ConstraintPropertyFigureDescriptor"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ConstraintPropertyFigureDescriptor extends org.eclipse.draw2d.RoundedRectangle {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fConstraintPropertyFigureLabel; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ConstraintPropertyFigureDescriptor() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.papyrus.diagram.common.draw2d.CenterLayout layoutThis = new org.eclipse.papyrus.diagram.common.draw2d.CenterLayout();&#xA;&#xA;&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(8)&#xA;, getMapMode().DPtoLP(8)&#xA;));&#xA;this.setLineWidth(1);&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(200)&#xA;, getMapMode().DPtoLP(120)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fConstraintPropertyFigureLabel = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fConstraintPropertyFigureLabel.setText(&quot;ConstraintPropertyName&quot;);&#xA;&#xA;this.add(fConstraintPropertyFigureLabel);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getConstraintPropertyFigureLabel() {&#xA;&#x9;&#x9;return fConstraintPropertyFigureLabel;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class ConstraintPropertyFigureDescriptor extends org.eclipse.draw2d.RoundedRectangle {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel fConstraintPropertyFigureLabel; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public ConstraintPropertyFigureDescriptor() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.papyrus.diagram.common.draw2d.CenterLayout layoutThis = new org.eclipse.papyrus.diagram.common.draw2d.CenterLayout();&#xA;&#xA;&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setCornerDimensions(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(8)&#xA;, getMapMode().DPtoLP(8)&#xA;));&#xA;this.setLineWidth(1);&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(200)&#xA;, getMapMode().DPtoLP(120)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fConstraintPropertyFigureLabel = new org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fConstraintPropertyFigureLabel);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel getConstraintPropertyFigureLabel() {&#xA;&#x9;&#x9;return fConstraintPropertyFigureLabel;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
<behaviour
xsi:type="gmfgen:CustomBehaviour"
key="RequestConstants.REQ_CREATE"
@@ -109,8 +111,8 @@
</modelFacet>
<labels
visualID="5001"
- editPartClassName="WrappingLabelEditPart"
- itemSemanticEditPolicyClassName="WrappingLabelItemSemanticEditPolicy"
+ editPartClassName="ConstraintPropertyNameEditPart"
+ itemSemanticEditPolicyClassName="ConstraintPropertyNameItemSemanticEditPolicy"
notationViewFactoryClassName="ConstraintPropertyLabelViewFactory"
elementIcon="true">
<diagramRunTimeClass
@@ -118,9 +120,9 @@
<viewmap
xsi:type="gmfgen:ParentAssignedViewmap"
getterName="getConstraintPropertyFigureLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
+ figureQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel"/>
<modelFacet
- parser="/0/@labelParsers/@implementations.1"/>
+ parser="/0/@labelParsers/@implementations.2"/>
</labels>
</topLevelNodes>
<topLevelNodes
@@ -139,7 +141,7 @@
<viewmap
xsi:type="gmfgen:InnerClassViewmap"
className="PropertyFigure"
- classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PropertyFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel fPropertyFigureLabel; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PropertyFigure() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.papyrus.diagram.common.draw2d.CenterLayout layoutThis = new org.eclipse.papyrus.diagram.common.draw2d.CenterLayout();&#xA;&#xA;&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(100)&#xA;, getMapMode().DPtoLP(40)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fPropertyFigureLabel = new org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel();&#xA;fPropertyFigureLabel.setText(&quot;PropertyName&quot;);&#xA;&#xA;this.add(fPropertyFigureLabel);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel getPropertyFigureLabel() {&#xA;&#x9;&#x9;return fPropertyFigureLabel;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
+ classBody="&#xA;/**&#xA; * @generated&#xA; */&#xA;public class PropertyFigure extends org.eclipse.draw2d.RectangleFigure {&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel fPropertyFigureLabel; &#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public PropertyFigure() {&#xA;&#x9;&#x9;&#xA;&#x9;org.eclipse.papyrus.diagram.common.draw2d.CenterLayout layoutThis = new org.eclipse.papyrus.diagram.common.draw2d.CenterLayout();&#xA;&#xA;&#xA;&#x9;this.setLayoutManager(layoutThis);&#xA;&#xA;&#x9;&#x9;this.setLineWidth(1);&#xA;this.setMinimumSize(new org.eclipse.draw2d.geometry.Dimension(getMapMode().DPtoLP(100)&#xA;, getMapMode().DPtoLP(40)&#xA;));&#xA;&#x9;&#x9;createContents();&#xA;&#x9;}&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private void createContents(){&#xA;&#xA;&#xA;fPropertyFigureLabel = new org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel();&#xA;&#xA;&#xA;&#xA;this.add(fPropertyFigureLabel);&#xA;&#xA;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;private boolean myUseLocalCoordinates = false;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected boolean useLocalCoordinates() {&#xA;&#x9;&#x9;return myUseLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;protected void setUseLocalCoordinates(boolean useLocalCoordinates) {&#xA;&#x9;&#x9;myUseLocalCoordinates = useLocalCoordinates;&#xA;&#x9;}&#xA;&#xA;&#xA;&#xA;&#x9;/**&#xA;&#x9; * @generated&#xA;&#x9; */&#xA;&#x9;public org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel getPropertyFigureLabel() {&#xA;&#x9;&#x9;return fPropertyFigureLabel;&#xA;&#x9;}&#xA;&#xA;&#xA;}&#xA;&#xA;"/>
<modelFacet>
<metaClass
href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/Property"/>
@@ -159,10 +161,10 @@
<viewmap
xsi:type="gmfgen:ParentAssignedViewmap"
getterName="getPropertyFigureLabel"
- figureQualifiedClassName="org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel"/>
+ figureQualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel"/>
<modelFacet
xsi:type="gmfgen:FeatureLabelModelFacet"
- parser="/0/@labelParsers/@implementations.0">
+ parser="/0/@labelParsers/@implementations.2">
<metaFeatures
href="../../../plugin/org.eclipse.uml2.uml/model/UML.genmodel#//uml/NamedElement/name"/>
</modelFacet>
@@ -262,11 +264,14 @@
<labelParsers
extensibleViaService="true">
<implementations
- xsi:type="gmfgen:PredefinedParser"
- uses="/0/@diagram/@childNodes.0/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.1/@labels.0/@modelFacet"/>
+ xsi:type="gmfgen:PredefinedParser"/>
<implementations
xsi:type="gmfgen:ExternalParser"
- uses="/0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet"/>
+ hint=""/>
+ <implementations
+ xsi:type="gmfgen:CustomParser"
+ uses="/0/@diagram/@topLevelNodes.0/@labels.0/@modelFacet /0/@diagram/@childNodes.0/@labels.0/@modelFacet /0/@diagram/@topLevelNodes.1/@labels.0/@modelFacet"
+ qualifiedName="org.eclipse.papyrus.sysml.diagram.parametric.parsers.ParameterParser"/>
</labelParsers>
<contextMenus
context="/0/@diagram">
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgraph b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgraph
index 59dab3daf12..d354e55debb 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgraph
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/model/Parametric.gmfgraph
@@ -17,9 +17,9 @@
dx="200"
dy="120"/>
<children
- xsi:type="gmfgraph:Label"
- name="ConstraintPropertyLabel"
- text="ConstraintPropertyName"/>
+ xsi:type="gmfgraph:CustomFigure"
+ name="ConstraintPropertyFigureLabel"
+ qualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel"/>
</actualFigure>
<accessors
accessor="getConstraintPropertyFigureLabel"
@@ -37,9 +37,9 @@
dx="100"
dy="40"/>
<children
- xsi:type="gmfgraph:Label"
- name="PropertyLabel"
- text="PropertyName"/>
+ xsi:type="gmfgraph:CustomFigure"
+ name="PropertyFigureLabel"
+ qualifiedClassName="org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel"/>
</actualFigure>
<accessors
accessor="getPropertyFigureLabel"
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/Property2CreateCommand.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/Property2CreateCommand.java
index 71ab41d1419..a6d97154201 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/Property2CreateCommand.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/commands/Property2CreateCommand.java
@@ -91,7 +91,7 @@ public class Property2CreateCommand extends EditElementCommand {
*/
public boolean canExecute() {
ConstraintProperty container = (ConstraintProperty) getElementToEdit();
- //StructuredClassifier container = (StructuredClassifier) getElementToEdit();
+ // StructuredClassifier container = (StructuredClassifier) getElementToEdit();
// FIXME return true if base property != null
if (container.getBase_Property() != null) {
return true;
@@ -105,21 +105,21 @@ public class Property2CreateCommand extends EditElementCommand {
*/
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- Property newElement = UMLFactory.eINSTANCE.createProperty();
+ Property newElement = UMLFactory.eINSTANCE.createProperty();
ConstraintProperty owner = (ConstraintProperty) getElementToEdit();
Type type = owner.getBase_Property().getType();
-
+
if (type != null && type instanceof StructuredClassifier) {
StructuredClassifier classifier = (StructuredClassifier) type;
classifier.getOwnedAttributes().add(newElement);
-
+
doConfigure(newElement, monitor, info);
((CreateElementRequest) getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
} else {
return CommandResult.newCancelledCommandResult();
- }
+ }
}
/**
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyEditPart.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyEditPart.java
index 93569641ad8..76550408be1 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyEditPart.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyEditPart.java
@@ -37,7 +37,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.diagram.ui.figures.BorderItemLocator;
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.NotationPackage;
@@ -50,6 +49,7 @@ import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.ConstraintPropertyItemSemanticEditPolicy;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.CreateParameterEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel;
import org.eclipse.papyrus.sysml.diagram.parametric.locator.ParameterPositionLocator;
import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
import org.eclipse.swt.graphics.Color;
@@ -155,8 +155,9 @@ AbstractBorderedShapeEditPart {
* @generated
*/
protected boolean addFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof WrappingLabelEditPart) {
- ((WrappingLabelEditPart) childEditPart).setLabel(getPrimaryShape().getConstraintPropertyFigureLabel());
+ if (childEditPart instanceof ConstraintPropertyNameEditPart) {
+ ((ConstraintPropertyNameEditPart) childEditPart).setLabel(getPrimaryShape()
+ .getConstraintPropertyFigureLabel());
return true;
}
@@ -174,7 +175,7 @@ AbstractBorderedShapeEditPart {
* @generated
*/
protected boolean removeFixedChild(EditPart childEditPart) {
- if (childEditPart instanceof WrappingLabelEditPart) {
+ if (childEditPart instanceof ConstraintPropertyNameEditPart) {
return true;
}
if (childEditPart instanceof Property2EditPart) {
@@ -297,7 +298,7 @@ AbstractBorderedShapeEditPart {
* @generated
*/
public EditPart getPrimaryChildEditPart() {
- return getChildBySemanticHint(SysmlVisualIDRegistry.getType(WrappingLabelEditPart.VISUAL_ID));
+ return getChildBySemanticHint(SysmlVisualIDRegistry.getType(ConstraintPropertyNameEditPart.VISUAL_ID));
}
/**
@@ -308,7 +309,7 @@ AbstractBorderedShapeEditPart {
/**
* @generated
*/
- private WrappingLabel fConstraintPropertyFigureLabel;
+ private CenteredWrappedLabel fConstraintPropertyFigureLabel;
/**
* @generated
@@ -330,8 +331,7 @@ AbstractBorderedShapeEditPart {
*/
private void createContents() {
- fConstraintPropertyFigureLabel = new WrappingLabel();
- fConstraintPropertyFigureLabel.setText("ConstraintPropertyName");
+ fConstraintPropertyFigureLabel = new CenteredWrappedLabel();
this.add(fConstraintPropertyFigureLabel);
@@ -359,7 +359,7 @@ AbstractBorderedShapeEditPart {
/**
* @generated
*/
- public WrappingLabel getConstraintPropertyFigureLabel() {
+ public CenteredWrappedLabel getConstraintPropertyFigureLabel() {
return fConstraintPropertyFigureLabel;
}
@@ -407,4 +407,4 @@ AbstractBorderedShapeEditPart {
}
return result;
}
-}
+} \ No newline at end of file
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/WrappingLabelEditPart.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyNameEditPart.java
index 4640c0f52d1..be96d44e9f9 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/WrappingLabelEditPart.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/ConstraintPropertyNameEditPart.java
@@ -64,7 +64,9 @@ import org.eclipse.papyrus.extensionpoints.editors.configuration.IDirectEditorCo
import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialog;
import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
+import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.SysmlTextSelectionEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel;
import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlParserProvider;
@@ -81,7 +83,7 @@ import org.eclipse.uml2.uml.NamedElement;
/**
* @generated
*/
-public class WrappingLabelEditPart extends CompartmentEditPart implements ITextAwareEditPart {
+public class ConstraintPropertyNameEditPart extends CompartmentEditPart implements ITextAwareEditPart {
/**
* @generated
@@ -117,7 +119,7 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
/**
* @generated
*/
- public WrappingLabelEditPart(View view) {
+ public ConstraintPropertyNameEditPart(View view) {
super(view);
}
@@ -194,7 +196,7 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
/**
* @generated
*/
- public void setLabel(WrappingLabel figure) {
+ public void setLabel(CenteredWrappedLabel figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
@@ -220,7 +222,12 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
* @generated
*/
protected EObject getParserElement() {
- return resolveSemanticElement();
+ EObject semanticElement = resolveSemanticElement();
+ if (semanticElement instanceof ConstraintProperty) {
+ return ((ConstraintProperty) resolveSemanticElement()).getBase_Property();
+ } else {
+ return resolveSemanticElement();
+ }
}
/**
@@ -346,7 +353,7 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
SysmlElementTypes.ConstraintProperty_2003,
getParserElement(),
SysmlVisualIDRegistry
- .getType(org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.WrappingLabelEditPart.VISUAL_ID));
+ .getType(org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart.VISUAL_ID));
}
return parser;
}
@@ -627,7 +634,12 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
* @generated
*/
protected boolean checkDefaultEdition() {
- return (resolveSemanticElement() instanceof NamedElement);
+ EObject semanticElement = resolveSemanticElement();
+ if (semanticElement instanceof ConstraintProperty) {
+ return (((ConstraintProperty) semanticElement).getBase_Property() instanceof NamedElement);
+ } else {
+ return (semanticElement instanceof NamedElement);
+ }
}
/**
@@ -797,4 +809,13 @@ public class WrappingLabelEditPart extends CompartmentEditPart implements ITextA
}
+ // @Override
+ // public EObject resolveSemanticElement() {
+ // EObject semanticElement = super.resolveSemanticElement();
+ // if (semanticElement instanceof ConstraintProperty) {
+ // semanticElement = ((ConstraintProperty) semanticElement).getBase_Property();
+ // }
+ // return semanticElement;
+ // }
+
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyEditPart.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyEditPart.java
index e59dcfdd368..db218a3b7ce 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyEditPart.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyEditPart.java
@@ -31,7 +31,6 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.ShapeNodeEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editpolicies.EditPolicyRoles;
import org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout;
import org.eclipse.gmf.runtime.draw2d.ui.figures.FigureUtilities;
-import org.eclipse.gmf.runtime.draw2d.ui.figures.WrappingLabel;
import org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure;
import org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure;
import org.eclipse.gmf.runtime.notation.NotationPackage;
@@ -42,13 +41,16 @@ import org.eclipse.papyrus.diagram.common.draw2d.CenterLayout;
import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.PropertyItemSemanticEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel;
import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
import org.eclipse.swt.graphics.Color;
/**
* @generated
*/
-public class PropertyEditPart extends ShapeNodeEditPart {
+public class PropertyEditPart extends
+
+ShapeNodeEditPart {
/**
* @generated
@@ -267,7 +269,7 @@ public class PropertyEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
- private WrappingLabel fPropertyFigureLabel;
+ private CenteredWrappedLabel fPropertyFigureLabel;
/**
* @generated
@@ -288,8 +290,7 @@ public class PropertyEditPart extends ShapeNodeEditPart {
*/
private void createContents() {
- fPropertyFigureLabel = new WrappingLabel();
- fPropertyFigureLabel.setText("PropertyName");
+ fPropertyFigureLabel = new CenteredWrappedLabel();
this.add(fPropertyFigureLabel);
@@ -317,7 +318,7 @@ public class PropertyEditPart extends ShapeNodeEditPart {
/**
* @generated
*/
- public WrappingLabel getPropertyFigureLabel() {
+ public CenteredWrappedLabel getPropertyFigureLabel() {
return fPropertyFigureLabel;
}
@@ -365,5 +366,4 @@ public class PropertyEditPart extends ShapeNodeEditPart {
}
return result;
}
-
-}
+} \ No newline at end of file
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyNameEditPart.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyNameEditPart.java
index ba26e5f147a..e22059d3f09 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyNameEditPart.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/PropertyNameEditPart.java
@@ -65,6 +65,7 @@ import org.eclipse.papyrus.extensionpoints.editors.ui.ExtendedDirectEditionDialo
import org.eclipse.papyrus.extensionpoints.editors.utils.DirectEditorsUtil;
import org.eclipse.papyrus.extensionpoints.editors.utils.IDirectEditorsIds;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.policies.SysmlTextSelectionEditPolicy;
+import org.eclipse.papyrus.sysml.diagram.parametric.figures.CenteredWrappedLabel;
import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlParserProvider;
@@ -194,7 +195,7 @@ public class PropertyNameEditPart extends CompartmentEditPart implements ITextAw
/**
* @generated
*/
- public void setLabel(WrappingLabel figure) {
+ public void setLabel(CenteredWrappedLabel figure) {
unregisterVisuals();
setFigure(figure);
defaultText = getLabelTextHelper(figure);
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/SysmlEditPartFactory.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/SysmlEditPartFactory.java
index b9be46077f7..769df6e1014 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/SysmlEditPartFactory.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/edit/parts/SysmlEditPartFactory.java
@@ -47,8 +47,8 @@ public class SysmlEditPartFactory implements EditPartFactory {
case ConstraintPropertyEditPart.VISUAL_ID:
return new ConstraintPropertyEditPart(view);
- case WrappingLabelEditPart.VISUAL_ID:
- return new WrappingLabelEditPart(view);
+ case ConstraintPropertyNameEditPart.VISUAL_ID:
+ return new ConstraintPropertyNameEditPart(view);
case PropertyEditPart.VISUAL_ID:
return new PropertyEditPart(view);
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java
index 0b86cbe54bd..8b0f609fd20 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/navigator/SysmlNavigatorLabelProvider.java
@@ -25,12 +25,12 @@ import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.ViewerLabel;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyNameEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ResourceEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.WrappingLabelEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlDiagramEditorPlugin;
import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
@@ -179,7 +179,7 @@ public class SysmlNavigatorLabelProvider extends LabelProvider implements ICommo
private String getConstraintProperty_2003Text(View view) {
IParser parser = SysmlParserProvider.getParser(SysmlElementTypes.ConstraintProperty_2003,
view.getElement() != null ? view.getElement() : view, SysmlVisualIDRegistry
- .getType(WrappingLabelEditPart.VISUAL_ID));
+ .getType(ConstraintPropertyNameEditPart.VISUAL_ID));
if (parser != null) {
return parser.getPrintString(new EObjectAdapter(view.getElement() != null ? view.getElement() : view),
ParserOptions.NONE.intValue());
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorUtil.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorUtil.java
index 2102dab7bb0..21a7957b495 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorUtil.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramEditorUtil.java
@@ -351,7 +351,7 @@ public class SysmlDiagramEditorUtil {
View view = (View) element;
if (view.getDiagram() == scope.getDiagram()) {
element2ViewMap.put(element, element); // take only those that part of
- // our diagram
+ // our diagram
}
}
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdater.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdater.java
index 91034b9f624..aa7e549f422 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdater.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlDiagramUpdater.java
@@ -22,7 +22,6 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.diagramprofile.utils.StereotypeUtils;
-import org.eclipse.papyrus.resource.Resource;
import org.eclipse.papyrus.resource.util.ResourceUtil;
import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
@@ -68,29 +67,18 @@ public class SysmlDiagramUpdater {
}
return result;
/*
- if (!view.isSetElement()) {
- return Collections.EMPTY_LIST;
- }
- ConstraintProperty modelElement = (ConstraintProperty) view.getElement();
- List result = new LinkedList();
-
- Object oclRuleResult = OCLUtils.runOclRule("self.base_Property.type", modelElement);
- if (oclRuleResult != null) {
- if (oclRuleResult instanceof StructuredClassifier) {
- StructuredClassifier aClass = (StructuredClassifier) oclRuleResult;
- for (Iterator it = aClass.getAttributes().iterator(); it.hasNext();) {
- Property childElement = (Property) it.next();
- int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement);
- if (visualID == Property2EditPart.VISUAL_ID) {
- result.add(new SysmlNodeDescriptor(childElement, visualID));
- //continue;
- }
- }
- } else {
- throw new UnsupportedOperationException("Can't access with ...");
- }
- }
- */
+ * if (!view.isSetElement()) { return Collections.EMPTY_LIST; } ConstraintProperty
+ * modelElement = (ConstraintProperty) view.getElement(); List result = new LinkedList();
+ *
+ * Object oclRuleResult = OCLUtils.runOclRule("self.base_Property.type", modelElement); if
+ * (oclRuleResult != null) { if (oclRuleResult instanceof StructuredClassifier) {
+ * StructuredClassifier aClass = (StructuredClassifier) oclRuleResult; for (Iterator it =
+ * aClass.getAttributes().iterator(); it.hasNext();) { Property childElement = (Property)
+ * it.next(); int visualID = SysmlVisualIDRegistry.getNodeVisualID(view, childElement); if
+ * (visualID == Property2EditPart.VISUAL_ID) { result.add(new
+ * SysmlNodeDescriptor(childElement, visualID)); //continue; } } } else { throw new
+ * UnsupportedOperationException("Can't access with ..."); } }
+ */
}
/**
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlVisualIDRegistry.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlVisualIDRegistry.java
index ea6030e4b2f..c5150707e25 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlVisualIDRegistry.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/part/SysmlVisualIDRegistry.java
@@ -21,15 +21,14 @@ import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.diagram.common.providers.BaseViewInfo;
import org.eclipse.papyrus.diagram.common.providers.ViewInfo;
import org.eclipse.papyrus.resource.Resource;
-import org.eclipse.papyrus.resource.ResourcePackage;
import org.eclipse.papyrus.sysml.constraints.ConstraintsPackage;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyNameEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ResourceEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.WrappingLabelEditPart;
import org.eclipse.uml2.uml.UMLPackage;
/**
@@ -179,7 +178,7 @@ public class SysmlVisualIDRegistry {
}
switch (containerVisualID) {
case ConstraintPropertyEditPart.VISUAL_ID:
- if (WrappingLabelEditPart.VISUAL_ID == nodeVisualID) {
+ if (ConstraintPropertyNameEditPart.VISUAL_ID == nodeVisualID) {
return true;
}
if (Property2EditPart.VISUAL_ID == nodeVisualID) {
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlParserProvider.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlParserProvider.java
index 3de5493621f..123c504184b 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlParserProvider.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlParserProvider.java
@@ -14,7 +14,6 @@
package org.eclipse.papyrus.sysml.diagram.parametric.providers;
import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.common.core.service.AbstractProvider;
import org.eclipse.gmf.runtime.common.core.service.IOperation;
@@ -25,11 +24,11 @@ import org.eclipse.gmf.runtime.common.ui.services.parser.ParserService;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.ui.services.parser.ParserHintAdapter;
import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyNameEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.parsers.MessageFormatParser;
+import org.eclipse.papyrus.sysml.diagram.parametric.parsers.ParameterParser;
import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
-import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -39,16 +38,29 @@ public class SysmlParserProvider extends AbstractProvider implements IParserProv
/**
* @generated
*/
- private IParser propertyName_5002Parser;
+ private ParameterParser constraintPropertyLabel_5001Parser;
+
+ /**
+ * @generated
+ */
+ private IParser getConstraintPropertyLabel_5001Parser() {
+ if (constraintPropertyLabel_5001Parser == null) {
+ constraintPropertyLabel_5001Parser = new ParameterParser();
+ }
+ return constraintPropertyLabel_5001Parser;
+ }
+
+ /**
+ * @generated
+ */
+ private ParameterParser propertyName_5002Parser;
/**
* @generated
*/
private IParser getPropertyName_5002Parser() {
if (propertyName_5002Parser == null) {
- EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- propertyName_5002Parser = parser;
+ propertyName_5002Parser = new ParameterParser();
}
return propertyName_5002Parser;
}
@@ -56,16 +68,14 @@ public class SysmlParserProvider extends AbstractProvider implements IParserProv
/**
* @generated
*/
- private IParser propertyName_5003Parser;
+ private ParameterParser propertyName_5003Parser;
/**
* @generated
*/
private IParser getPropertyName_5003Parser() {
if (propertyName_5003Parser == null) {
- EAttribute[] features = new EAttribute[] { UMLPackage.eINSTANCE.getNamedElement_Name() };
- MessageFormatParser parser = new MessageFormatParser(features);
- propertyName_5003Parser = parser;
+ propertyName_5003Parser = new ParameterParser();
}
return propertyName_5003Parser;
}
@@ -75,6 +85,8 @@ public class SysmlParserProvider extends AbstractProvider implements IParserProv
*/
protected IParser getParser(int visualID) {
switch (visualID) {
+ case ConstraintPropertyNameEditPart.VISUAL_ID:
+ return getConstraintPropertyLabel_5001Parser();
case PropertyNameEditPart.VISUAL_ID:
return getPropertyName_5002Parser();
case PropertyName2EditPart.VISUAL_ID:
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlViewProvider.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlViewProvider.java
index e858331e528..892c4f0e86a 100644
--- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlViewProvider.java
+++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/src/org/eclipse/papyrus/sysml/diagram/parametric/providers/SysmlViewProvider.java
@@ -49,12 +49,12 @@ import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyNameEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.Property2EditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyName2EditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.PropertyNameEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ResourceEditPart;
-import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.WrappingLabelEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
@@ -130,12 +130,12 @@ public class SysmlViewProvider extends AbstractProvider implements IViewProvider
String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
if (!op.getSemanticHint().equals(elementTypeHint)) {
return false; // if semantic hint is specified it should be the same as in
- // element type
+ // element type
}
if (domainElement != null
&& visualID != SysmlVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
return false; // visual id for node EClass should match visual id from element
- // type
+ // type
}
} else {
if (!ResourceEditPart.MODEL_ID.equals(SysmlVisualIDRegistry.getModelID(op.getContainerView()))) {
@@ -148,7 +148,7 @@ public class SysmlViewProvider extends AbstractProvider implements IViewProvider
if (domainElement == null
|| visualID != SysmlVisualIDRegistry.getNodeVisualID(op.getContainerView(), domainElement)) {
return false; // visual id in semantic hint should match visual id for
- // domain element
+ // domain element
}
break;
default:
@@ -171,7 +171,7 @@ public class SysmlViewProvider extends AbstractProvider implements IViewProvider
String elementTypeHint = ((IHintedType) elementType).getSemanticHint();
if (elementTypeHint == null || (op.getSemanticHint() != null && !elementTypeHint.equals(op.getSemanticHint()))) {
return false; // our hint is visual id and must be specified, and it should be the same
- // as in element type
+ // as in element type
}
int visualID = SysmlVisualIDRegistry.getVisualID(elementTypeHint);
EObject domainElement = getSemanticElement(op.getSemanticAdapter());
@@ -250,7 +250,7 @@ public class SysmlViewProvider extends AbstractProvider implements IViewProvider
initBackgroundFromPrefs(node, prefStore, "ConstraintProperty");
- Node label5001 = createLabel(node, SysmlVisualIDRegistry.getType(WrappingLabelEditPart.VISUAL_ID));
+ Node label5001 = createLabel(node, SysmlVisualIDRegistry.getType(ConstraintPropertyNameEditPart.VISUAL_ID));
return node;
}

Back to the top