From f1486156b61fc09c3a53891a171e385f86534762 Mon Sep 17 00:00:00 2001 From: Alexander Fedorov Date: Tue, 30 Apr 2024 20:18:05 +0300 Subject: [PATCH] [#1346] Remove RO descriptors layer apply to features Signed-off-by: Alexander Fedorov --- .../model/features.ecore | 14 +- .../plugin.properties | 13 +- .../plugin.xml | 2 +- .../model/features.genmodel | 5 +- .../plugin.xml | 5 +- .../lic/features/model/api/Feature.java | 15 +- .../lic/features/model/api/FeatureSet.java | 13 +- .../features/model/api/FeatureVersion.java | 11 +- .../lic/features/model/impl/FeatureImpl.java | 10 +- .../features/model/impl/FeatureSetImpl.java | 10 +- .../model/impl/FeatureVersionImpl.java | 4 +- .../model/impl/FeaturesFactoryImpl.java | 12 +- .../model/impl/FeaturesPackageImpl.java | 80 +------- .../features/model/meta/FeaturesFactory.java | 5 +- .../features/model/meta/FeaturesPackage.java | 167 +++-------------- .../model/util/FeaturesAdapterFactory.java | 73 +------- .../util/FeaturesResourceFactoryImpl.java | 4 +- .../model/util/FeaturesResourceImpl.java | 4 +- .../features/model/util/FeaturesSwitch.java | 87 +-------- .../features/model/FeaturesClassMetadata.java | 8 +- .../migration/FeaturesResourceHandler.java | 9 +- .../.classpath | 1 - .../org.eclipse.passage.lic.features/.project | 6 - .../META-INF/MANIFEST.MF | 1 - .../build.properties | 4 +- .../lic/features/FeatureDescriptor.java | 66 ------- .../lic/features/FeatureSetDescriptor.java | 50 ----- .../features/FeatureVersionDescriptor.java | 44 ----- .../ui/panel/DashboardPanelPart.java | 18 +- .../panel/DefaultDashboardPanelAdvisor.java | 6 +- ...s.core.FeaturesSelectionCommandAdvisor.xml | 4 +- .../internal/features/FeatureRegistry.java | 37 ++-- .../features/core/FeatureDomainRegistry.java | 176 ++++++------------ .../core/FeaturesDomainRegistryTracker.java | 5 +- .../core/FeaturesSelectionCommandAdvisor.java | 16 +- .../renderers/FeatureIdentifierRenderer.java | 10 +- .../passage/loc/features/ui/FeaturesUi.java | 9 +- .../passage/loc/workbench/LocWokbench.java | 3 - .../tests/FeaturesClassMetadataTest.java | 5 - 39 files changed, 186 insertions(+), 826 deletions(-) delete mode 100644 bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureDescriptor.java delete mode 100644 bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureSetDescriptor.java delete mode 100644 bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureVersionDescriptor.java diff --git a/bundles/org.eclipse.passage.lic.features.ecore/model/features.ecore b/bundles/org.eclipse.passage.lic.features.ecore/model/features.ecore index 25fe15145..5d11a7e0b 100644 --- a/bundles/org.eclipse.passage.lic.features.ecore/model/features.ecore +++ b/bundles/org.eclipse.passage.lic.features.ecore/model/features.ecore @@ -1,14 +1,8 @@ - - - - + @@ -16,7 +10,7 @@ - + @@ -27,7 +21,7 @@ - + @@ -18,9 +18,6 @@ classPackageSuffix="model.impl" utilityPackageSuffix="model.util" providerPackageSuffix="edit.providers" presentationPackageSuffix="editor" testsPackageSuffix="model.tests" literalsInterface="false" ecorePackage="../../org.eclipse.passage.lic.features.ecore/model/features.ecore#/"> - - - diff --git a/bundles/org.eclipse.passage.lic.features.model/plugin.xml b/bundles/org.eclipse.passage.lic.features.model/plugin.xml index c6e134580..f4fdd32a2 100644 --- a/bundles/org.eclipse.passage.lic.features.model/plugin.xml +++ b/bundles/org.eclipse.passage.lic.features.model/plugin.xml @@ -18,7 +18,7 @@ @@ -28,9 +28,6 @@ - diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/Feature.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/Feature.java index ef01a0944..978a0c731 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/Feature.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/Feature.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,11 +13,8 @@ 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.FeatureDescriptor; - /** * * A representation of the model object 'Feature'. @@ -36,10 +33,10 @@ * * * @see org.eclipse.passage.lic.features.model.meta.FeaturesPackage#getFeature() - * @model superTypes="org.eclipse.passage.lic.features.model.api.FeatureDescriptor" + * @model * @generated */ -public interface Feature extends EObject, FeatureDescriptor { +public interface Feature extends EObject { /** * Returns the value of the 'Identifier' attribute. * @@ -50,7 +47,6 @@ public interface Feature extends EObject, FeatureDescriptor { * @model required="true" * @generated */ - @Override String getIdentifier(); /** @@ -73,7 +69,6 @@ public interface Feature extends EObject, FeatureDescriptor { * @model * @generated */ - @Override String getProvider(); /** @@ -96,7 +91,6 @@ public interface Feature extends EObject, FeatureDescriptor { * @model * @generated */ - @Override String getName(); /** @@ -119,7 +113,6 @@ public interface Feature extends EObject, FeatureDescriptor { * @model * @generated */ - @Override String getDescription(); /** @@ -144,7 +137,6 @@ public interface Feature extends EObject, FeatureDescriptor { * @model opposite="features" required="true" transient="false" * @generated */ - @Override FeatureSet getFeatureSet(); /** @@ -169,7 +161,6 @@ public interface Feature extends EObject, FeatureDescriptor { * @model opposite="feature" containment="true" * @generated */ - @Override EList getFeatureVersions(); } // Feature diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureSet.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureSet.java index a9e91b59c..fce32728a 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureSet.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureSet.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,11 +13,8 @@ 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.FeatureSetDescriptor; - /** * * A representation of the model object 'Feature Set'. @@ -34,10 +31,10 @@ * * * @see org.eclipse.passage.lic.features.model.meta.FeaturesPackage#getFeatureSet() - * @model superTypes="org.eclipse.passage.lic.features.model.api.FeatureSetDescriptor" + * @model * @generated */ -public interface FeatureSet extends EObject, FeatureSetDescriptor { +public interface FeatureSet extends EObject { /** * Returns the value of the 'Identifier' attribute. * @@ -48,7 +45,6 @@ public interface FeatureSet extends EObject, FeatureSetDescriptor { * @model required="true" * @generated */ - @Override String getIdentifier(); /** @@ -71,7 +67,6 @@ public interface FeatureSet extends EObject, FeatureSetDescriptor { * @model * @generated */ - @Override String getName(); /** @@ -94,7 +89,6 @@ public interface FeatureSet extends EObject, FeatureSetDescriptor { * @model * @generated */ - @Override String getDescription(); /** @@ -119,7 +113,6 @@ public interface FeatureSet extends EObject, FeatureSetDescriptor { * @model opposite="featureSet" containment="true" * @generated */ - @Override EList getFeatures(); } // FeatureSet diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureVersion.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureVersion.java index a55fad3e2..1ae8dd8a6 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureVersion.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/api/FeatureVersion.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -14,8 +14,6 @@ import org.eclipse.emf.ecore.EObject; -import org.eclipse.passage.lic.features.FeatureVersionDescriptor; - /** * * A representation of the model object 'Feature Version'. @@ -31,10 +29,10 @@ * * * @see org.eclipse.passage.lic.features.model.meta.FeaturesPackage#getFeatureVersion() - * @model superTypes="org.eclipse.passage.lic.features.model.api.FeatureVersionDescriptor" + * @model * @generated */ -public interface FeatureVersion extends EObject, FeatureVersionDescriptor { +public interface FeatureVersion extends EObject { /** * Returns the value of the 'Version' attribute. * @@ -45,7 +43,6 @@ public interface FeatureVersion extends EObject, FeatureVersionDescriptor { * @model required="true" * @generated */ - @Override String getVersion(); /** @@ -70,7 +67,6 @@ public interface FeatureVersion extends EObject, FeatureVersionDescriptor { * @model opposite="featureVersions" required="true" transient="false" * @generated */ - @Override Feature getFeature(); /** @@ -93,7 +89,6 @@ public interface FeatureVersion extends EObject, FeatureVersionDescriptor { * @model * @generated */ - @Override String getNews(); /** diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureImpl.java index 8b5e1a389..8db5795fc 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,23 +17,17 @@ 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.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.InternalEList; - import org.eclipse.passage.lic.features.model.api.Feature; import org.eclipse.passage.lic.features.model.api.FeatureSet; import org.eclipse.passage.lic.features.model.api.FeatureVersion; - import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; /** @@ -521,4 +515,4 @@ public String toString() { return result.toString(); } -} //FeatureImpl +} // FeatureImpl diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureSetImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureSetImpl.java index 04bf997e5..38c39f258 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureSetImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureSetImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,21 +17,15 @@ 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.EObjectContainmentWithInverseEList; import org.eclipse.emf.ecore.util.InternalEList; - import org.eclipse.passage.lic.features.model.api.Feature; import org.eclipse.passage.lic.features.model.api.FeatureSet; - import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; /** @@ -376,4 +370,4 @@ public String toString() { return result.toString(); } -} //FeatureSetImpl +} // FeatureSetImpl diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureVersionImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureVersionImpl.java index c54b43cce..32550d4ae 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureVersionImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeatureVersionImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -353,4 +353,4 @@ public String toString() { return result.toString(); } -} //FeatureVersionImpl +} // FeatureVersionImpl diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesFactoryImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesFactoryImpl.java index 7148c1a9b..1a7f8e361 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesFactoryImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesFactoryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -15,13 +15,11 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; - import org.eclipse.emf.ecore.impl.EFactoryImpl; - import org.eclipse.emf.ecore.plugin.EcorePlugin; - -import org.eclipse.passage.lic.features.model.api.*; - +import org.eclipse.passage.lic.features.model.api.Feature; +import org.eclipse.passage.lic.features.model.api.FeatureSet; +import org.eclipse.passage.lic.features.model.api.FeatureVersion; import org.eclipse.passage.lic.features.model.meta.FeaturesFactory; import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; @@ -134,4 +132,4 @@ public static FeaturesPackage getPackage() { return FeaturesPackage.eINSTANCE; } -} //FeaturesFactoryImpl +} // FeaturesFactoryImpl diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesPackageImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesPackageImpl.java index 45b3bf5b7..95848c05c 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesPackageImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/impl/FeaturesPackageImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -16,17 +16,10 @@ import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; - import org.eclipse.emf.ecore.impl.EPackageImpl; - -import org.eclipse.passage.lic.features.FeatureDescriptor; -import org.eclipse.passage.lic.features.FeatureSetDescriptor; -import org.eclipse.passage.lic.features.FeatureVersionDescriptor; - import org.eclipse.passage.lic.features.model.api.Feature; import org.eclipse.passage.lic.features.model.api.FeatureSet; import org.eclipse.passage.lic.features.model.api.FeatureVersion; - import org.eclipse.passage.lic.features.model.meta.FeaturesFactory; import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; @@ -37,27 +30,6 @@ * @generated */ public class FeaturesPackageImpl extends EPackageImpl implements FeaturesPackage { - /** - * - * - * @generated - */ - private EClass featureSetDescriptorEClass = null; - - /** - * - * - * @generated - */ - private EClass featureDescriptorEClass = null; - - /** - * - * - * @generated - */ - private EClass featureVersionDescriptorEClass = null; - /** * * @@ -143,36 +115,6 @@ public static FeaturesPackage init() { return theFeaturesPackage; } - /** - * - * - * @generated - */ - @Override - public EClass getFeatureSetDescriptor() { - return featureSetDescriptorEClass; - } - - /** - * - * - * @generated - */ - @Override - public EClass getFeatureDescriptor() { - return featureDescriptorEClass; - } - - /** - * - * - * @generated - */ - @Override - public EClass getFeatureVersionDescriptor() { - return featureVersionDescriptorEClass; - } - /** * * @@ -363,12 +305,6 @@ public void createPackageContents() { isCreated = true; // Create classes and their features - featureSetDescriptorEClass = createEClass(FEATURE_SET_DESCRIPTOR); - - featureDescriptorEClass = createEClass(FEATURE_DESCRIPTOR); - - featureVersionDescriptorEClass = createEClass(FEATURE_VERSION_DESCRIPTOR); - featureSetEClass = createEClass(FEATURE_SET); createEAttribute(featureSetEClass, FEATURE_SET__IDENTIFIER); createEAttribute(featureSetEClass, FEATURE_SET__NAME); @@ -418,20 +354,8 @@ public void initializePackageContents() { // Set bounds for type parameters // Add supertypes to classes - featureSetEClass.getESuperTypes().add(this.getFeatureSetDescriptor()); - featureEClass.getESuperTypes().add(this.getFeatureDescriptor()); - featureVersionEClass.getESuperTypes().add(this.getFeatureVersionDescriptor()); // Initialize classes, features, and operations; add parameters - initEClass(featureSetDescriptorEClass, FeatureSetDescriptor.class, "FeatureSetDescriptor", IS_ABSTRACT, //$NON-NLS-1$ - IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - - initEClass(featureDescriptorEClass, FeatureDescriptor.class, "FeatureDescriptor", IS_ABSTRACT, IS_INTERFACE, //$NON-NLS-1$ - !IS_GENERATED_INSTANCE_CLASS); - - initEClass(featureVersionDescriptorEClass, FeatureVersionDescriptor.class, "FeatureVersionDescriptor", //$NON-NLS-1$ - IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - initEClass(featureSetEClass, FeatureSet.class, "FeatureSet", !IS_ABSTRACT, !IS_INTERFACE, //$NON-NLS-1$ IS_GENERATED_INSTANCE_CLASS); initEAttribute(getFeatureSet_Identifier(), ecorePackage.getEString(), "identifier", null, 1, 1, //$NON-NLS-1$ @@ -477,4 +401,4 @@ public void initializePackageContents() { createResource(eNS_URI); } -} //FeaturesPackageImpl +} // FeaturesPackageImpl diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesFactory.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesFactory.java index 65f71d340..5bf9d1f00 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesFactory.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,7 +13,6 @@ package org.eclipse.passage.lic.features.model.meta; import org.eclipse.emf.ecore.EFactory; - import org.eclipse.passage.lic.features.model.api.Feature; import org.eclipse.passage.lic.features.model.api.FeatureSet; import org.eclipse.passage.lic.features.model.api.FeatureVersion; @@ -71,4 +70,4 @@ public interface FeaturesFactory extends EFactory { */ FeaturesPackage getFeaturesPackage(); -} //FeaturesFactory +} // FeaturesFactory diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesPackage.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesPackage.java index e6303077e..e3deef7f6 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesPackage.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/meta/FeaturesPackage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -48,7 +48,7 @@ public interface FeaturesPackage extends EPackage { * * @generated */ - String eNS_URI = "http://www.eclipse.org/passage/lic/features/2.0.0"; //$NON-NLS-1$ + String eNS_URI = "http://www.eclipse.org/passage/lic/features/3.0.0"; //$NON-NLS-1$ /** * The package namespace name. @@ -66,90 +66,6 @@ public interface FeaturesPackage extends EPackage { */ FeaturesPackage eINSTANCE = org.eclipse.passage.lic.features.model.impl.FeaturesPackageImpl.init(); - /** - * The meta object id for the '{@link org.eclipse.passage.lic.features.FeatureSetDescriptor Feature Set Descriptor}' class. - * - * - * @see org.eclipse.passage.lic.features.FeatureSetDescriptor - * @see org.eclipse.passage.lic.features.model.impl.FeaturesPackageImpl#getFeatureSetDescriptor() - * @generated - */ - int FEATURE_SET_DESCRIPTOR = 0; - - /** - * The number of structural features of the 'Feature Set Descriptor' class. - * - * - * @generated - * @ordered - */ - int FEATURE_SET_DESCRIPTOR_FEATURE_COUNT = 0; - - /** - * The number of operations of the 'Feature Set Descriptor' class. - * - * - * @generated - * @ordered - */ - int FEATURE_SET_DESCRIPTOR_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.passage.lic.features.FeatureDescriptor Feature Descriptor}' class. - * - * - * @see org.eclipse.passage.lic.features.FeatureDescriptor - * @see org.eclipse.passage.lic.features.model.impl.FeaturesPackageImpl#getFeatureDescriptor() - * @generated - */ - int FEATURE_DESCRIPTOR = 1; - - /** - * The number of structural features of the 'Feature Descriptor' class. - * - * - * @generated - * @ordered - */ - int FEATURE_DESCRIPTOR_FEATURE_COUNT = 0; - - /** - * The number of operations of the 'Feature Descriptor' class. - * - * - * @generated - * @ordered - */ - int FEATURE_DESCRIPTOR_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link org.eclipse.passage.lic.features.FeatureVersionDescriptor Feature Version Descriptor}' class. - * - * - * @see org.eclipse.passage.lic.features.FeatureVersionDescriptor - * @see org.eclipse.passage.lic.features.model.impl.FeaturesPackageImpl#getFeatureVersionDescriptor() - * @generated - */ - int FEATURE_VERSION_DESCRIPTOR = 2; - - /** - * The number of structural features of the 'Feature Version Descriptor' class. - * - * - * @generated - * @ordered - */ - int FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT = 0; - - /** - * The number of operations of the 'Feature Version Descriptor' class. - * - * - * @generated - * @ordered - */ - int FEATURE_VERSION_DESCRIPTOR_OPERATION_COUNT = 0; - /** * The meta object id for the '{@link org.eclipse.passage.lic.features.model.impl.FeatureSetImpl Feature Set}' class. * @@ -158,7 +74,7 @@ public interface FeaturesPackage extends EPackage { * @see org.eclipse.passage.lic.features.model.impl.FeaturesPackageImpl#getFeatureSet() * @generated */ - int FEATURE_SET = 3; + int FEATURE_SET = 0; /** * The feature id for the 'Identifier' attribute. @@ -167,7 +83,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_SET__IDENTIFIER = FEATURE_SET_DESCRIPTOR_FEATURE_COUNT + 0; + int FEATURE_SET__IDENTIFIER = 0; /** * The feature id for the 'Name' attribute. @@ -176,7 +92,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_SET__NAME = FEATURE_SET_DESCRIPTOR_FEATURE_COUNT + 1; + int FEATURE_SET__NAME = 1; /** * The feature id for the 'Description' attribute. @@ -185,7 +101,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_SET__DESCRIPTION = FEATURE_SET_DESCRIPTOR_FEATURE_COUNT + 2; + int FEATURE_SET__DESCRIPTION = 2; /** * The feature id for the 'Features' containment reference list. @@ -194,7 +110,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_SET__FEATURES = FEATURE_SET_DESCRIPTOR_FEATURE_COUNT + 3; + int FEATURE_SET__FEATURES = 3; /** * The number of structural features of the 'Feature Set' class. @@ -203,7 +119,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_SET_FEATURE_COUNT = FEATURE_SET_DESCRIPTOR_FEATURE_COUNT + 4; + int FEATURE_SET_FEATURE_COUNT = 4; /** * The number of operations of the 'Feature Set' class. @@ -212,7 +128,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_SET_OPERATION_COUNT = FEATURE_SET_DESCRIPTOR_OPERATION_COUNT + 0; + int FEATURE_SET_OPERATION_COUNT = 0; /** * The meta object id for the '{@link org.eclipse.passage.lic.features.model.impl.FeatureImpl Feature}' class. @@ -222,7 +138,7 @@ public interface FeaturesPackage extends EPackage { * @see org.eclipse.passage.lic.features.model.impl.FeaturesPackageImpl#getFeature() * @generated */ - int FEATURE = 4; + int FEATURE = 1; /** * The feature id for the 'Identifier' attribute. @@ -231,7 +147,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE__IDENTIFIER = FEATURE_DESCRIPTOR_FEATURE_COUNT + 0; + int FEATURE__IDENTIFIER = 0; /** * The feature id for the 'Provider' attribute. @@ -240,7 +156,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE__PROVIDER = FEATURE_DESCRIPTOR_FEATURE_COUNT + 1; + int FEATURE__PROVIDER = 1; /** * The feature id for the 'Name' attribute. @@ -249,7 +165,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE__NAME = FEATURE_DESCRIPTOR_FEATURE_COUNT + 2; + int FEATURE__NAME = 2; /** * The feature id for the 'Description' attribute. @@ -258,7 +174,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE__DESCRIPTION = FEATURE_DESCRIPTOR_FEATURE_COUNT + 3; + int FEATURE__DESCRIPTION = 3; /** * The feature id for the 'Feature Set' container reference. @@ -267,7 +183,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE__FEATURE_SET = FEATURE_DESCRIPTOR_FEATURE_COUNT + 4; + int FEATURE__FEATURE_SET = 4; /** * The feature id for the 'Feature Versions' containment reference list. @@ -276,7 +192,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE__FEATURE_VERSIONS = FEATURE_DESCRIPTOR_FEATURE_COUNT + 5; + int FEATURE__FEATURE_VERSIONS = 5; /** * The number of structural features of the 'Feature' class. @@ -285,7 +201,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_FEATURE_COUNT = FEATURE_DESCRIPTOR_FEATURE_COUNT + 6; + int FEATURE_FEATURE_COUNT = 6; /** * The number of operations of the 'Feature' class. @@ -294,7 +210,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_OPERATION_COUNT = FEATURE_DESCRIPTOR_OPERATION_COUNT + 0; + int FEATURE_OPERATION_COUNT = 0; /** * The meta object id for the '{@link org.eclipse.passage.lic.features.model.impl.FeatureVersionImpl Feature Version}' class. @@ -304,7 +220,7 @@ public interface FeaturesPackage extends EPackage { * @see org.eclipse.passage.lic.features.model.impl.FeaturesPackageImpl#getFeatureVersion() * @generated */ - int FEATURE_VERSION = 5; + int FEATURE_VERSION = 2; /** * The feature id for the 'Version' attribute. @@ -313,7 +229,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_VERSION__VERSION = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 0; + int FEATURE_VERSION__VERSION = 0; /** * The feature id for the 'Feature' container reference. @@ -322,7 +238,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_VERSION__FEATURE = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 1; + int FEATURE_VERSION__FEATURE = 1; /** * The feature id for the 'News' attribute. @@ -331,7 +247,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_VERSION__NEWS = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 2; + int FEATURE_VERSION__NEWS = 2; /** * The number of structural features of the 'Feature Version' class. @@ -340,7 +256,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_VERSION_FEATURE_COUNT = FEATURE_VERSION_DESCRIPTOR_FEATURE_COUNT + 3; + int FEATURE_VERSION_FEATURE_COUNT = 3; /** * The number of operations of the 'Feature Version' class. @@ -349,40 +265,7 @@ public interface FeaturesPackage extends EPackage { * @generated * @ordered */ - int FEATURE_VERSION_OPERATION_COUNT = FEATURE_VERSION_DESCRIPTOR_OPERATION_COUNT + 0; - - /** - * Returns the meta object for class '{@link org.eclipse.passage.lic.features.FeatureSetDescriptor Feature Set Descriptor}'. - * - * - * @return the meta object for class 'Feature Set Descriptor'. - * @see org.eclipse.passage.lic.features.FeatureSetDescriptor - * @model instanceClass="org.eclipse.passage.lic.features.FeatureSetDescriptor" - * @generated - */ - EClass getFeatureSetDescriptor(); - - /** - * Returns the meta object for class '{@link org.eclipse.passage.lic.features.FeatureDescriptor Feature Descriptor}'. - * - * - * @return the meta object for class 'Feature Descriptor'. - * @see org.eclipse.passage.lic.features.FeatureDescriptor - * @model instanceClass="org.eclipse.passage.lic.features.FeatureDescriptor" - * @generated - */ - EClass getFeatureDescriptor(); - - /** - * Returns the meta object for class '{@link org.eclipse.passage.lic.features.FeatureVersionDescriptor Feature Version Descriptor}'. - * - * - * @return the meta object for class 'Feature Version Descriptor'. - * @see org.eclipse.passage.lic.features.FeatureVersionDescriptor - * @model instanceClass="org.eclipse.passage.lic.features.FeatureVersionDescriptor" - * @generated - */ - EClass getFeatureVersionDescriptor(); + int FEATURE_VERSION_OPERATION_COUNT = 0; /** * Returns the meta object for class '{@link org.eclipse.passage.lic.features.model.api.FeatureSet Feature Set}'. @@ -566,4 +449,4 @@ public interface FeaturesPackage extends EPackage { */ FeaturesFactory getFeaturesFactory(); -} //FeaturesPackage +} // FeaturesPackage diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesAdapterFactory.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesAdapterFactory.java index f606d9526..06d06bbd1 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesAdapterFactory.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesAdapterFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -14,17 +14,11 @@ import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; - import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; - import org.eclipse.emf.ecore.EObject; - -import org.eclipse.passage.lic.features.FeatureDescriptor; -import org.eclipse.passage.lic.features.FeatureSetDescriptor; -import org.eclipse.passage.lic.features.FeatureVersionDescriptor; - -import org.eclipse.passage.lic.features.model.api.*; - +import org.eclipse.passage.lic.features.model.api.Feature; +import org.eclipse.passage.lic.features.model.api.FeatureSet; +import org.eclipse.passage.lic.features.model.api.FeatureVersion; import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; /** @@ -82,21 +76,6 @@ public boolean isFactoryForType(Object object) { * @generated */ protected FeaturesSwitch modelSwitch = new FeaturesSwitch() { - @Override - public Adapter caseFeatureSetDescriptor(FeatureSetDescriptor object) { - return createFeatureSetDescriptorAdapter(); - } - - @Override - public Adapter caseFeatureDescriptor(FeatureDescriptor object) { - return createFeatureDescriptorAdapter(); - } - - @Override - public Adapter caseFeatureVersionDescriptor(FeatureVersionDescriptor object) { - return createFeatureVersionDescriptorAdapter(); - } - @Override public Adapter caseFeatureSet(FeatureSet object) { return createFeatureSetAdapter(); @@ -131,48 +110,6 @@ public Adapter createAdapter(Notifier target) { return modelSwitch.doSwitch((EObject) target); } - /** - * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.features.FeatureSetDescriptor Feature Set Descriptor}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.passage.lic.features.FeatureSetDescriptor - * @generated - */ - public Adapter createFeatureSetDescriptorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.features.FeatureDescriptor Feature Descriptor}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.passage.lic.features.FeatureDescriptor - * @generated - */ - public Adapter createFeatureDescriptorAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.features.FeatureVersionDescriptor Feature Version Descriptor}'. - * - * This default implementation returns null so that we can easily ignore cases; - * it's useful to ignore a case when inheritance will catch all the cases anyway. - * - * @return the new adapter. - * @see org.eclipse.passage.lic.features.FeatureVersionDescriptor - * @generated - */ - public Adapter createFeatureVersionDescriptorAdapter() { - return null; - } - /** * Creates a new adapter for an object of class '{@link org.eclipse.passage.lic.features.model.api.FeatureSet Feature Set}'. * @@ -227,4 +164,4 @@ public Adapter createEObjectAdapter() { return null; } -} //FeaturesAdapterFactory +} // FeaturesAdapterFactory diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java index 9d6fb8f3a..c57010bb5 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceFactoryImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -47,4 +47,4 @@ public Resource createResource(URI uri) { return result; } -} //FeaturesResourceFactoryImpl +} // FeaturesResourceFactoryImpl diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java index 7743576f3..1d73fae2d 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesResourceImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -46,4 +46,4 @@ protected void init() { options.put(OPTION_RESOURCE_HANDLER, new FeaturesResourceHandler()); } -} //FeaturesResourceImpl +} // FeaturesResourceImpl diff --git a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesSwitch.java b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesSwitch.java index 4ee0b287a..46ee88b0e 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesSwitch.java +++ b/bundles/org.eclipse.passage.lic.features.model/src-gen/org/eclipse/passage/lic/features/model/util/FeaturesSwitch.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2021 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -14,15 +14,10 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; - import org.eclipse.emf.ecore.util.Switch; - -import org.eclipse.passage.lic.features.FeatureDescriptor; -import org.eclipse.passage.lic.features.FeatureSetDescriptor; -import org.eclipse.passage.lic.features.FeatureVersionDescriptor; - -import org.eclipse.passage.lic.features.model.api.*; - +import org.eclipse.passage.lic.features.model.api.Feature; +import org.eclipse.passage.lic.features.model.api.FeatureSet; +import org.eclipse.passage.lic.features.model.api.FeatureVersion; import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; /** @@ -82,32 +77,9 @@ protected boolean isSwitchFor(EPackage ePackage) { @Override protected T doSwitch(int classifierID, EObject theEObject) { switch (classifierID) { - case FeaturesPackage.FEATURE_SET_DESCRIPTOR: { - FeatureSetDescriptor featureSetDescriptor = (FeatureSetDescriptor) theEObject; - T result = caseFeatureSetDescriptor(featureSetDescriptor); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case FeaturesPackage.FEATURE_DESCRIPTOR: { - FeatureDescriptor featureDescriptor = (FeatureDescriptor) theEObject; - T result = caseFeatureDescriptor(featureDescriptor); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case FeaturesPackage.FEATURE_VERSION_DESCRIPTOR: { - FeatureVersionDescriptor featureVersionDescriptor = (FeatureVersionDescriptor) theEObject; - T result = caseFeatureVersionDescriptor(featureVersionDescriptor); - if (result == null) - result = defaultCase(theEObject); - return result; - } case FeaturesPackage.FEATURE_SET: { FeatureSet featureSet = (FeatureSet) theEObject; T result = caseFeatureSet(featureSet); - if (result == null) - result = caseFeatureSetDescriptor(featureSet); if (result == null) result = defaultCase(theEObject); return result; @@ -115,8 +87,6 @@ protected T doSwitch(int classifierID, EObject theEObject) { case FeaturesPackage.FEATURE: { Feature feature = (Feature) theEObject; T result = caseFeature(feature); - if (result == null) - result = caseFeatureDescriptor(feature); if (result == null) result = defaultCase(theEObject); return result; @@ -124,8 +94,6 @@ protected T doSwitch(int classifierID, EObject theEObject) { case FeaturesPackage.FEATURE_VERSION: { FeatureVersion featureVersion = (FeatureVersion) theEObject; T result = caseFeatureVersion(featureVersion); - if (result == null) - result = caseFeatureVersionDescriptor(featureVersion); if (result == null) result = defaultCase(theEObject); return result; @@ -135,51 +103,6 @@ protected T doSwitch(int classifierID, EObject theEObject) { } } - /** - * Returns the result of interpreting the object as an instance of 'Feature Set Descriptor'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Feature Set Descriptor'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFeatureSetDescriptor(FeatureSetDescriptor object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Feature Descriptor'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Feature Descriptor'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFeatureDescriptor(FeatureDescriptor object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Feature Version Descriptor'. - * - * This implementation returns null; - * returning a non-null result will terminate the switch. - * - * @param object the target of the switch. - * @return the result of interpreting the object as an instance of 'Feature Version Descriptor'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFeatureVersionDescriptor(FeatureVersionDescriptor object) { - return null; - } - /** * Returns the result of interpreting the object as an instance of 'Feature Set'. * @@ -241,4 +164,4 @@ public T defaultCase(EObject object) { return null; } -} //FeaturesSwitch +} // FeaturesSwitch diff --git a/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/FeaturesClassMetadata.java b/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/FeaturesClassMetadata.java index 8448af04e..38f8612fc 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/FeaturesClassMetadata.java +++ b/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/FeaturesClassMetadata.java @@ -19,8 +19,6 @@ import org.eclipse.passage.lic.emf.meta.ClassMetadata; import org.eclipse.passage.lic.emf.meta.EntityMetadata; import org.eclipse.passage.lic.emf.meta.PlainEntityMetadata; -import org.eclipse.passage.lic.features.FeatureDescriptor; -import org.eclipse.passage.lic.features.FeatureSetDescriptor; import org.eclipse.passage.lic.features.model.api.Feature; import org.eclipse.passage.lic.features.model.api.FeatureSet; import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; @@ -34,18 +32,16 @@ public final class FeaturesClassMetadata implements ClassMetadata { public FeaturesClassMetadata() { meta = FeaturesPackage.eINSTANCE; map = new HashMap, EntityMetadata>(); - map.put(FeatureSetDescriptor.class, // + map.put(FeatureSet.class, // new PlainEntityMetadata(// meta.getFeatureSet(), // meta.getFeatureSet_Identifier(), // meta.getFeatureSet_Name())); - map.put(FeatureSet.class, map.get(FeatureSetDescriptor.class)); - map.put(FeatureDescriptor.class, // + map.put(Feature.class, // new PlainEntityMetadata(// meta.getFeature(), // meta.getFeature_Identifier(), // meta.getFeature_Name())); - map.put(Feature.class, map.get(FeatureDescriptor.class)); } @Override diff --git a/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/migration/FeaturesResourceHandler.java b/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/migration/FeaturesResourceHandler.java index 66ae73ab7..753afacfe 100644 --- a/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/migration/FeaturesResourceHandler.java +++ b/bundles/org.eclipse.passage.lic.features.model/src/org/eclipse/passage/lic/internal/features/model/migration/FeaturesResourceHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2021 ArSysOp + * Copyright (c) 2021, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -34,6 +34,7 @@ protected void register() { migrate033(); migrate040(); migrate050(); + migrate200(); } @Override @@ -63,4 +64,10 @@ private void migrate050() { EPackage.Registry.INSTANCE.computeIfAbsent(uri, ns -> delegate); } + private void migrate200() { + String uri = "http://www.eclipse.org/passage/lic/features/2.0.0"; //$NON-NLS-1$ + FeaturesPackage delegate = FeaturesPackage.eINSTANCE; + EPackage.Registry.INSTANCE.computeIfAbsent(uri, ns -> delegate); + } + } diff --git a/bundles/org.eclipse.passage.lic.features/.classpath b/bundles/org.eclipse.passage.lic.features/.classpath index 81fe078c2..a7a673fa7 100644 --- a/bundles/org.eclipse.passage.lic.features/.classpath +++ b/bundles/org.eclipse.passage.lic.features/.classpath @@ -2,6 +2,5 @@ - diff --git a/bundles/org.eclipse.passage.lic.features/.project b/bundles/org.eclipse.passage.lic.features/.project index b8f3b3cb7..4a390c934 100644 --- a/bundles/org.eclipse.passage.lic.features/.project +++ b/bundles/org.eclipse.passage.lic.features/.project @@ -5,11 +5,6 @@ - - org.eclipse.jdt.core.javabuilder - - - org.eclipse.pde.ManifestBuilder @@ -28,7 +23,6 @@ org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature org.eclipse.pde.api.tools.apiAnalysisNature diff --git a/bundles/org.eclipse.passage.lic.features/META-INF/MANIFEST.MF b/bundles/org.eclipse.passage.lic.features/META-INF/MANIFEST.MF index 7a5667846..bdea7d92e 100644 --- a/bundles/org.eclipse.passage.lic.features/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.passage.lic.features/META-INF/MANIFEST.MF @@ -8,4 +8,3 @@ Bundle-Vendor: %Bundle-Vendor Bundle-Copyright: %Bundle-Copyright Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: org.eclipse.passage.lic.api;bundle-version="0.0.0";visibility:=reexport -Export-Package: org.eclipse.passage.lic.features diff --git a/bundles/org.eclipse.passage.lic.features/build.properties b/bundles/org.eclipse.passage.lic.features/build.properties index 31247d8d1..40677a74b 100644 --- a/bundles/org.eclipse.passage.lic.features/build.properties +++ b/bundles/org.eclipse.passage.lic.features/build.properties @@ -1,5 +1,5 @@ ############################################################################### -# Copyright (c) 2018, 2020 ArSysOp and others +# Copyright (c) 2018, 2024 ArSysOp and others # # This program and the accompanying materials are made available under the # terms of the Eclipse Public License 2.0 which is available at @@ -11,8 +11,6 @@ # ArSysOp - initial API and implementation ############################################################################### -source.. = src/ -output.. = bin/ bin.includes = META-INF/,\ .,\ OSGI-INF/,\ diff --git a/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureDescriptor.java b/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureDescriptor.java deleted file mode 100644 index d88278750..000000000 --- a/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureDescriptor.java +++ /dev/null @@ -1,66 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2018, 2020 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.features; - -/** - *

- * A "Feature" corresponds to the scenario for your product, that - * you want to restrict. For example, you may want to restrict export to some - * proprietary format or other actions. You do not need to describe all the - * functionality of your "Product", but only the parts you want to - * restrict. The "identifier" attribute of the - * "Feature" is important for the - * "Licensing Configuration". - *

- * - */ -public interface FeatureDescriptor { - - /** - * Returns the identifier of this feature. This is the value of its - * "identifier" attribute. - * - * @return the identifier - */ - String getIdentifier(); - - /** - * Returns the provider of this feature. This is the value of its - * "provider" attribute. - * - * @return the provider - * @since 0.5.0 - */ - String getProvider(); - - /** - * Returns the name of this feature. This is the value of its - * "name" attribute. - * - * @return the name - */ - String getName(); - - /** - * Returns the description of this feature. This is the value of its - * "description" attribute. - * - * @return the description - */ - String getDescription(); - - FeatureSetDescriptor getFeatureSet(); - - Iterable getFeatureVersions(); - -} diff --git a/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureSetDescriptor.java b/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureSetDescriptor.java deleted file mode 100644 index 10dad96b4..000000000 --- a/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureSetDescriptor.java +++ /dev/null @@ -1,50 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2018, 2020 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.features; - -/** - *

- * The "Feature Set" groups the related functionality that may be - * distributed via several "Products". - *

- * - */ -public interface FeatureSetDescriptor { - - /** - * Returns the identifier of this feature set. This is the value of its - * "identifier" attribute. - * - * @return the identifier - */ - String getIdentifier(); - - /** - * Returns the name of this feature set. This is the value of its - * "name" attribute. - * - * @return the name - */ - String getName(); - - /** - * Returns the description of this feature set. This is the value of its - * "description" attribute. - * - * @return the description - */ - String getDescription(); - - Iterable getFeatures(); - -} diff --git a/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureVersionDescriptor.java b/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureVersionDescriptor.java deleted file mode 100644 index 382de8349..000000000 --- a/bundles/org.eclipse.passage.lic.features/src/org/eclipse/passage/lic/features/FeatureVersionDescriptor.java +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************* - * 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.features; - -/** - *

- * The "Feature Version" is a state of your "Feature" - * that included to the "Product Version".The - * "version" attribute of the "Feature Version" is - * important for the "Licensing Configuration". - *

- * - */ -public interface FeatureVersionDescriptor { - - /** - * Returns the version of this feature version. This is the value of its - * "version" attribute. - * - * @return the version - */ - String getVersion(); - - /** - * Returns the "what's new" of this feature version. This is the value of its - * "news" attribute. - * - * @return the news - */ - String getNews(); - - FeatureDescriptor getFeature(); - -} diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DashboardPanelPart.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DashboardPanelPart.java index 6f9e197d1..aa9f9c28c 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DashboardPanelPart.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DashboardPanelPart.java @@ -27,9 +27,9 @@ import org.eclipse.passage.lic.agreements.model.api.Agreement; import org.eclipse.passage.lic.agreements.model.api.AgreementGroup; import org.eclipse.passage.lic.emf.meta.ComposableClassMetadata; -import org.eclipse.passage.lic.features.FeatureDescriptor; -import org.eclipse.passage.lic.features.FeatureSetDescriptor; -import org.eclipse.passage.lic.features.FeatureVersionDescriptor; +import org.eclipse.passage.lic.features.model.api.Feature; +import org.eclipse.passage.lic.features.model.api.FeatureSet; +import org.eclipse.passage.lic.features.model.api.FeatureVersion; import org.eclipse.passage.lic.internal.agreements.model.AgreementsClassMetadata; import org.eclipse.passage.lic.internal.features.model.FeaturesClassMetadata; import org.eclipse.passage.lic.internal.licenses.model.LicensesClassMetadata; @@ -138,39 +138,39 @@ protected void createFooterInfo(Composite parent) { @Inject @Optional - public void createdFeatureSet(@UIEventTopic(FeatureRegistryEvents.FEATURE_SET_CREATE) FeatureSetDescriptor input) { + public void createdFeatureSet(@UIEventTopic(FeatureRegistryEvents.FEATURE_SET_CREATE) FeatureSet input) { dashboard.updateFeatureInfo(features); } @Inject @Optional - public void deletedFeatureSet(@UIEventTopic(FeatureRegistryEvents.FEATURE_SET_DELETE) FeatureSetDescriptor input) { + public void deletedFeatureSet(@UIEventTopic(FeatureRegistryEvents.FEATURE_SET_DELETE) FeatureSet input) { dashboard.updateFeatureInfo(features); } @Inject @Optional - public void createdFeature(@UIEventTopic(FeatureRegistryEvents.FEATURE_CREATE) FeatureDescriptor input) { + public void createdFeature(@UIEventTopic(FeatureRegistryEvents.FEATURE_CREATE) Feature input) { dashboard.updateFeatureInfo(features); } @Inject @Optional - public void deletedFeature(@UIEventTopic(FeatureRegistryEvents.FEATURE_DELETE) FeatureDescriptor input) { + public void deletedFeature(@UIEventTopic(FeatureRegistryEvents.FEATURE_DELETE) Feature input) { dashboard.updateFeatureInfo(features); } @Inject @Optional public void createdFeatureVersion( - @UIEventTopic(FeatureRegistryEvents.FEATURE_VERSION_CREATE) FeatureVersionDescriptor input) { + @UIEventTopic(FeatureRegistryEvents.FEATURE_VERSION_CREATE) FeatureVersion input) { dashboard.updateFeatureInfo(features); } @Inject @Optional public void deletedFeatureVersion( - @UIEventTopic(FeatureRegistryEvents.FEATURE_VERSION_DELETE) FeatureVersionDescriptor input) { + @UIEventTopic(FeatureRegistryEvents.FEATURE_VERSION_DELETE) FeatureVersion input) { dashboard.updateFeatureInfo(features); } diff --git a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DefaultDashboardPanelAdvisor.java b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DefaultDashboardPanelAdvisor.java index be56958ac..2feff0925 100644 --- a/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DefaultDashboardPanelAdvisor.java +++ b/bundles/org.eclipse.passage.loc.dashboard.ui/src/org/eclipse/passage/loc/dashboard/ui/panel/DefaultDashboardPanelAdvisor.java @@ -124,9 +124,9 @@ protected DashboardPanelBlock createFeatureVersionBlock(Composite parent) { @Override public void updateFeatureInfo(FeatureRegistry featureRegistry) { - featureSets.update(featureRegistry.getFeatureSets()); - features.update(featureRegistry.getFeatures()); - featureVersions.update(featureRegistry.getFeatureVersions()); + featureSets.update(featureRegistry.featureSets()); + features.update(featureRegistry.features()); + featureVersions.update(featureRegistry.featureVersions()); } @Override diff --git a/bundles/org.eclipse.passage.loc.features.core/OSGI-INF/org.eclipse.passage.loc.internal.features.core.FeaturesSelectionCommandAdvisor.xml b/bundles/org.eclipse.passage.loc.features.core/OSGI-INF/org.eclipse.passage.loc.internal.features.core.FeaturesSelectionCommandAdvisor.xml index c91ce95bf..270c7c124 100644 --- a/bundles/org.eclipse.passage.loc.features.core/OSGI-INF/org.eclipse.passage.loc.internal.features.core.FeaturesSelectionCommandAdvisor.xml +++ b/bundles/org.eclipse.passage.loc.features.core/OSGI-INF/org.eclipse.passage.loc.internal.features.core.FeaturesSelectionCommandAdvisor.xml @@ -1,9 +1,9 @@ - + - + \ No newline at end of file diff --git a/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/FeatureRegistry.java b/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/FeatureRegistry.java index b28343fa6..149cfcef1 100644 --- a/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/FeatureRegistry.java +++ b/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/FeatureRegistry.java @@ -12,38 +12,23 @@ *******************************************************************************/ package org.eclipse.passage.loc.internal.features; -import org.eclipse.passage.lic.features.FeatureDescriptor; -import org.eclipse.passage.lic.features.FeatureSetDescriptor; -import org.eclipse.passage.lic.features.FeatureVersionDescriptor; +import java.util.Collection; +import java.util.Optional; -public interface FeatureRegistry { - - Iterable getFeatureSets(); - - FeatureSetDescriptor getFeatureSet(String featureSetId); - - void registerFeatureSet(FeatureSetDescriptor featureSet); - - void unregisterFeatureSet(String featureSetId); +import org.eclipse.passage.lic.features.model.api.Feature; +import org.eclipse.passage.lic.features.model.api.FeatureSet; +import org.eclipse.passage.lic.features.model.api.FeatureVersion; - Iterable getFeatures(); - - Iterable getFeatures(String featureSetId); - - FeatureDescriptor getFeature(String featureId); - - void registerFeature(FeatureDescriptor feature); - - void unregisterFeature(String featureId); +public interface FeatureRegistry { - Iterable getFeatureVersions(); + Collection featureSets(); - Iterable getFeatureVersions(String featureId); + Optional featureSet(String id); - FeatureVersionDescriptor getFeatureVersion(String featureId, String version); + Collection features(); - void registerFeatureVersion(FeatureDescriptor feature, FeatureVersionDescriptor featureVersion); + Optional feature(String id); - void unregisterFeatureVersion(String featureId, String version); + Collection featureVersions(); } diff --git a/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeatureDomainRegistry.java b/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeatureDomainRegistry.java index b28d4f808..0f5cce01c 100644 --- a/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeatureDomainRegistry.java +++ b/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeatureDomainRegistry.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2022 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -14,10 +14,10 @@ import java.util.ArrayList; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Optional; import org.eclipse.core.runtime.Platform; import org.eclipse.emf.common.util.URI; @@ -25,9 +25,9 @@ import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.resource.Resource; import org.eclipse.osgi.util.NLS; -import org.eclipse.passage.lic.features.FeatureDescriptor; -import org.eclipse.passage.lic.features.FeatureSetDescriptor; -import org.eclipse.passage.lic.features.FeatureVersionDescriptor; +import org.eclipse.passage.lic.features.model.api.Feature; +import org.eclipse.passage.lic.features.model.api.FeatureSet; +import org.eclipse.passage.lic.features.model.api.FeatureVersion; import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; import org.eclipse.passage.lic.features.model.util.FeaturesResourceImpl; import org.eclipse.passage.lic.internal.equinox.events.EquinoxEvent; @@ -52,12 +52,12 @@ @SuppressWarnings("restriction") @Component(property = { EditingDomainRegistryAccess.PROPERTY_DOMAIN_NAME + '=' + FeaturesPackage.eNAME, EditingDomainRegistryAccess.PROPERTY_FILE_EXTENSION + '=' + "features_xmi" }) -public class FeatureDomainRegistry extends BaseDomainRegistry - implements FeatureRegistry, EditingDomainRegistry { +public class FeatureDomainRegistry extends BaseDomainRegistry + implements FeatureRegistry, EditingDomainRegistry { - private final Map featureSetIndex = new HashMap<>(); - private final Map featureIndex = new HashMap<>(); - private final Map> featureVersionIndex = new HashMap<>(); + private final Map sets = new HashMap<>(); + private final Map features = new HashMap<>(); + private final Map> versions = new HashMap<>(); private EventAdmin events; @@ -90,13 +90,10 @@ public void activate(Map properties) { @Deactivate @Override public void deactivate(Map properties) { - Collection> values = featureVersionIndex.values(); - for (Map map : values) { - map.clear(); - } - featureVersionIndex.clear(); - featureIndex.clear(); - featureSetIndex.clear(); + versions.values().forEach(Map::clear); + versions.clear(); + features.clear(); + sets.clear(); super.deactivate(properties); } @@ -106,159 +103,106 @@ public String getFileExtension() { } @Override - public Class getContentClass() { - return FeatureSetDescriptor.class; + public Class getContentClass() { + return FeatureSet.class; } @Override - public String resolveIdentifier(FeatureSetDescriptor content) { + public String resolveIdentifier(FeatureSet content) { return content.getIdentifier(); } @Override - public Iterable getFeatureSets() { - return new ArrayList<>(featureSetIndex.values()); - } - - @Override - public FeatureSetDescriptor getFeatureSet(String identifier) { - return featureSetIndex.get(identifier); + public Collection featureSets() { + return new ArrayList<>(sets.values()); } @Override - public Iterable getFeatures() { - return new ArrayList<>(featureIndex.values()); + public Optional featureSet(String identifier) { + return Optional.ofNullable(sets.get(identifier)); } @Override - public Iterable getFeatures(String featureSetId) { - FeatureSetDescriptor featureSet = featureSetIndex.get(featureSetId); - if (featureSet == null) { - return Collections.emptyList(); - } - List features = new ArrayList<>(); - featureSet.getFeatures().forEach(features::add); - return features; + public Collection features() { + return new ArrayList<>(features.values()); } @Override - public FeatureDescriptor getFeature(String identifier) { - return featureIndex.get(identifier); + public Optional feature(String id) { + return Optional.ofNullable(features.get(id)); } @Override - public Iterable getFeatureVersions() { - List list = new ArrayList<>(); - Collection> values = featureVersionIndex.values(); - for (Map map : values) { + public Collection featureVersions() { + List list = new ArrayList<>(); + Collection> values = versions.values(); + for (Map map : values) { list.addAll(map.values()); } return list; } @Override - public Iterable getFeatureVersions(String featureId) { - Map map = featureVersionIndex.get(featureId); - if (map == null) { - return Collections.emptyList(); - } - return new ArrayList<>(map.values()); - } - - @Override - public FeatureVersionDescriptor getFeatureVersion(String featureId, String version) { - Map map = featureVersionIndex.get(featureId); - if (map == null) { - return null; - } - return map.get(version); - } - - @Override - protected DomainContentAdapter createContentAdapter() { + protected DomainContentAdapter createContentAdapter() { return new FeaturesDomainRegistryTracker(this); } - @Override - public void registerFeatureSet(FeatureSetDescriptor featureSet) { - String identifier = featureSet.getIdentifier(); - FeatureSetDescriptor existing = featureSetIndex.put(identifier, featureSet); - if ((existing != null) && (existing != featureSet)) { - String msg = NLS.bind(FeaturesCoreMessages.FeatureDomain_instance_duplication_message, existing, - featureSet); - Platform.getLog(getClass()).warn(msg); - } - events.postEvent(new EquinoxEvent(FeatureRegistryEvents.FEATURE_SET_CREATE, featureSet).get()); - Iterable features = featureSet.getFeatures(); - for (FeatureDescriptor feature : features) { - registerFeature(feature); + void registerFeatureSet(FeatureSet fs) { + FeatureSet existing = sets.put(fs.getIdentifier(), fs); + if ((existing != null) && (existing != fs)) { + Platform.getLog(getClass()) + .warn(NLS.bind(FeaturesCoreMessages.FeatureDomain_instance_duplication_message, existing, fs)); } + events.postEvent(new EquinoxEvent(FeatureRegistryEvents.FEATURE_SET_CREATE, fs).get()); + fs.getFeatures().forEach(this::registerFeature); } - @Override - public void registerFeature(FeatureDescriptor feature) { - String identifier = feature.getIdentifier(); - FeatureDescriptor existing = featureIndex.put(identifier, feature); + void registerFeature(Feature feature) { + Feature existing = features.put(feature.getIdentifier(), feature); if ((existing != null) && (existing != feature)) { - String msg = NLS.bind(FeaturesCoreMessages.FeatureDomain_instance_duplication_message, existing, feature); - Platform.getLog(getClass()).warn(msg); + Platform.getLog(getClass()) + .warn(NLS.bind(FeaturesCoreMessages.FeatureDomain_instance_duplication_message, existing, feature)); } events.postEvent(new EquinoxEvent(FeatureRegistryEvents.FEATURE_CREATE, feature).get()); - Iterable featureVersions = feature.getFeatureVersions(); - for (FeatureVersionDescriptor featureVersion : featureVersions) { - registerFeatureVersion(feature, featureVersion); - } + feature.getFeatureVersions().forEach(fv -> registerFeatureVersion(feature, fv)); } - @Override - public void registerFeatureVersion(FeatureDescriptor feature, FeatureVersionDescriptor featureVersion) { + void registerFeatureVersion(Feature feature, FeatureVersion version) { String identifier = feature.getIdentifier(); - Map map = featureVersionIndex.computeIfAbsent(identifier, - key -> new HashMap<>()); - String version = featureVersion.getVersion(); - FeatureVersionDescriptor existing = map.put(version, featureVersion); - if ((existing != null) && (existing != featureVersion)) { - String msg = NLS.bind(FeaturesCoreMessages.FeatureDomain_instance_duplication_message, existing, - featureVersion); - Platform.getLog(getClass()).warn(msg); + Map map = versions.computeIfAbsent(identifier, key -> new HashMap<>()); + FeatureVersion existing = map.put(version.getVersion(), version); + if ((existing != null) && (existing != version)) { + Platform.getLog(getClass()) + .warn(NLS.bind(FeaturesCoreMessages.FeatureDomain_instance_duplication_message, existing, version)); } - events.postEvent(new EquinoxEvent(FeatureRegistryEvents.FEATURE_VERSION_CREATE, featureVersion).get()); + events.postEvent(new EquinoxEvent(FeatureRegistryEvents.FEATURE_VERSION_CREATE, version).get()); } - @Override - public void unregisterFeatureSet(String featureSetId) { - FeatureSetDescriptor removed = featureSetIndex.remove(featureSetId); + void unregisterFeatureSet(String id) { + FeatureSet removed = sets.remove(id); if (removed != null) { events.postEvent(new EquinoxEvent(FeatureRegistryEvents.FEATURE_SET_DELETE, removed).get()); - Iterable features = removed.getFeatures(); - for (FeatureDescriptor feature : features) { - unregisterFeature(feature.getIdentifier()); - } + removed.getFeatures().stream().map(Feature::getIdentifier).forEach(this::unregisterFeature); } } - @Override - public void unregisterFeature(String featureId) { - FeatureDescriptor removed = featureIndex.remove(featureId); + void unregisterFeature(String id) { + Feature removed = features.remove(id); if (removed != null) { events.postEvent(new EquinoxEvent(FeatureRegistryEvents.FEATURE_DELETE, removed).get()); - Iterable featureVersions = removed.getFeatureVersions(); - for (FeatureVersionDescriptor featureVersion : featureVersions) { - unregisterFeatureVersion(featureId, featureVersion.getVersion()); - } + removed.getFeatureVersions().forEach(fv -> unregisterFeatureVersion(id, fv.getVersion())); } } - @Override - public void unregisterFeatureVersion(String featureId, String version) { - Map map = featureVersionIndex.get(featureId); + void unregisterFeatureVersion(String featureId, String version) { + Map map = versions.get(featureId); if (map != null) { - FeatureVersionDescriptor removed = map.remove(version); + FeatureVersion removed = map.remove(version); if (removed != null) { events.postEvent(new EquinoxEvent(FeatureRegistryEvents.FEATURE_VERSION_DELETE, removed).get()); } if (map.isEmpty()) { - featureVersionIndex.remove(version); + versions.remove(version); } } } @@ -279,7 +223,7 @@ public EStructuralFeature getContentNameAttribute() { } @Override - public void registerContent(FeatureSetDescriptor content) { + public void registerContent(FeatureSet content) { registerFeatureSet(content); } diff --git a/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeaturesDomainRegistryTracker.java b/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeaturesDomainRegistryTracker.java index 9c7b62971..a6106d915 100644 --- a/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeaturesDomainRegistryTracker.java +++ b/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeaturesDomainRegistryTracker.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2018, 2020 ArSysOp + * Copyright (c) 2018, 2024 ArSysOp * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -13,14 +13,13 @@ package org.eclipse.passage.loc.internal.features.core; import org.eclipse.emf.common.notify.Notification; -import org.eclipse.passage.lic.features.FeatureSetDescriptor; import org.eclipse.passage.lic.features.model.api.Feature; import org.eclipse.passage.lic.features.model.api.FeatureSet; import org.eclipse.passage.lic.features.model.api.FeatureVersion; import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; import org.eclipse.passage.loc.internal.emf.DomainContentAdapter; -public class FeaturesDomainRegistryTracker extends DomainContentAdapter { +public class FeaturesDomainRegistryTracker extends DomainContentAdapter { public FeaturesDomainRegistryTracker(FeatureDomainRegistry registry) { super(registry); diff --git a/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeaturesSelectionCommandAdvisor.java b/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeaturesSelectionCommandAdvisor.java index 3001f051e..f7d3b5c4c 100644 --- a/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeaturesSelectionCommandAdvisor.java +++ b/bundles/org.eclipse.passage.loc.features.core/src/org/eclipse/passage/loc/internal/features/core/FeaturesSelectionCommandAdvisor.java @@ -25,16 +25,8 @@ @Component(property = { EditingDomainRegistryAccess.PROPERTY_DOMAIN_NAME + '=' + FeaturesPackage.eNAME }) public class FeaturesSelectionCommandAdvisor implements SelectionCommandAdvisor { - private FeatureRegistry registry; - @Reference - public void bindDomainRegistry(FeatureRegistry featureRegistry) { - this.registry = featureRegistry; - } - - public void unbindDomainRegistry(FeatureRegistry featureRegistry) { - this.registry = null; - } + private FeatureRegistry registry; @Override public String getSelectionTitle(String classifier) { @@ -56,13 +48,13 @@ public Iterable getSelectionInput(String classifier) { return Collections.emptyList(); } if (FeaturesPackage.eINSTANCE.getFeatureSet().getName().equals(classifier)) { - return registry.getFeatureSets(); + return registry.featureSets(); } if (FeaturesPackage.eINSTANCE.getFeature().getName().equals(classifier)) { - return registry.getFeatures(); + return registry.features(); } if (FeaturesPackage.eINSTANCE.getFeatureVersion().getName().equals(classifier)) { - return registry.getFeatureVersions(); + return registry.featureVersions(); } return Collections.emptyList(); } diff --git a/bundles/org.eclipse.passage.loc.features.emfforms/src/org/eclipse/passage/loc/features/emfforms/renderers/FeatureIdentifierRenderer.java b/bundles/org.eclipse.passage.loc.features.emfforms/src/org/eclipse/passage/loc/features/emfforms/renderers/FeatureIdentifierRenderer.java index 3f7ea1e07..e91b806a0 100644 --- a/bundles/org.eclipse.passage.loc.features.emfforms/src/org/eclipse/passage/loc/features/emfforms/renderers/FeatureIdentifierRenderer.java +++ b/bundles/org.eclipse.passage.loc.features.emfforms/src/org/eclipse/passage/loc/features/emfforms/renderers/FeatureIdentifierRenderer.java @@ -12,6 +12,8 @@ *******************************************************************************/ package org.eclipse.passage.loc.features.emfforms.renderers; +import java.util.Optional; + import javax.inject.Inject; import org.eclipse.emf.ecp.view.spi.context.ViewModelContext; @@ -22,7 +24,7 @@ import org.eclipse.emfforms.spi.core.services.databinding.DatabindingFailedReport; import org.eclipse.emfforms.spi.core.services.databinding.EMFFormsDatabinding; import org.eclipse.emfforms.spi.core.services.label.EMFFormsLabelProvider; -import org.eclipse.passage.lic.features.FeatureDescriptor; +import org.eclipse.passage.lic.features.model.api.Feature; import org.eclipse.passage.loc.features.ui.FeaturesUi; import org.eclipse.passage.loc.internal.features.FeatureRegistry; import org.eclipse.passage.loc.workbench.emfforms.renderers.TextWithButtonRenderer; @@ -68,17 +70,17 @@ protected String getUnsetText() { protected void selectIdentifier() { Shell shell = Display.getDefault().getActiveShell(); - FeatureDescriptor initial = null; + Optional initial = Optional.empty(); try { Object value = getModelValue().getValue(); if (value instanceof String) { String id = (String) value; - initial = registry.getFeature(id); + initial = registry.feature(id); } } catch (DatabindingFailedException e) { getReportService().report(new DatabindingFailedReport(e)); } - FeatureDescriptor descriptor = FeaturesUi.selectFeatureDescriptor(shell, registry, initial); + Feature descriptor = FeaturesUi.selectFeatureDescriptor(shell, registry, initial); if (descriptor != null) { String identifier = descriptor.getIdentifier(); if (identifier != null) { diff --git a/bundles/org.eclipse.passage.loc.features.ui/src/org/eclipse/passage/loc/features/ui/FeaturesUi.java b/bundles/org.eclipse.passage.loc.features.ui/src/org/eclipse/passage/loc/features/ui/FeaturesUi.java index ed600471a..6ad554ad1 100644 --- a/bundles/org.eclipse.passage.loc.features.ui/src/org/eclipse/passage/loc/features/ui/FeaturesUi.java +++ b/bundles/org.eclipse.passage.loc.features.ui/src/org/eclipse/passage/loc/features/ui/FeaturesUi.java @@ -14,7 +14,7 @@ import java.util.Optional; -import org.eclipse.passage.lic.features.FeatureDescriptor; +import org.eclipse.passage.lic.features.model.api.Feature; import org.eclipse.passage.lic.features.model.meta.FeaturesPackage; import org.eclipse.passage.loc.internal.features.FeatureRegistry; import org.eclipse.passage.loc.internal.features.ui.i18n.FeatureUiMessages; @@ -27,13 +27,10 @@ public class FeaturesUi { public static final String PERSPECTIVE_MAIN = BUNDLE_SYMBOLIC_NAME + '.' + "perspective.main"; //$NON-NLS-1$ - public static FeatureDescriptor selectFeatureDescriptor(Shell shell, FeatureRegistry registry, - FeatureDescriptor initial) { + public static Feature selectFeatureDescriptor(Shell shell, FeatureRegistry registry, Optional initial) { String classifier = FeaturesPackage.eINSTANCE.getFeature().getName(); String title = FeatureUiMessages.FeaturesUi_select_feature_title; - Iterable input = registry.getFeatures(); - Class clazz = FeatureDescriptor.class; - return LocWokbench.selectClassifier(shell, classifier, title, input, Optional.ofNullable(initial), clazz); + return LocWokbench.selectClassifier(shell, classifier, title, registry.features(), initial, Feature.class); } } diff --git a/bundles/org.eclipse.passage.loc.workbench/src/org/eclipse/passage/loc/workbench/LocWokbench.java b/bundles/org.eclipse.passage.loc.workbench/src/org/eclipse/passage/loc/workbench/LocWokbench.java index 978f3f2ee..64462b35c 100644 --- a/bundles/org.eclipse.passage.loc.workbench/src/org/eclipse/passage/loc/workbench/LocWokbench.java +++ b/bundles/org.eclipse.passage.loc.workbench/src/org/eclipse/passage/loc/workbench/LocWokbench.java @@ -135,9 +135,6 @@ public static Object selectClassifier(IEclipseContext context, String classi return selectClassifier(shell, classifier, title, input, initial); } - /** - * @since 1.0 - */ public static C selectClassifier(Shell shell, String classifier, String title, Iterable input, Optional initial, Class clazz) { Object selected = selectClassifier(shell, classifier, title, input, initial); diff --git a/tests/org.eclipse.passage.lic.features.model.tests/src/org/eclipse/passage/lic/features/model/tests/FeaturesClassMetadataTest.java b/tests/org.eclipse.passage.lic.features.model.tests/src/org/eclipse/passage/lic/features/model/tests/FeaturesClassMetadataTest.java index f1c972086..8752df58f 100644 --- a/tests/org.eclipse.passage.lic.features.model.tests/src/org/eclipse/passage/lic/features/model/tests/FeaturesClassMetadataTest.java +++ b/tests/org.eclipse.passage.lic.features.model.tests/src/org/eclipse/passage/lic/features/model/tests/FeaturesClassMetadataTest.java @@ -14,8 +14,6 @@ import static org.junit.Assert.assertTrue; -import org.eclipse.passage.lic.features.FeatureDescriptor; -import org.eclipse.passage.lic.features.FeatureSetDescriptor; import org.eclipse.passage.lic.features.model.api.Feature; import org.eclipse.passage.lic.features.model.api.FeatureSet; import org.eclipse.passage.lic.internal.features.model.FeaturesClassMetadata; @@ -31,20 +29,17 @@ public FeaturesClassMetadataTest() { @Test public void featureSetMetadata() { - assertTrue(metadata.find(FeatureSetDescriptor.class).isPresent()); assertTrue(metadata.find(FeatureSet.class).isPresent()); } @Test public void featureMetadata() { - assertTrue(metadata.find(FeatureDescriptor.class).isPresent()); assertTrue(metadata.find(Feature.class).isPresent()); } @Test public void featureVersionMetadata() { // FIXME: implement -// assertTrue(metadata.find(FeatureVersionDescriptor.class).isPresent()); // assertTrue(metadata.find(FeatureVersion.class).isPresent()); } }