Skip to content

Commit

Permalink
Bug 568711 Design model for grant acquisition
Browse files Browse the repository at this point in the history
GrantAquisition class is identified, binds FeatureGrant, User and actual
acquisition date

Signed-off-by: eparovyshnaya <[email protected]>
  • Loading branch information
eparovyshnaya committed Nov 11, 2020
1 parent 263f6a7 commit cf4902f
Show file tree
Hide file tree
Showing 15 changed files with 1,113 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,14 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="authentication" ordered="false"
unique="false" lowerBound="1" eType="#//EvaluationInstructions" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="GrantAcqisition">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="identifier" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="feature" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="grant" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="user" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="created" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EDate"/>
</eClassifiers>
</ecore:EPackage>
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,9 @@ _UI_FloatingLicenseAccess_originLicensePack_feature = Origin License Pack
_UI_FloatingServerConnection_ip_feature = Ip
_UI_FloatingServerConnection_port_feature = Port
_UI_FloatingServerConnection_authentication_feature = Authentication
_UI_GrantAcqisition_type = Grant Acqisition
_UI_GrantAcqisition_identifier_feature = Identifier
_UI_GrantAcqisition_feature_feature = Feature
_UI_GrantAcqisition_grant_feature = Grant
_UI_GrantAcqisition_user_feature = User
_UI_GrantAcqisition_created_feature = Created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,29 @@ public Adapter createFloatingServerConnectionAdapter() {
return floatingServerConnectionItemProvider;
}

/**
* This keeps track of the one adapter used for all {@link org.eclipse.passage.lic.floating.model.api.GrantAcqisition} instances.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected GrantAcqisitionItemProvider grantAcqisitionItemProvider;

/**
* This creates an adapter for a {@link org.eclipse.passage.lic.floating.model.api.GrantAcqisition}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public Adapter createGrantAcqisitionAdapter() {
if (grantAcqisitionItemProvider == null) {
grantAcqisitionItemProvider = new GrantAcqisitionItemProvider(this);
}

return grantAcqisitionItemProvider;
}

/**
* This returns the root adapter factory that contains this factory.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -460,6 +483,8 @@ public void dispose() {
floatingLicenseAccessItemProvider.dispose();
if (floatingServerConnectionItemProvider != null)
floatingServerConnectionItemProvider.dispose();
if (grantAcqisitionItemProvider != null)
grantAcqisitionItemProvider.dispose();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
/**
*/
package org.eclipse.passage.lic.floating.edit.providers;

import java.util.Collection;
import java.util.List;

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

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

import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;

import org.eclipse.passage.lic.floating.edit.FLoatingLicensesEditPlugin;

import org.eclipse.passage.lic.floating.model.api.GrantAcqisition;

import org.eclipse.passage.lic.floating.model.meta.FloatingPackage;

