Skip to content

Commit

Permalink
Bug 575162 Attach LAs to LicensePlan
Browse files Browse the repository at this point in the history
add LicensePlan->agreements:List<String> list of cross-domain references

Signed-off-by: eparovyshnaya <[email protected]>
  • Loading branch information
eparovyshnaya committed Aug 16, 2021
1 parent 3ba9d99 commit f9c69ce
Show file tree
Hide file tree
Showing 9 changed files with 133 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,12 @@
iD="true"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="description" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="agreements" upperBound="-1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
<details key="documentation" value="@since 2.1"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="features" lowerBound="1"
upperBound="-1" eType="#//LicensePlanFeature" containment="true" eOpposite="#//LicensePlanFeature/plan">
<eAnnotations source="http://www.eclipse.org/emf/2002/GenModel">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,3 +208,4 @@ _UI_AgreementData_hash_feature = Hash
_UI_AgreementData_content_feature = Content
_UI_LicenseRequisites_agreements_feature = Agreements
_UI_AgreementData_contentType_feature = Content Type
_UI_LicensePlan_agreements_feature = Agreements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
addIdentifierPropertyDescriptor(object);
addNamePropertyDescriptor(object);
addDescriptionPropertyDescriptor(object);
addAgreementsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
Expand Down Expand Up @@ -118,6 +119,23 @@ protected void addDescriptionPropertyDescriptor(Object object) {
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Agreements feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 2.1
* @generated
*/
protected void addAgreementsPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_LicensePlan_agreements_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_LicensePlan_agreements_feature", //$NON-NLS-1$//$NON-NLS-2$
"_UI_LicensePlan_type"), //$NON-NLS-1$
LicensesPackage.eINSTANCE.getLicensePlan_Agreements(), true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an
* {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or
Expand Down Expand Up @@ -209,6 +227,7 @@ public void notifyChanged(Notification notification) {
case LicensesPackage.LICENSE_PLAN__IDENTIFIER:
case LicensesPackage.LICENSE_PLAN__NAME:
case LicensesPackage.LICENSE_PLAN__DESCRIPTION:
case LicensesPackage.LICENSE_PLAN__AGREEMENTS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
case LicensesPackage.LICENSE_PLAN__FEATURES:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore#//LicensePlan/identifier"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore#//LicensePlan/name"/>
<genFeatures createChild="false" propertyMultiLine="true" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore#//LicensePlan/description"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore#//LicensePlan/agreements"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ../../org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore#//LicensePlan/features"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ../../org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore#//LicensePlan/personal"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ../../org.eclipse.passage.lic.licenses.ecore/model/licenses.ecore#//LicensePlan/floating"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* <li>{@link org.eclipse.passage.lic.licenses.model.api.LicensePlan#getIdentifier <em>Identifier</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.api.LicensePlan#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.api.LicensePlan#getDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.api.LicensePlan#getAgreements <em>Agreements</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.api.LicensePlan#getFeatures <em>Features</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.api.LicensePlan#getPersonal <em>Personal</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.api.LicensePlan#getFloating <em>Floating</em>}</li>
Expand Down Expand Up @@ -109,6 +110,22 @@ public interface LicensePlan extends EObject, LicensePlanDescriptor {
*/
void setDescription(String value);

/**
* Returns the value of the '<em><b>Agreements</b></em>' attribute list.
* The list contents are of type {@link java.lang.String}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* @since 2.1
* <!-- end-model-doc -->
* @return the value of the '<em>Agreements</em>' attribute list.
* @see org.eclipse.passage.lic.licenses.model.meta.LicensesPackage#getLicensePlan_Agreements()
* @model
* @generated
*/
@Override
EList<String> getAgreements();

/**
* Returns the value of the '<em><b>Features</b></em>' containment reference list.
* The list contents are of type {@link org.eclipse.passage.lic.licenses.model.api.LicensePlanFeature}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;

import org.eclipse.emf.ecore.util.EDataTypeUniqueEList;
import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
import org.eclipse.emf.ecore.util.InternalEList;
Expand All @@ -47,6 +48,7 @@
* <li>{@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanImpl#getIdentifier <em>Identifier</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanImpl#getName <em>Name</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanImpl#getDescription <em>Description</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanImpl#getAgreements <em>Agreements</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanImpl#getFeatures <em>Features</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanImpl#getPersonal <em>Personal</em>}</li>
* <li>{@link org.eclipse.passage.lic.licenses.model.impl.LicensePlanImpl#getFloating <em>Floating</em>}</li>
Expand Down Expand Up @@ -115,6 +117,17 @@ public class LicensePlanImpl extends MinimalEObjectImpl.Container implements Lic
*/
private String description = DESCRIPTION_EDEFAULT;

/**
* The cached value of the '{@link #getAgreements() <em>Agreements</em>}' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @see #getAgreements()
* @since 2.1
* @generated
* @ordered
*/
protected EList<String> agreements;

/**
* The cached value of the '{@link #getFeatures() <em>Features</em>}' containment reference list.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -241,6 +254,20 @@ public void setDescription(String newDescription) {
}
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 2.1
* @generated
*/
@Override
public EList<String> getAgreements() {
if (agreements == null) {
agreements = new EDataTypeUniqueEList<String>(String.class, this, LicensesPackage.LICENSE_PLAN__AGREEMENTS);
}
return agreements;
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Expand Down Expand Up @@ -335,6 +362,8 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) {
return getName();
case LicensesPackage.LICENSE_PLAN__DESCRIPTION:
return getDescription();
case LicensesPackage.LICENSE_PLAN__AGREEMENTS:
return getAgreements();
case LicensesPackage.LICENSE_PLAN__FEATURES:
return getFeatures();
case LicensesPackage.LICENSE_PLAN__PERSONAL:
Expand Down Expand Up @@ -364,6 +393,10 @@ public void eSet(int featureID, Object newValue) {
case LicensesPackage.LICENSE_PLAN__DESCRIPTION:
setDescription((String) newValue);
return;
case LicensesPackage.LICENSE_PLAN__AGREEMENTS:
getAgreements().clear();
getAgreements().addAll((Collection<? extends String>) newValue);
return;
case LicensesPackage.LICENSE_PLAN__FEATURES:
getFeatures().clear();
getFeatures().addAll((Collection<? extends LicensePlanFeature>) newValue);
Expand Down Expand Up @@ -399,6 +432,9 @@ public void eUnset(int featureID) {
case LicensesPackage.LICENSE_PLAN__DESCRIPTION:
setDescription(DESCRIPTION_EDEFAULT);
return;
case LicensesPackage.LICENSE_PLAN__AGREEMENTS:
getAgreements().clear();
return;
case LicensesPackage.LICENSE_PLAN__FEATURES:
getFeatures().clear();
return;
Expand Down Expand Up @@ -428,6 +464,8 @@ public boolean eIsSet(int featureID) {
return !Objects.equals(NAME_EDEFAULT, name);
case LicensesPackage.LICENSE_PLAN__DESCRIPTION:
return !Objects.equals(DESCRIPTION_EDEFAULT, description);
case LicensesPackage.LICENSE_PLAN__AGREEMENTS:
return agreements != null && !agreements.isEmpty();
case LicensesPackage.LICENSE_PLAN__FEATURES:
return features != null && !features.isEmpty();
case LicensesPackage.LICENSE_PLAN__PERSONAL:
Expand Down Expand Up @@ -456,6 +494,8 @@ public String toString() {
result.append(name);
result.append(", description: "); //$NON-NLS-1$
result.append(description);
result.append(", agreements: "); //$NON-NLS-1$
result.append(agreements);
result.append(')');
return result.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,17 @@ public EAttribute getLicensePlan_Description() {
return (EAttribute) licensePlanEClass.getEStructuralFeatures().get(2);
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 2.1
* @generated
*/
@Override
public EAttribute getLicensePlan_Agreements() {
return (EAttribute) licensePlanEClass.getEStructuralFeatures().get(3);
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Expand All @@ -890,7 +901,7 @@ public EAttribute getLicensePlan_Description() {
*/
@Override
public EReference getLicensePlan_Features() {
return (EReference) licensePlanEClass.getEStructuralFeatures().get(3);
return (EReference) licensePlanEClass.getEStructuralFeatures().get(4);
}

/**
Expand All @@ -901,7 +912,7 @@ public EReference getLicensePlan_Features() {
*/
@Override
public EReference getLicensePlan_Personal() {
return (EReference) licensePlanEClass.getEStructuralFeatures().get(4);
return (EReference) licensePlanEClass.getEStructuralFeatures().get(5);
}

/**
Expand All @@ -912,7 +923,7 @@ public EReference getLicensePlan_Personal() {
*/
@Override
public EReference getLicensePlan_Floating() {
return (EReference) licensePlanEClass.getEStructuralFeatures().get(5);
return (EReference) licensePlanEClass.getEStructuralFeatures().get(6);
}

/**
Expand Down Expand Up @@ -2043,6 +2054,7 @@ public void createPackageContents() {
createEAttribute(licensePlanEClass, LICENSE_PLAN__IDENTIFIER);
createEAttribute(licensePlanEClass, LICENSE_PLAN__NAME);
createEAttribute(licensePlanEClass, LICENSE_PLAN__DESCRIPTION);
createEAttribute(licensePlanEClass, LICENSE_PLAN__AGREEMENTS);
createEReference(licensePlanEClass, LICENSE_PLAN__FEATURES);
createEReference(licensePlanEClass, LICENSE_PLAN__PERSONAL);
createEReference(licensePlanEClass, LICENSE_PLAN__FLOATING);
Expand Down Expand Up @@ -2385,6 +2397,9 @@ public void initializePackageContents() {
initEAttribute(getLicensePlan_Description(), ecorePackage.getEString(), "description", null, 0, 1, //$NON-NLS-1$
LicensePlan.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEAttribute(getLicensePlan_Agreements(), ecorePackage.getEString(), "agreements", null, 0, -1, //$NON-NLS-1$
LicensePlan.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);
initEReference(getLicensePlan_Features(), this.getLicensePlanFeature(), this.getLicensePlanFeature_Plan(),
"features", null, 1, -1, LicensePlan.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, //$NON-NLS-1$
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1681,6 +1681,16 @@ public interface LicensesPackage extends EPackage {
*/
int LICENSE_PLAN__DESCRIPTION = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 2;

/**
* The feature id for the '<em><b>Agreements</b></em>' attribute list.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @since 2.1
* @generated
* @ordered
*/
int LICENSE_PLAN__AGREEMENTS = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 3;

/**
* The feature id for the '<em><b>Features</b></em>' containment reference list.
* <!-- begin-user-doc -->
Expand All @@ -1689,7 +1699,7 @@ public interface LicensesPackage extends EPackage {
* @generated
* @ordered
*/
int LICENSE_PLAN__FEATURES = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 3;
int LICENSE_PLAN__FEATURES = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 4;

/**
* The feature id for the '<em><b>Personal</b></em>' containment reference list.
Expand All @@ -1699,7 +1709,7 @@ public interface LicensesPackage extends EPackage {
* @generated
* @ordered
*/
int LICENSE_PLAN__PERSONAL = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 4;
int LICENSE_PLAN__PERSONAL = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 5;

/**
* The feature id for the '<em><b>Floating</b></em>' containment reference list.
Expand All @@ -1709,7 +1719,7 @@ public interface LicensesPackage extends EPackage {
* @generated
* @ordered
*/
int LICENSE_PLAN__FLOATING = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 5;
int LICENSE_PLAN__FLOATING = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 6;

/**
* The number of structural features of the '<em>License Plan</em>' class.
Expand All @@ -1718,7 +1728,7 @@ public interface LicensesPackage extends EPackage {
* @generated
* @ordered
*/
int LICENSE_PLAN_FEATURE_COUNT = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 6;
int LICENSE_PLAN_FEATURE_COUNT = LICENSE_PLAN_DESCRIPTOR_FEATURE_COUNT + 7;

/**
* The number of operations of the '<em>License Plan</em>' class.
Expand Down Expand Up @@ -3342,6 +3352,18 @@ public interface LicensesPackage extends EPackage {
*/
EAttribute getLicensePlan_Description();

/**
* Returns the meta object for the attribute list '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlan#getAgreements <em>Agreements</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute list '<em>Agreements</em>'.
* @see org.eclipse.passage.lic.licenses.model.api.LicensePlan#getAgreements()
* @see #getLicensePlan()
* @since 2.1
* @generated
*/
EAttribute getLicensePlan_Agreements();

/**
* Returns the meta object for the containment reference list '{@link org.eclipse.passage.lic.licenses.model.api.LicensePlan#getFeatures <em>Features</em>}'.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public interface LicensePlanDescriptor {
*/
String getDescription();

/**
* @since 2.1
*/
List<String> getAgreements();

/**
* Returns the <code>"License Plan Features"</code>(s) contained in this license
* plan. This is the value of its <code>"licensePlanFeatures"</code> reference.
Expand Down

0 comments on commit f9c69ce

Please sign in to comment.