Skip to content

Commit

Permalink
Bug 568195 unify issued licenses storage
Browse files Browse the repository at this point in the history
Supply read only interfaces for shipments registry entries

Signed-off-by: eparovyshnaya <[email protected]>
  • Loading branch information
eparovyshnaya committed Apr 5, 2021
1 parent dfef42a commit da7ba9a
Show file tree
Hide file tree
Showing 28 changed files with 759 additions and 97 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ Bundle-Name: %Bundle-Name
Bundle-Vendor: %Bundle-Vendor
Bundle-Copyright: %Bundle-Copyright
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: org.eclipse.passage.lic.shipments;bundle-version="0.1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@
<eStructuralFeatures xsi:type="ecore:EReference" name="licenses" upperBound="-1"
eType="#//FloatingLicense" containment="true"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="PersonalLicense">
<eClassifiers xsi:type="ecore:EClass" name="PersonalLicenseDescriptor" instanceClassName="org.eclipse.passage.lic.shipments.PersonalLicenseDescriptor"
abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="PersonalLicense" eSuperTypes="#//PersonalLicenseDescriptor">
<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="license" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="FloatingLicense">
<eClassifiers xsi:type="ecore:EClass" name="FloatingLicenseDescriptor" instanceClassName="org.eclipse.passage.lic.shipments.FloatingLicenseDescriptor"
abstract="true"/>
<eClassifiers xsi:type="ecore:EClass" name="FloatingLicense" eSuperTypes="#//FloatingLicenseDescriptor">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="company" lowerBound="1"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="license" lowerBound="1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,5 @@ _UI_FloatingLicense_company_feature = Company
_UI_FloatingLicense_license_feature = License
_UI_Unknown_feature = Unspecified
_UI_CreateChild_text = {0}
_UI_PersonalLicenseDescriptor_type = Personal License Descriptor
_UI_FloatingLicenseDescriptor_type = Floating License Descriptor
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*******************************************************************************
* Copyright (c) 2018, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.lic.shipments.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.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.ItemProviderAdapter;

import org.eclipse.passage.lic.shipments.edit.ShipmentsEditPlugin;

/**
* This is the item provider adapter for a {@link org.eclipse.passage.lic.shipments.FloatingLicenseDescriptor} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class FloatingLicenseDescriptorItemProvider 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 FloatingLicenseDescriptorItemProvider(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);

}
return itemPropertyDescriptors;
}

/**
* <!-- 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) {
return getString("_UI_FloatingLicenseDescriptor_type"); //$NON-NLS-1$
}

/**
* 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);
}

/**
* 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 ShipmentsEditPlugin.INSTANCE;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,9 @@

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.passage.lic.shipments.edit.ShipmentsEditPlugin;

import org.eclipse.passage.lic.shipments.model.api.FloatingLicense;

import org.eclipse.passage.lic.shipments.model.meta.ShipmentsPackage;
Expand All @@ -42,8 +30,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class FloatingLicenseItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
public class FloatingLicenseItemProvider extends FloatingLicenseDescriptorItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -150,15 +137,4 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors
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 ShipmentsEditPlugin.INSTANCE;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/*******************************************************************************
* Copyright (c) 2018, 2021 ArSysOp
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* https://www.eclipse.org/legal/epl-2.0/.
*
* SPDX-License-Identifier: EPL-2.0
*
* Contributors:
* ArSysOp - initial API and implementation
*******************************************************************************/
package org.eclipse.passage.lic.shipments.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.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.ItemProviderAdapter;

import org.eclipse.passage.lic.shipments.edit.ShipmentsEditPlugin;

/**
* This is the item provider adapter for a {@link org.eclipse.passage.lic.shipments.PersonalLicenseDescriptor} object.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
public class PersonalLicenseDescriptorItemProvider 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 PersonalLicenseDescriptorItemProvider(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);

}
return itemPropertyDescriptors;
}

/**
* <!-- 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) {
return getString("_UI_PersonalLicenseDescriptor_type"); //$NON-NLS-1$
}

/**
* 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);
}

/**
* 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 ShipmentsEditPlugin.INSTANCE;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,9 @@

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.passage.lic.shipments.edit.ShipmentsEditPlugin;

import org.eclipse.passage.lic.shipments.model.api.PersonalLicense;

import org.eclipse.passage.lic.shipments.model.meta.ShipmentsPackage;
Expand All @@ -42,8 +30,7 @@
* <!-- end-user-doc -->
* @generated
*/
public class PersonalLicenseItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider,
IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource {
public class PersonalLicenseItemProvider extends PersonalLicenseDescriptorItemProvider {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
Expand Down Expand Up @@ -150,15 +137,4 @@ protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors
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 ShipmentsEditPlugin.INSTANCE;
}

}
Loading

0 comments on commit da7ba9a

Please sign in to comment.