Skip to content

Commit

Permalink
Merge pull request #874 from eclipse-passage/575166
Browse files Browse the repository at this point in the history
Bug 575166 License Agreement management: license issuing
  • Loading branch information
eparovyshnaya authored Aug 16, 2021
2 parents f69bfad + 3327aa4 commit 3ba9d99
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 136 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,5 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="feature" lowerBound="1"
eType="#//Feature" eOpposite="#//Feature/featureVersions"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="news" 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.0"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>
</ecore:EPackage>
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {

addVersionPropertyDescriptor(object);
addNewsPropertyDescriptor(object);
addAgreementsPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}
Expand Down Expand Up @@ -106,23 +105,6 @@ protected void addNewsPropertyDescriptor(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.0
* @generated
*/
protected void addAgreementsPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_FeatureVersion_agreements_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_FeatureVersion_agreements_feature", //$NON-NLS-1$//$NON-NLS-2$
"_UI_FeatureVersion_type"), //$NON-NLS-1$
FeaturesPackage.eINSTANCE.getFeatureVersion_Agreements(), true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This returns Feature.gif.
*
Expand Down Expand Up @@ -187,7 +169,6 @@ public void notifyChanged(Notification notification) {
switch (notification.getFeatureID(FeatureVersion.class)) {
case FeaturesPackage.FEATURE_VERSION__VERSION:
case FeaturesPackage.FEATURE_VERSION__NEWS:
case FeaturesPackage.FEATURE_VERSION__AGREEMENTS:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.features.ecore/model/features.ecore#//FeatureVersion/version"/>
<genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference ../../org.eclipse.passage.lic.features.ecore/model/features.ecore#//FeatureVersion/feature"/>
<genFeatures createChild="false" propertyMultiLine="true" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.features.ecore/model/features.ecore#//FeatureVersion/news"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.features.ecore/model/features.ecore#//FeatureVersion/agreements"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
*******************************************************************************/
package org.eclipse.passage.lic.features.model.api;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EObject;

import org.eclipse.passage.lic.features.FeatureVersionDescriptor;
Expand All @@ -30,7 +28,6 @@
* <li>{@link org.eclipse.passage.lic.features.model.api.FeatureVersion#getVersion <em>Version</em>}</li>
* <li>{@link org.eclipse.passage.lic.features.model.api.FeatureVersion#getFeature <em>Feature</em>}</li>
* <li>{@link org.eclipse.passage.lic.features.model.api.FeatureVersion#getNews <em>News</em>}</li>
* <li>{@link org.eclipse.passage.lic.features.model.api.FeatureVersion#getAgreements <em>Agreements</em>}</li>
* </ul>
*
* @see org.eclipse.passage.lic.features.model.meta.FeaturesPackage#getFeatureVersion()
Expand Down Expand Up @@ -109,20 +106,4 @@ public interface FeatureVersion extends EObject, FeatureVersionDescriptor {
*/
void setNews(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.0
* <!-- end-model-doc -->
* @return the value of the '<em>Agreements</em>' attribute list.
* @see org.eclipse.passage.lic.features.model.meta.FeaturesPackage#getFeatureVersion_Agreements()
* @model
* @generated
*/
@Override
EList<String> getAgreements();

} // FeatureVersion
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,15 @@
*******************************************************************************/
package org.eclipse.passage.lic.features.model.impl;

import java.util.Collection;
import java.util.Objects;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

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.EcoreUtil;

import org.eclipse.passage.lic.features.model.api.Feature;
Expand All @@ -45,7 +39,6 @@
* <li>{@link org.eclipse.passage.lic.features.model.impl.FeatureVersionImpl#getVersion <em>Version</em>}</li>
* <li>{@link org.eclipse.passage.lic.features.model.impl.FeatureVersionImpl#getFeature <em>Feature</em>}</li>
* <li>{@link org.eclipse.passage.lic.features.model.impl.FeatureVersionImpl#getNews <em>News</em>}</li>
* <li>{@link org.eclipse.passage.lic.features.model.impl.FeatureVersionImpl#getAgreements <em>Agreements</em>}</li>
* </ul>
*
* @generated
Expand Down Expand Up @@ -91,17 +84,6 @@ public class FeatureVersionImpl extends MinimalEObjectImpl.Container implements
*/
private String news = NEWS_EDEFAULT;

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

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Expand Down Expand Up @@ -222,21 +204,6 @@ public void setNews(String newNews) {
}
}

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

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Expand Down Expand Up @@ -300,8 +267,6 @@ public Object eGet(int featureID, boolean resolve, boolean coreType) {
return getFeature();
case FeaturesPackage.FEATURE_VERSION__NEWS:
return getNews();
case FeaturesPackage.FEATURE_VERSION__AGREEMENTS:
return getAgreements();
default:
return super.eGet(featureID, resolve, coreType);
}
Expand All @@ -325,10 +290,6 @@ public void eSet(int featureID, Object newValue) {
case FeaturesPackage.FEATURE_VERSION__NEWS:
setNews((String) newValue);
return;
case FeaturesPackage.FEATURE_VERSION__AGREEMENTS:
getAgreements().clear();
getAgreements().addAll((Collection<? extends String>) newValue);
return;
default:
super.eSet(featureID, newValue);
return;
Expand All @@ -352,9 +313,6 @@ public void eUnset(int featureID) {
case FeaturesPackage.FEATURE_VERSION__NEWS:
setNews(NEWS_EDEFAULT);
return;
case FeaturesPackage.FEATURE_VERSION__AGREEMENTS:
getAgreements().clear();
return;
default:
super.eUnset(featureID);
return;
Expand All @@ -375,8 +333,6 @@ public boolean eIsSet(int featureID) {
return getFeature() != null;
case FeaturesPackage.FEATURE_VERSION__NEWS:
return !Objects.equals(NEWS_EDEFAULT, news);
case FeaturesPackage.FEATURE_VERSION__AGREEMENTS:
return agreements != null && !agreements.isEmpty();
default:
return super.eIsSet(featureID);
}
Expand All @@ -397,8 +353,6 @@ public String toString() {
result.append(version);
result.append(", news: "); //$NON-NLS-1$
result.append(news);
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 @@ -333,17 +333,6 @@ public EAttribute getFeatureVersion_News() {
return (EAttribute) featureVersionEClass.getEStructuralFeatures().get(2);
}

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

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
Expand Down Expand Up @@ -398,7 +387,6 @@ public void createPackageContents() {
createEAttribute(featureVersionEClass, FEATURE_VERSION__VERSION);
createEReference(featureVersionEClass, FEATURE_VERSION__FEATURE);
createEAttribute(featureVersionEClass, FEATURE_VERSION__NEWS);
createEAttribute(featureVersionEClass, FEATURE_VERSION__AGREEMENTS);
}

/**
Expand Down Expand Up @@ -484,9 +472,6 @@ public void initializePackageContents() {
!IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getFeatureVersion_News(), ecorePackage.getEString(), "news", null, 0, 1, FeatureVersion.class, //$NON-NLS-1$
!IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getFeatureVersion_Agreements(), ecorePackage.getEString(), "agreements", null, 0, -1, //$NON-NLS-1$
FeatureVersion.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
!IS_DERIVED, IS_ORDERED);

// Create resource
createResource(eNS_URI);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,24 +333,14 @@ public interface FeaturesPackage extends EPackage {
*/
int FEATURE_VERSION__NEWS = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 2;

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

/**
* The number of structural features of the '<em>Feature Version</em>' class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
* @ordered
*/
int FEATURE_VERSION_FEATURE_COUNT = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 4;
int FEATURE_VERSION_FEATURE_COUNT = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 3;

/**
* The number of operations of the '<em>Feature Version</em>' class.
Expand Down Expand Up @@ -567,18 +557,6 @@ public interface FeaturesPackage extends EPackage {
*/
EAttribute getFeatureVersion_News();

/**
* Returns the meta object for the attribute list '{@link org.eclipse.passage.lic.features.model.api.FeatureVersion#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.features.model.api.FeatureVersion#getAgreements()
* @see #getFeatureVersion()
* @since 2.0
* @generated
*/
EAttribute getFeatureVersion_Agreements();

/**
* Returns the factory that creates the instances of the model.
* <!-- begin-user-doc -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
*******************************************************************************/
package org.eclipse.passage.lic.features;

import java.util.List;

/**
* <p>
* The <code>"Feature Version"</code> is a state of your <code>"Feature"</code>
Expand Down Expand Up @@ -43,9 +41,4 @@ public interface FeatureVersionDescriptor {

FeatureDescriptor getFeature();

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

}

0 comments on commit 3ba9d99

Please sign in to comment.