Property changed: Instead of a single value it is now possible to add a list of values.
diff --git a/plugins/org.eclipse.graphiti.mm/model/graphiti.ecore b/plugins/org.eclipse.graphiti.mm/model/graphiti.ecore
index 2b643b0..5521505 100644
--- a/plugins/org.eclipse.graphiti.mm/model/graphiti.ecore
+++ b/plugins/org.eclipse.graphiti.mm/model/graphiti.ecore
@@ -5,14 +5,15 @@
nsURI="http://eclipse.org/graphiti/mm" nsPrefix="mm">
<eClassifiers xsi:type="ecore:EClass" name="Property">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="key" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
+ <eStructuralFeatures xsi:type="ecore:EAttribute" name="values" upperBound="-1"
+ eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="GraphicsAlgorithmContainer" abstract="true"
- eSuperTypes="#//PropertyContainer"/>
<eClassifiers xsi:type="ecore:EClass" name="PropertyContainer" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="properties" ordered="false"
upperBound="-1" eType="#//Property" containment="true"/>
</eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="GraphicsAlgorithmContainer" abstract="true"
+ eSuperTypes="#//PropertyContainer"/>
<eClassifiers xsi:type="ecore:EClass" name="StyleContainer" abstract="true">
<eStructuralFeatures xsi:type="ecore:EReference" name="styles" ordered="false"
upperBound="-1" eType="#//algorithms/styles/Style" containment="true" eOpposite="#//algorithms/styles/Style/styleContainer"/>
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/MmPackage.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/MmPackage.java
index 3ef991d..55f575a 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/MmPackage.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/MmPackage.java
@@ -87,13 +87,13 @@
int PROPERTY__KEY = 0;
/**
- * The feature id for the '<em><b>Value</b></em>' attribute.
+ * The feature id for the '<em><b>Values</b></em>' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
- int PROPERTY__VALUE = 1;
+ int PROPERTY__VALUES = 1;
/**
* The number of structural features of the '<em>Property</em>' class.
@@ -112,7 +112,7 @@
* @see org.eclipse.graphiti.mm.impl.MmPackageImpl#getPropertyContainer()
* @generated
*/
- int PROPERTY_CONTAINER = 2;
+ int PROPERTY_CONTAINER = 1;
/**
* The feature id for the '<em><b>Properties</b></em>' containment reference list.
@@ -140,7 +140,7 @@
* @see org.eclipse.graphiti.mm.impl.MmPackageImpl#getGraphicsAlgorithmContainer()
* @generated
*/
- int GRAPHICS_ALGORITHM_CONTAINER = 1;
+ int GRAPHICS_ALGORITHM_CONTAINER = 2;
/**
* The feature id for the '<em><b>Properties</b></em>' containment reference list.
@@ -211,15 +211,15 @@
EAttribute getProperty_Key();
/**
- * Returns the meta object for the attribute '{@link org.eclipse.graphiti.mm.Property#getValue <em>Value</em>}'.
+ * Returns the meta object for the attribute list '{@link org.eclipse.graphiti.mm.Property#getValues <em>Values</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.graphiti.mm.Property#getValue()
+ * @return the meta object for the attribute list '<em>Values</em>'.
+ * @see org.eclipse.graphiti.mm.Property#getValues()
* @see #getProperty()
* @generated
*/
- EAttribute getProperty_Value();
+ EAttribute getProperty_Values();
/**
* Returns the meta object for class '{@link org.eclipse.graphiti.mm.GraphicsAlgorithmContainer <em>Graphics Algorithm Container</em>}'.
@@ -314,12 +314,12 @@
EAttribute PROPERTY__KEY = eINSTANCE.getProperty_Key();
/**
- * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
+ * The meta object literal for the '<em><b>Values</b></em>' attribute list feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
- EAttribute PROPERTY__VALUE = eINSTANCE.getProperty_Value();
+ EAttribute PROPERTY__VALUES = eINSTANCE.getProperty_Values();
/**
* The meta object literal for the '{@link org.eclipse.graphiti.mm.impl.GraphicsAlgorithmContainerImpl <em>Graphics Algorithm Container</em>}' class.
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/Property.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/Property.java
index b803d95..d137192 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/Property.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/Property.java
@@ -14,6 +14,7 @@
*/
package org.eclipse.graphiti.mm;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
/**
@@ -25,7 +26,7 @@
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.graphiti.mm.Property#getKey <em>Key</em>}</li>
- * <li>{@link org.eclipse.graphiti.mm.Property#getValue <em>Value</em>}</li>
+ * <li>{@link org.eclipse.graphiti.mm.Property#getValues <em>Values</em>}</li>
* </ul>
* </p>
*
@@ -61,29 +62,19 @@
void setKey(String value);
/**
- * Returns the value of the '<em><b>Value</b></em>' attribute.
+ * Returns the value of the '<em><b>Values</b></em>' attribute list.
+ * The list contents are of type {@link java.lang.String}.
* <!-- begin-user-doc -->
* <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
+ * If the meaning of the '<em>Values</em>' attribute list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' attribute.
- * @see #setValue(String)
- * @see org.eclipse.graphiti.mm.MmPackage#getProperty_Value()
- * @model required="true"
+ * @return the value of the '<em>Values</em>' attribute list.
+ * @see org.eclipse.graphiti.mm.MmPackage#getProperty_Values()
+ * @model
* @generated
*/
- String getValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.graphiti.mm.Property#getValue <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
- * @see #getValue()
- * @generated
- */
- void setValue(String value);
+ EList<String> getValues();
} // Property
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/impl/MmPackageImpl.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/impl/MmPackageImpl.java
index 9963f49..2a44989 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/impl/MmPackageImpl.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/impl/MmPackageImpl.java
@@ -170,7 +170,7 @@
* <!-- end-user-doc -->
* @generated
*/
- public EAttribute getProperty_Value() {
+ public EAttribute getProperty_Values() {
return (EAttribute)propertyEClass.getEStructuralFeatures().get(1);
}
@@ -249,13 +249,13 @@
// Create classes and their features
propertyEClass = createEClass(PROPERTY);
createEAttribute(propertyEClass, PROPERTY__KEY);
- createEAttribute(propertyEClass, PROPERTY__VALUE);
-
- graphicsAlgorithmContainerEClass = createEClass(GRAPHICS_ALGORITHM_CONTAINER);
+ createEAttribute(propertyEClass, PROPERTY__VALUES);
propertyContainerEClass = createEClass(PROPERTY_CONTAINER);
createEReference(propertyContainerEClass, PROPERTY_CONTAINER__PROPERTIES);
+ graphicsAlgorithmContainerEClass = createEClass(GRAPHICS_ALGORITHM_CONTAINER);
+
styleContainerEClass = createEClass(STYLE_CONTAINER);
createEReference(styleContainerEClass, STYLE_CONTAINER__STYLES);
}
@@ -302,13 +302,13 @@
// Initialize classes and features; add operations and parameters
initEClass(propertyEClass, Property.class, "Property", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getProperty_Key(), ecorePackage.getEString(), "key", null, 1, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getProperty_Value(), ecorePackage.getEString(), "value", null, 1, 1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(graphicsAlgorithmContainerEClass, GraphicsAlgorithmContainer.class, "GraphicsAlgorithmContainer", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEAttribute(getProperty_Values(), ecorePackage.getEString(), "values", null, 0, -1, Property.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEClass(propertyContainerEClass, PropertyContainer.class, "PropertyContainer", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getPropertyContainer_Properties(), this.getProperty(), null, "properties", null, 0, -1, PropertyContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
+ initEClass(graphicsAlgorithmContainerEClass, GraphicsAlgorithmContainer.class, "GraphicsAlgorithmContainer", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
initEClass(styleContainerEClass, StyleContainer.class, "StyleContainer", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEReference(getStyleContainer_Styles(), theStylesPackage.getStyle(), theStylesPackage.getStyle_StyleContainer(), "styles", null, 0, -1, StyleContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED);
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/impl/PropertyImpl.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/impl/PropertyImpl.java
index 3cd5137..117993b 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/impl/PropertyImpl.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/impl/PropertyImpl.java
@@ -14,13 +14,16 @@
*/
package org.eclipse.graphiti.mm.impl;
+import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;
+import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.graphiti.mm.MmPackage;
import org.eclipse.graphiti.mm.Property;
@@ -32,7 +35,7 @@
* The following features are implemented:
* <ul>
* <li>{@link org.eclipse.graphiti.mm.impl.PropertyImpl#getKey <em>Key</em>}</li>
- * <li>{@link org.eclipse.graphiti.mm.impl.PropertyImpl#getValue <em>Value</em>}</li>
+ * <li>{@link org.eclipse.graphiti.mm.impl.PropertyImpl#getValues <em>Values</em>}</li>
* </ul>
* </p>
*
@@ -60,24 +63,14 @@
protected String key = KEY_EDEFAULT;
/**
- * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
+ * The cached value of the '{@link #getValues() <em>Values</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
- * @see #getValue()
+ * @see #getValues()
* @generated
* @ordered
*/
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected String value = VALUE_EDEFAULT;
+ protected EList<String> values;
/**
* <!-- begin-user-doc -->
@@ -124,20 +117,11 @@
* <!-- end-user-doc -->
* @generated
*/
- public String getValue() {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void setValue(String newValue) {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, MmPackage.PROPERTY__VALUE, oldValue, value));
+ public EList<String> getValues() {
+ if (values == null) {
+ values = new EDataTypeUniqueEList<String>(String.class, this, MmPackage.PROPERTY__VALUES);
+ }
+ return values;
}
/**
@@ -150,8 +134,8 @@
switch (featureID) {
case MmPackage.PROPERTY__KEY:
return getKey();
- case MmPackage.PROPERTY__VALUE:
- return getValue();
+ case MmPackage.PROPERTY__VALUES:
+ return getValues();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -161,14 +145,16 @@
* <!-- end-user-doc -->
* @generated
*/
+ @SuppressWarnings("unchecked")
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
case MmPackage.PROPERTY__KEY:
setKey((String)newValue);
return;
- case MmPackage.PROPERTY__VALUE:
- setValue((String)newValue);
+ case MmPackage.PROPERTY__VALUES:
+ getValues().clear();
+ getValues().addAll((Collection<? extends String>)newValue);
return;
}
super.eSet(featureID, newValue);
@@ -185,8 +171,8 @@
case MmPackage.PROPERTY__KEY:
setKey(KEY_EDEFAULT);
return;
- case MmPackage.PROPERTY__VALUE:
- setValue(VALUE_EDEFAULT);
+ case MmPackage.PROPERTY__VALUES:
+ getValues().clear();
return;
}
super.eUnset(featureID);
@@ -202,8 +188,8 @@
switch (featureID) {
case MmPackage.PROPERTY__KEY:
return KEY_EDEFAULT == null ? key != null : !KEY_EDEFAULT.equals(key);
- case MmPackage.PROPERTY__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
+ case MmPackage.PROPERTY__VALUES:
+ return values != null && !values.isEmpty();
}
return super.eIsSet(featureID);
}
@@ -220,8 +206,8 @@
StringBuffer result = new StringBuffer(super.toString());
result.append(" (key: ");
result.append(key);
- result.append(", value: ");
- result.append(value);
+ result.append(", values: ");
+ result.append(values);
result.append(')');
return result.toString();
}
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/util/MmAdapterFactory.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/util/MmAdapterFactory.java
index eb3c202..9086826 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/util/MmAdapterFactory.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/util/MmAdapterFactory.java
@@ -84,14 +84,14 @@
return createPropertyAdapter();
}
@Override
- public Adapter caseGraphicsAlgorithmContainer(GraphicsAlgorithmContainer object) {
- return createGraphicsAlgorithmContainerAdapter();
- }
- @Override
public Adapter casePropertyContainer(PropertyContainer object) {
return createPropertyContainerAdapter();
}
@Override
+ public Adapter caseGraphicsAlgorithmContainer(GraphicsAlgorithmContainer object) {
+ return createGraphicsAlgorithmContainerAdapter();
+ }
+ @Override
public Adapter caseStyleContainer(StyleContainer object) {
return createStyleContainerAdapter();
}
diff --git a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/util/MmSwitch.java b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/util/MmSwitch.java
index 89e3cc1..19f3536 100644
--- a/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/util/MmSwitch.java
+++ b/plugins/org.eclipse.graphiti.mm/src-gen/org/eclipse/graphiti/mm/util/MmSwitch.java
@@ -101,6 +101,12 @@
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case MmPackage.PROPERTY_CONTAINER: {
+ PropertyContainer propertyContainer = (PropertyContainer)theEObject;
+ T result = casePropertyContainer(propertyContainer);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
case MmPackage.GRAPHICS_ALGORITHM_CONTAINER: {
GraphicsAlgorithmContainer graphicsAlgorithmContainer = (GraphicsAlgorithmContainer)theEObject;
T result = caseGraphicsAlgorithmContainer(graphicsAlgorithmContainer);
@@ -108,12 +114,6 @@
if (result == null) result = defaultCase(theEObject);
return result;
}
- case MmPackage.PROPERTY_CONTAINER: {
- PropertyContainer propertyContainer = (PropertyContainer)theEObject;
- T result = casePropertyContainer(propertyContainer);
- if (result == null) result = defaultCase(theEObject);
- return result;
- }
case MmPackage.STYLE_CONTAINER: {
StyleContainer styleContainer = (StyleContainer)theEObject;
T result = caseStyleContainer(styleContainer);