diff options
author | eperico | 2010-02-02 16:48:27 +0000 |
---|---|---|
committer | eperico | 2010-02-02 16:48:27 +0000 |
commit | be60f89f793f20880991b3b65e9ac6b684ed3cd7 (patch) | |
tree | 55652b75d63c6b9aecae04bf8e510af336b43ce1 | |
parent | 225e7acebfa8365828e673b4bcb8441e40ff6076 (diff) | |
download | org.eclipse.papyrus-be60f89f793f20880991b3b65e9ac6b684ed3cd7.tar.gz org.eclipse.papyrus-be60f89f793f20880991b3b65e9ac6b684ed3cd7.tar.xz org.eclipse.papyrus-be60f89f793f20880991b3b65e9ac6b684ed3cd7.zip |
NEW - bug 297816: [SysML] Provide a Parametric diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=297816
- manage property synchronization on constraint property
- TODO: synchro with add and remove
6 files changed, 251 insertions, 38 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 e61eb033a16..caf50372c3e 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 @@ -98,12 +98,12 @@ public class CreateParameterViewCommand extends Command { */
@Override
public void execute() {
- Object property = null;
- if (elementCreationCommand != null) {
- // elementCreationCommand.execute();
- // property = elementCreationCommand.getICommand().getCommandResult().getReturnValue();
- }
- // TODO Do we need to add the property graphically in the class
+ super.execute();
+// Object property = null;
+// if (elementCreationCommand != null) {
+// elementCreationCommand.execute();
+// property = elementCreationCommand.getICommand().getCommandResult().getReturnValue();
+// }
}
/**
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 2a97405b479..0d83e336848 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 @@ -13,17 +13,13 @@ *****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.parametric.edit.policies;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.Request;
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.UnexecutableCommand;
import org.eclipse.gef.editpolicies.AbstractEditPolicy;
-import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
-import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.sysml.diagram.parametric.command.CreateParameterViewCommand;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
@@ -42,12 +38,14 @@ public class CreateParameterEditPolicy extends AbstractEditPolicy { CreateUnspecifiedTypeRequest creationRequest = (CreateUnspecifiedTypeRequest) request;
EditPart parentEditPart = getHost();
if (parentEditPart instanceof ConstraintPropertyEditPart) {
- ConstraintPropertyEditPart compartementPart = (ConstraintPropertyEditPart) parentEditPart;
- EObject action = ViewUtil.resolveSemanticElement((View) getHost().getModel());
+ //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());
+ // do nothing or display WarningAndLinkDialog
+ return UnexecutableCommand.INSTANCE;
+// return new CreateParameterViewCommand((IHintedType) SysmlElementTypes.Property_3002,
+// compartementPart, action, getHost());
}
}
}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/SelfCompartmentNotificationHelper.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/SelfCompartmentNotificationHelper.java new file mode 100644 index 00000000000..81f135eb5ff --- /dev/null +++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/helper/SelfCompartmentNotificationHelper.java @@ -0,0 +1,152 @@ +/*****************************************************************************
+ * 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.helper;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.operations.OperationHistoryFactory;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CreateCommand;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.core.adaptor.gmf.Activator;
+import org.eclipse.papyrus.diagram.common.helper.NotificationHelper;
+import org.eclipse.papyrus.diagram.common.providers.UIAdapterImpl;
+import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
+import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLPackage;
+
+/**
+ * SelfCompartmentNotificationHelper is a particular NotificationHelper which manages the editparts
+ * drawn in a particular compartment for a particular feature. It automatically add or remove
+ * appropriate parts when model is modified, so that all contained elements are represented once.
+ */
+public class SelfCompartmentNotificationHelper extends NotificationHelper {
+
+ /**
+ * Construct a new NotificationHelper which automatically manages contained element for a
+ * particular feature.
+ *
+ * @param compartmentPart
+ * the compartment part containing parts to manage
+ * @param childFeature
+ * the feature for children parts (list feature)
+ * @param childType
+ * the {@link IHintedType} for chidren node parts
+ */
+ public SelfCompartmentNotificationHelper(final ConstraintPropertyEditPart compartmentPart,
+ final EStructuralFeature childFeature, final IHintedType childType) {
+ super(new UIAdapterImpl() {
+
+ @Override
+ protected void safeNotifyChanged(Notification msg) {
+ if (UMLPackage.eINSTANCE.getTypedElement_Type().equals(msg.getFeature())) {
+ updateChildrenParts(compartmentPart, childFeature, childType);
+ }
+ }
+ });
+ }
+
+ /**
+ * Update children edit parts so that each child is represented once
+ *
+ * @param compartmentPart
+ * the compartment part containing children
+ * @param childFeature
+ * the feature containing children
+ * @param childType
+ * the children's IHintedType represented as Node
+ */
+ public static void updateChildrenParts(ConstraintPropertyEditPart compartmentPart, EStructuralFeature childFeature,
+ IHintedType childType) {
+ if (compartmentPart == null || childFeature == null || childType == null) {
+ return;
+ }
+ if (compartmentPart.getModel() instanceof View) {
+ View compartmentView = (View) compartmentPart.getModel();
+ EObject containerObject = compartmentView.getElement();
+ if (containerObject instanceof ConstraintProperty) {
+ Type propertyType = ((ConstraintProperty) containerObject).getBase_Property().getType();
+ if (propertyType != null) {
+ Object untypedOwnedObjects = propertyType.eGet(childFeature);
+ if (untypedOwnedObjects instanceof List<?>) {
+ List<?> ownedEObjectChildren = (List<?>) untypedOwnedObjects;
+ List<EObject> drawnEObjectChildren = new ArrayList<EObject>(ownedEObjectChildren.size());
+ // list children already drawn and remove old children
+ for (Object childView : compartmentView.getChildren()) {
+ if (childView instanceof View) {
+ EObject child = ((View) childView).getElement();
+ if (child instanceof Property) {
+ if (ownedEObjectChildren.contains(child) && !drawnEObjectChildren.contains(child)) {
+ drawnEObjectChildren.add(child);
+ } else if (!ownedEObjectChildren.contains(child)) {
+ compartmentView.removeChild((View) childView);
+ }
+ }
+ }
+ }
+ // draw remaining children
+ List<Object> childrenToDraw = new ArrayList<Object>(ownedEObjectChildren);
+ childrenToDraw.removeAll(drawnEObjectChildren);
+ CompositeCommand drawChildrenCommand = new CompositeCommand("draw children nodes");
+ for (Object child : childrenToDraw) {
+ if (child instanceof EObject) {
+ IAdaptable adapter = new EObjectAdapter((EObject) child);
+ ViewDescriptor descriptor = new ViewDescriptor(adapter, Node.class, childType
+ .getSemanticHint(), ViewUtil.APPEND, false, compartmentPart
+ .getDiagramPreferencesHint());
+ CreateCommand nodeCreationCommand = new CreateCommand(compartmentPart
+ .getEditingDomain(), descriptor, compartmentView);
+ drawChildrenCommand.add(nodeCreationCommand);
+ }
+ }
+ // execute command
+ if (!drawChildrenCommand.isEmpty()) {
+ try {
+ OperationHistoryFactory.getOperationHistory().execute(drawChildrenCommand,
+ new NullProgressMonitor(), null);
+ } catch (ExecutionException e) {
+ e.printStackTrace();
+ Activator.getInstance().logError("Unable to create diagram elements", e); //$NON-NLS-1$
+ }
+ }
+ }
+ } else {
+ // constraint property type is set to null, remove old children
+ for (Object childView : compartmentView.getChildren()) {
+ if (childView instanceof View) {
+ EObject child = ((View) childView).getElement();
+ if (child instanceof Property) {
+ compartmentView.removeChild((View) childView);
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/PropertyLabelParser.java b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/PropertyLabelParser.java index 68ff7f37f1f..7e0a367d978 100644 --- a/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/PropertyLabelParser.java +++ b/plugins/sysml/org.eclipse.papyrus.sysml.diagram.parametric/custom-src/org/eclipse/papyrus/sysml/diagram/parametric/parsers/PropertyLabelParser.java @@ -26,7 +26,6 @@ import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.gmf.runtime.emf.ui.services.parser.ISemanticParser;
import org.eclipse.papyrus.umlutils.ValueSpecificationUtil;
import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.InstanceValue;
import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.UMLPackage;
import org.eclipse.uml2.uml.ValueSpecification;
@@ -88,8 +87,10 @@ public class PropertyLabelParser extends MessageFormatParser implements ISemanti */
public String getPrintString(IAdaptable element, int flags) {
String result = "";
- Property property = (Property) element.getAdapter(EObject.class);
- if (property != null) {
+ Property property = null;
+ Object adapter = element.getAdapter(EObject.class);
+ if (adapter instanceof Property) {
+ property = (Property) adapter;
String name = property.isDerived() ? "/ " + property.getName() : property.getName();
if (property.getType() != null) {
String type = property.getType().getName();
@@ -103,11 +104,9 @@ public class PropertyLabelParser extends MessageFormatParser implements ISemanti // manage initial values
if (property.getDefaultValue() != null) {
ValueSpecification valueSpecification = property.getDefaultValue();
- if (valueSpecification instanceof InstanceValue
- && property.getType().equals(valueSpecification.getType())) {
- result = String.format(DEFAULT_VALUE_PARAMETER_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
- } else{
- result = String.format(DEFAULT_VALUE_PARAMETER_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(property.getDefaultValue()));
+ String specificationValue = ValueSpecificationUtil.getSpecificationValue(valueSpecification);
+ if (specificationValue != null && specificationValue.length() > 0) {
+ result = String.format(DEFAULT_VALUE_PARAMETER_FORMAT, result, ValueSpecificationUtil.getSpecificationValue(valueSpecification));
}
}
} else {
@@ -153,19 +152,22 @@ public class PropertyLabelParser extends MessageFormatParser implements ISemanti */
public List<?> getSemanticElementsBeingParsed(EObject element) {
List<Element> semanticElementsBeingParsed = new ArrayList<Element>();
- Property property = (Property) element;
- semanticElementsBeingParsed.add(property);
- if (property.getType() != null) {
- semanticElementsBeingParsed.add(property.getType());
- int lower = property.getLower();
- int upper = property.getUpper();
- if (lower != 1 || upper != 1) {
- semanticElementsBeingParsed.add(property.getLowerValue());
- semanticElementsBeingParsed.add(property.getUpperValue());
- }
- if (property.getDefaultValue() != null) {
- semanticElementsBeingParsed.add(property.getDefaultValue());
- }
+ Property property = null;
+ if (element instanceof Property) {
+ property = (Property) element;
+ semanticElementsBeingParsed.add(property);
+ if (property.getType() != null) {
+ semanticElementsBeingParsed.add(property.getType());
+ int lower = property.getLower();
+ int upper = property.getUpper();
+ if (lower != 1 || upper != 1) {
+ semanticElementsBeingParsed.add(property.getLowerValue());
+ semanticElementsBeingParsed.add(property.getUpperValue());
+ }
+ if (property.getDefaultValue() != null) {
+ semanticElementsBeingParsed.add(property.getDefaultValue());
+ }
+ }
}
return semanticElementsBeingParsed;
}
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 76550408be1..6a43f59e163 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 @@ -19,6 +19,7 @@ import org.eclipse.draw2d.RoundedRectangle; import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.StackLayout;
import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPolicy;
@@ -37,6 +38,7 @@ 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.emf.type.core.IHintedType;
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;
@@ -47,12 +49,16 @@ import org.eclipse.papyrus.diagram.common.draw2d.CenterLayout; import org.eclipse.papyrus.diagram.common.editpolicies.BorderItemResizableEditPolicy;
import org.eclipse.papyrus.preferences.utils.GradientPreferenceConverter;
import org.eclipse.papyrus.preferences.utils.PreferenceConstantHelper;
+import org.eclipse.papyrus.sysml.constraints.ConstraintProperty;
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.helper.SelfCompartmentNotificationHelper;
import org.eclipse.papyrus.sysml.diagram.parametric.locator.ParameterPositionLocator;
import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
+import org.eclipse.papyrus.sysml.diagram.parametric.providers.SysmlElementTypes;
import org.eclipse.swt.graphics.Color;
+import org.eclipse.uml2.uml.UMLPackage;
/**
* @generated
@@ -77,6 +83,13 @@ AbstractBorderedShapeEditPart { protected IFigure primaryShape;
/**
+ * Notifier for listening and stop listening model element.
+ */
+ private SelfCompartmentNotificationHelper notifier = new SelfCompartmentNotificationHelper(this,
+ UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute(),
+ (IHintedType) SysmlElementTypes.Property_3002);
+
+ /**
* @generated
*/
public ConstraintPropertyEditPart(View view) {
@@ -407,4 +420,39 @@ AbstractBorderedShapeEditPart { }
return result;
}
+
+ /**
+ * Activate a listener for to Handle notification for new owned property
+ */
+ @Override
+ public void activate() {
+ super.activate();
+ EObject parent = resolveSemanticElement();
+ // listen constraint property and self base property
+ notifier.listenObject(parent);
+ if (parent instanceof ConstraintProperty) {
+ notifier.listenObject(((ConstraintProperty) parent).getBase_Property());
+ }
+ // ensure children parts are correctly initialized.
+ SelfCompartmentNotificationHelper.updateChildrenParts(this, UMLPackage.eINSTANCE.getStructuredClassifier_OwnedAttribute(), (IHintedType) SysmlElementTypes.Property_3002);
+ }
+
+ /**
+ * Deactivate listeners to handle notification in the message occurence
+ * specification
+ */
+ @Override
+ public void deactivate() {
+ notifier.unlistenAll();
+ super.deactivate();
+ }
+
+ /**
+ * Remove listeners to handle notification in the message occurence specification
+ */
+ @Override
+ public void removeNotify() {
+ notifier.unlistenAll();
+ super.removeNotify();
+ }
}
\ No newline at end of file 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 c89f559546d..30634b5ff7f 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 @@ -55,6 +55,7 @@ import org.eclipse.jface.preference.IPreferenceStore; 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.constraints.ConstraintProperty;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConnectorNameEditPart;
import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ConstraintPropertyEditPart;
@@ -67,12 +68,15 @@ import org.eclipse.papyrus.sysml.diagram.parametric.edit.parts.ResourceEditPart; import org.eclipse.papyrus.sysml.diagram.parametric.part.SysmlVisualIDRegistry;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.FontData;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.StructuredClassifier;
+import org.eclipse.uml2.uml.Type;
/**
* @generated
*/
public class SysmlViewProvider extends AbstractProvider implements IViewProvider {
-
+
/**
* @generated
*/
@@ -243,7 +247,7 @@ public class SysmlViewProvider extends AbstractProvider implements IViewProvider }
/**
- * @generated
+ * @generated NOT
*/
public Node createConstraintProperty_2003(EObject domainElement, View containerView, int index, boolean persisted,
PreferencesHint preferencesHint) {
@@ -263,6 +267,15 @@ public class SysmlViewProvider extends AbstractProvider implements IViewProvider initBackgroundFromPrefs(node, prefStore, "ConstraintProperty");
Node label5001 = createLabel(node, SysmlVisualIDRegistry.getType(ConstraintPropertyNameEditPart.VISUAL_ID));
+
+ // create the associated properties
+ Type type = ((ConstraintProperty) domainElement).getBase_Property().getType();
+ if (type != null && type instanceof StructuredClassifier) {
+ for (Property property : ((StructuredClassifier) type).getOwnedAttributes()) {
+ createProperty_3002(property, node, index, persisted, preferencesHint);
+ }
+ }
+ // TODO do we need to restore connection ?
return node;
}
|