/**
* This is the item provider adapter for a {@link org.eclipse.passage.lic.floating.model.api.GrantAcqisition} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class GrantAcqisitionItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public GrantAcqisitionItemProvider(AdapterFactory adapterFactory) {
super(adapterFactory);
}

/**
* This returns the property descriptors for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
if (itemPropertyDescriptors == null) {
super.getPropertyDescriptors(object);

addIdentifierPropertyDescriptor(object);
addFeaturePropertyDescriptor(object);
addGrantPropertyDescriptor(object);
addUserPropertyDescriptor(object);
addCreatedPropertyDescriptor(object);
}
return itemPropertyDescriptors;
}

/**
* This adds a property descriptor for the Identifier feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addIdentifierPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_GrantAcqisition_identifier_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_GrantAcqisition_identifier_feature", //$NON-NLS-1$//$NON-NLS-2$
"_UI_GrantAcqisition_type"), //$NON-NLS-1$
FloatingPackage.eINSTANCE.getGrantAcqisition_Identifier(), true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Feature feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addFeaturePropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_GrantAcqisition_feature_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_GrantAcqisition_feature_feature", //$NON-NLS-1$//$NON-NLS-2$
"_UI_GrantAcqisition_type"), //$NON-NLS-1$
FloatingPackage.eINSTANCE.getGrantAcqisition_Feature(), true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Grant feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addGrantPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_GrantAcqisition_grant_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_GrantAcqisition_grant_feature", //$NON-NLS-1$//$NON-NLS-2$
"_UI_GrantAcqisition_type"), //$NON-NLS-1$
FloatingPackage.eINSTANCE.getGrantAcqisition_Grant(), true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the User feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addUserPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_GrantAcqisition_user_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_GrantAcqisition_user_feature", //$NON-NLS-1$//$NON-NLS-2$
"_UI_GrantAcqisition_type"), //$NON-NLS-1$
FloatingPackage.eINSTANCE.getGrantAcqisition_User(), true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* This adds a property descriptor for the Created feature.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void addCreatedPropertyDescriptor(Object object) {
itemPropertyDescriptors
.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
getResourceLocator(), getString("_UI_GrantAcqisition_created_feature"), //$NON-NLS-1$
getString("_UI_PropertyDescriptor_description", "_UI_GrantAcqisition_created_feature", //$NON-NLS-1$//$NON-NLS-2$
"_UI_GrantAcqisition_type"), //$NON-NLS-1$
FloatingPackage.eINSTANCE.getGrantAcqisition_Created(), true, false, false,
ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null));
}

/**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected boolean shouldComposeCreationImage() {
return true;
}

/**
* This returns the label text for the adapted class.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public String getText(Object object) {
String label = ((GrantAcqisition) object).getIdentifier();
return label == null || label.length() == 0 ? getString("_UI_GrantAcqisition_type") : //$NON-NLS-1$
getString("_UI_GrantAcqisition_type") + " " + label; //$NON-NLS-1$ //$NON-NLS-2$
}

/**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);

switch (notification.getFeatureID(GrantAcqisition.class)) {
case FloatingPackage.GRANT_ACQISITION__IDENTIFIER:
case FloatingPackage.GRANT_ACQISITION__FEATURE:
case FloatingPackage.GRANT_ACQISITION__GRANT:
case FloatingPackage.GRANT_ACQISITION__USER:
case FloatingPackage.GRANT_ACQISITION__CREATED:
fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
return;
default:
super.notifyChanged(notification);
return;
}
}

/**
* This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children
* that can be created under this object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) {
super.collectNewChildDescriptors(newChildDescriptors, object);
}

/**
* Return the resource locator for this item provider's resources.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
public ResourceLocator getResourceLocator() {
return FLoatingLicensesEditPlugin.INSTANCE;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Export-Package: org.eclipse.passage.lic.floating.model.api;
org.eclipse.passage.loc.licenses.core,
org.eclipse.passage.loc.floating.emfforms,
org.eclipse.passage.loc.dashboard.ui",
org.eclipse.passage.lic.floating.model.util;x-friends:="org.eclipse.passage.lic.floating.edit"
org.eclipse.passage.lic.floating.model.util;
x-friends:="org.eclipse.passage.lic.floating.edit"
Bundle-ClassPath: .
Bundle-ActivationPolicy: lazy
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,12 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.floating.ecore/model/floating.ecore#//FloatingServerConnection/port"/>
<genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference ../../org.eclipse.passage.lic.floating.ecore/model/floating.ecore#//FloatingServerConnection/authentication"/>
</genClasses>
<genClasses image="false" ecoreClass="../../org.eclipse.passage.lic.floating.ecore/model/floating.ecore#//GrantAcqisition">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.floating.ecore/model/floating.ecore#//GrantAcqisition/identifier"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.floating.ecore/model/floating.ecore#//GrantAcqisition/feature"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.floating.ecore/model/floating.ecore#//GrantAcqisition/grant"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.floating.ecore/model/floating.ecore#//GrantAcqisition/user"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.passage.lic.floating.ecore/model/floating.ecore#//GrantAcqisition/created"/>
</genClasses>
</genPackages>
</genmodel:GenModel>
Loading

0 comments on commit cf4902f

Please sign in to comment.