From 16b93ac176b6c8894a5a32799aa215ba7397e09b Mon Sep 17 00:00:00 2001 From: Ed Merks Date: Thu, 2 Jun 2022 13:32:54 +0200 Subject: [PATCH] Provide tools for analyzing a p2 aggregator model's constituent parts Refactor metadata repository representation to make it reusable in the analzyer model's editor. Provide better progress reporting on repository loading. Do artifact mirroring in parallel. Compute sha-256 if those are missing. Avoid saving the artifacts.jar repeatedly while mirroring. Produce also the *.xz versions. Do the verifications in parallel. Provide support for opening *.aggrcon which opens the corresponding *.aggr and selects the contribution in that editor. Support additional things such as expand all, collapse all, revert. Eliminate child creation icons. Mostly remove the bogus P2viewEditor. Fix the fix versions dialog to avoid NPE. Fix problems with random drag and drop not being able to set or compute certain features while copying. https://github.com/eclipse-cbi/p2repo-aggregator/issues/3 --- .settings/org.eclipse.core.resources.prefs | 2 + Build.launch | 2 +- cbi.svg | 152 + cbi16.png | Bin 0 -> 678 bytes favicon.ico | Bin 0 -> 1150 bytes .../.classpath | 11 + .../.project | 28 + .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.core.runtime.prefs | 1 + .../.settings/org.eclipse.jdt.core.prefs | 418 +++ .../.settings/org.eclipse.jdt.ui.prefs | 129 + .../org.eclipse.ltk.core.refactoring.prefs | 3 + .../.settings/org.eclipse.pde.prefs | 33 + .../COPYRIGHT | 8 + .../META-INF/MANIFEST.MF | 20 + .../about.html | 28 + .../build.properties | 19 + .../icons/full/obj16/Analysis.gif | Bin 0 -> 310 bytes .../icons/full/obj16/CapabilityAnalysis.gif | Bin 0 -> 369 bytes .../icons/full/obj16/CapabilityResolution.gif | Bin 0 -> 129 bytes .../icons/full/obj16/ContributionAnalysis.gif | Bin 0 -> 233 bytes .../obj16/ContributionAnalysisDisabled.gif | Bin 0 -> 233 bytes .../icons/full/obj16/GitRepository.gif | Bin 0 -> 588 bytes .../full/obj16/InstallableUnitAnalysis.gif | Bin 0 -> 585 bytes .../icons/full/obj16/PatternGroup.gif | Bin 0 -> 924 bytes .../icons/full/obj16/Project.gif | Bin 0 -> 351 bytes .../icons/full/obj16/RequirementAnalysis.gif | Bin 0 -> 129 bytes .../full/obj16/RequirementResolution.gif | Bin 0 -> 129 bytes .../icons/full/ovr16/OverlayBlank.gif | Bin 0 -> 67 bytes .../icons/full/ovr16/OverlayMappedBottom.gif | Bin 0 -> 158 bytes .../icons/full/ovr16/OverlayMappedTop.gif | Bin 0 -> 108 bytes .../full/ovr16/OverlayUnmappedBottom.gif | Bin 0 -> 108 bytes .../icons/full/ovr16/OverlayUnmappedTop.gif | Bin 0 -> 108 bytes .../plugin.properties | 85 + .../plugin.xml | 31 + .../pom.xml | 13 + .../AggregationAnalyzerEditPlugin.java | 96 + .../provider/AnalysisItemProvider.java | 261 ++ .../provider/AnalyzerItemProviderAdapter.java | 106 + .../AnalyzerItemProviderAdapterFactory.java | 415 +++ .../CapabilityAnalysisItemProvider.java | 221 ++ .../CapabilityResolutionItemProvider.java | 199 + .../ContributionAnalysisItemProvider.java | 310 ++ .../provider/GitRepositoryItemProvider.java | 187 + .../InstallableUnitAnalysisItemProvider.java | 224 ++ .../provider/ProjectItemProvider.java | 289 ++ .../RequirementAnalysisItemProvider.java | 226 ++ .../RequirementResolutionItemProvider.java | 203 ++ .../.project | 28 + .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.core.runtime.prefs | 1 + .../build.properties | 4 + .../feature.properties | 17 + .../feature.xml | 48 + .../pom.xml | 32 + .../.classpath | 11 + .../.project | 28 + .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.core.runtime.prefs | 1 + .../.settings/org.eclipse.jdt.core.prefs | 418 +++ .../.settings/org.eclipse.jdt.ui.prefs | 129 + .../org.eclipse.ltk.core.refactoring.prefs | 3 + .../.settings/org.eclipse.pde.prefs | 33 + .../COPYRIGHT | 8 + .../META-INF/MANIFEST.MF | 28 + .../about.html | 28 + .../about.ini | 17 + .../about.mappings | 5 + .../about.properties | 21 + .../build.properties | 24 + .../cbi32.png | Bin 0 -> 1415 bytes .../icons/full/obj16/AnalyzerModelFile.gif | Bin 0 -> 310 bytes .../icons/full/obj16/clear.gif | Bin 0 -> 545 bytes .../icons/full/obj16/history.gif | Bin 0 -> 594 bytes .../icons/full/obj16/namespace.gif | Bin 0 -> 574 bytes .../icons/full/wizban/NewAnalyzer.gif | Bin 0 -> 2462 bytes .../plugin.properties | 64 + .../plugin.xml | 166 + .../pom.xml | 13 + .../AggregationAnalyzerEditorPlugin.java | 151 + .../AnalyzerActionBarContributor.java | 442 +++ .../analyzer/presentation/AnalyzerEditor.java | 3239 +++++++++++++++++ .../presentation/AnalyzerModelWizard.java | 617 ++++ .../presentation/BreadCrumbSupport.java | 63 + .../presentation/handlers/AnalyzeHandler.java | 614 ++++ .../presentation/handlers/BaseHandler.java | 163 + .../handlers/ClearCacheHandler.java | 52 + .../handlers/LastModifiedHandler.java | 199 + .../handlers/ProjectReconcilerHandler.java | 451 +++ .../.classpath | 15 + .../.gitignore | 6 + .../.project | 39 + .../org.eclipse.core.resources.prefs | 2 + .../.settings/org.eclipse.core.runtime.prefs | 1 + .../.settings/org.eclipse.jdt.core.prefs | 418 +++ .../.settings/org.eclipse.jdt.ui.prefs | 129 + .../org.eclipse.ltk.core.refactoring.prefs | 3 + .../.settings/org.eclipse.pde.prefs | 33 + .../COPYRIGHT | 8 + .../META-INF/MANIFEST.MF | 30 + .../about.html | 28 + .../build.properties | 13 + .../model/AggregationAnalyzer.ecore | 199 + .../model/AggregationAnalyzer.genmodel | 88 + .../plugin.properties | 11 + .../plugin.xml | 32 + .../pom.xml | 13 + .../analyzer/AggregationAnalyzer.java | 28 + .../analyzer/AggregationAnalyzerPlugin.java | 94 + .../p2repo/aggregator/analyzer/Analysis.java | 153 + .../aggregator/analyzer/AnalyzerFactory.java | 122 + .../aggregator/analyzer/AnalyzerPackage.java | 1599 ++++++++ .../analyzer/CapabilityAnalysis.java | 100 + .../analyzer/CapabilityResolution.java | 99 + .../analyzer/ContributionAnalysis.java | 194 + .../aggregator/analyzer/GitRepository.java | 97 + .../analyzer/InstallableUnitAnalysis.java | 137 + .../p2repo/aggregator/analyzer/Project.java | 188 + .../analyzer/RequirementAnalysis.java | 195 + .../analyzer/RequirementResolution.java | 102 + .../analyzer/impl/AnalysisImpl.java | 447 +++ .../analyzer/impl/AnalyzerFactoryImpl.java | 327 ++ .../analyzer/impl/AnalyzerPackageImpl.java | 1009 +++++ .../analyzer/impl/CapabilityAnalysisImpl.java | 356 ++ .../impl/CapabilityResolutionImpl.java | 305 ++ .../impl/ContributionAnalysisImpl.java | 558 +++ .../analyzer/impl/GitRepositoryImpl.java | 312 ++ .../impl/InstallableUnitAnalysisImpl.java | 403 ++ .../aggregator/analyzer/impl/ProjectImpl.java | 536 +++ .../impl/RequirementAnalysisImpl.java | 361 ++ .../impl/RequirementResolutionImpl.java | 374 ++ .../analyzer/util/AnalyzerAdapterFactory.java | 285 ++ .../util/AnalyzerResourceFactoryImpl.java | 63 + .../analyzer/util/AnalyzerResourceImpl.java | 35 + .../analyzer/util/AnalyzerSwitch.java | 303 ++ .../analyzer/util/AnalyzerUtil.java | 73 + .../META-INF/MANIFEST.MF | 2 +- .../about.html | 2 +- ...gregation_configurations_Configuration.gif | Bin 980 -> 0 bytes .../CreateAggregation_contacts_Contact.gif | Bin 999 -> 0 bytes ...Aggregation_contributions_Contribution.gif | Bin 947 -> 0 bytes ...gation_customCategories_CustomCategory.gif | Bin 928 -> 0 bytes ...Aggregation_mavenMappings_MavenMapping.gif | Bin 954 -> 0 bytes ...alidationRepositories_MappedRepository.gif | Bin 955 -> 0 bytes ...positories_MetadataRepositoryReference.gif | Bin 955 -> 0 bytes ...gregation_validationSets_ValidationSet.gif | Bin 962 -> 0 bytes ...ourceView_validationSets_ValidationSet.gif | Bin 962 -> 0 bytes ...ontribution_mavenMappings_MavenMapping.gif | Bin 954 -> 0 bytes ...ribution_repositories_MappedRepository.gif | Bin 955 -> 0 bytes .../CreateMappedRepository_bundles_Bundle.gif | Bin 949 -> 0 bytes ...teMappedRepository_categories_Category.gif | Bin 928 -> 0 bytes ...reateMappedRepository_features_Feature.gif | Bin 998 -> 0 bytes ...appedRepository_mapRules_ExclusionRule.gif | Bin 1015 -> 0 bytes ...itory_mapRules_ValidConfigurationsRule.gif | Bin 992 -> 0 bytes ...reateMappedRepository_products_Product.gif | Bin 990 -> 0 bytes ...lidationSet_contributions_Contribution.gif | Bin 223 -> 0 bytes ...alidationRepositories_MappedRepository.gif | Bin 223 -> 0 bytes ...positories_MetadataRepositoryReference.gif | Bin 223 -> 0 bytes .../full/obj16/AvailableVersionsHeader.gif | Bin 129 -> 89 bytes .../icons/full/obj16/Contribution.png | Bin 291 -> 0 bytes .../icons/full/obj16/IUDetails.gif | Bin 129 -> 1008 bytes .../icons/full/obj16/RepositoryBrowser.gif | Bin 129 -> 596 bytes .../pom.xml | 4 +- .../P2ItemProviderAdapterFactory.java | 43 + .../RequiredCapabilityItemProvider.java | 2 +- .../p2view/provider/BundleItemProvider.java | 10 + .../p2view/provider/BundlesItemProvider.java | 10 + .../provider/CategoriesItemProvider.java | 10 + .../p2view/provider/CategoryItemProvider.java | 10 + .../p2view/provider/FeatureItemProvider.java | 10 + .../p2view/provider/FeaturesItemProvider.java | 10 + .../p2view/provider/FragmentItemProvider.java | 10 + .../provider/FragmentsItemProvider.java | 10 + .../provider/IUDetailsItemProvider.java | 10 + .../provider/IUPresentationItemProvider.java | 10 + ...IUPresentationWithDetailsItemProvider.java | 10 + .../InstallableUnitsItemProvider.java | 10 + .../p2view/provider/LicensesItemProvider.java | 10 + ...aRepositoryStructuredViewItemProvider.java | 10 + .../provider/MiscellaneousItemProvider.java | 10 + .../p2view/provider/OtherIUItemProvider.java | 10 + .../p2view/provider/ProductItemProvider.java | 10 + .../p2view/provider/ProductsItemProvider.java | 10 + .../provider/PropertiesItemProvider.java | 10 + .../ProvidedCapabilitiesItemProvider.java | 10 + ...ProvidedCapabilityWrapperItemProvider.java | 21 + .../RepositoryBrowserItemProvider.java | 10 + .../RepositoryReferencesItemProvider.java | 10 + .../RequirementWrapperItemProvider.java | 20 + .../provider/RequirementsItemProvider.java | 10 + .../provider/TouchpointsItemProvider.java | 10 + .../provider/AggregationItemProvider.java | 10 + .../AvailableVersionItemProvider.java | 10 + .../AvailableVersionsHeaderItemProvider.java | 10 + .../provider/BundleItemProvider.java | 10 + .../provider/CategoryItemProvider.java | 10 + .../provider/ConfigurationItemProvider.java | 10 + .../provider/ContactItemProvider.java | 10 + .../provider/ContributionItemProvider.java | 10 + .../provider/CustomCategoryItemProvider.java | 10 + .../DescriptionProviderItemProvider.java | 10 + .../provider/ExclusionRuleItemProvider.java | 10 + .../provider/FeatureItemProvider.java | 10 + .../InstallableUnitRequestItemProvider.java | 17 +- .../provider/MapRuleItemProvider.java | 10 + .../MappedRepositoryItemProvider.java | 10 + .../provider/MappedUnitItemProvider.java | 10 + .../provider/MavenItemItemProvider.java | 10 + .../provider/MavenMappingItemProvider.java | 10 + ...tadataRepositoryReferenceItemProvider.java | 10 + .../provider/ProductItemProvider.java | 10 + .../provider/PropertyItemProvider.java | 10 + .../ValidConfigurationsRuleItemProvider.java | 10 + .../provider/ValidationSetItemProvider.java | 10 + .../feature.xml | 13 +- .../pom.xml | 28 +- .../META-INF/MANIFEST.MF | 2 +- .../about.html | 2 +- .../about.ini | 17 + .../about.mappings | 5 + .../about.properties | 21 + .../build.properties | 7 +- .../cbi32.png | Bin 0 -> 1415 bytes .../icons/full/obj16/clean_task.gif | Bin 0 -> 545 bytes .../icons/full/obj16/repository_8.gif | Bin 0 -> 328 bytes .../icons/full/obj16/validate_task.gif | Bin 0 -> 579 bytes .../plugin.properties | 4 +- .../plugin.xml | 15 +- .../pom.xml | 4 +- .../P2viewActionBarContributor.java | 416 +-- .../p2view/presentation/P2viewEditor.java | 1491 +------- .../AggregatorActionBarContributor.java | 39 +- .../presentation/AggregatorEditor.java | 380 +- .../DetachContributionResourceAction.java | 3 +- .../presentation/FixVersionsDialog.java | 4 +- .../feature.xml | 2 +- .../pom.xml | 26 +- .../META-INF/MANIFEST.MF | 2 +- .../about.html | 2 +- .../pom.xml | 4 +- .../.classpath | 1 + .../META-INF/MANIFEST.MF | 5 +- .../about.html | 2 +- .../pom.xml | 4 +- .../cbi/p2repo/aggregator/engine/Builder.java | 50 +- .../aggregator/engine/MirrorGenerator.java | 434 ++- .../engine/ValidationSetVerifier.java | 566 +-- .../InternalMetadataRepositoryIO.java | 2 +- .../META-INF/MANIFEST.MF | 2 +- .../about.html | 2 +- .../pom.xml | 4 +- .../META-INF/MANIFEST.MF | 2 +- .../about.html | 2 +- .../pom.xml | 4 +- .../META-INF/MANIFEST.MF | 2 +- org.eclipse.cbi.p2repo.aggregator/about.html | 2 +- .../model/Aggregator.genmodel | 10 +- .../plugin.properties | 1 + org.eclipse.cbi.p2repo.aggregator/pom.xml | 4 +- .../aggregator/impl/AggregationImpl.java | 8 + .../impl/InstallableUnitRequestImpl.java | 9 + .../util/MetadataRepositoryResourceImpl.java | 269 +- .../p2view/impl/RepositoryBrowserImpl.java | 25 +- ...tadataRepositoryStructuredViewBuilder.java | 328 ++ .../p2repo/aggregator/util/ResourceUtils.java | 23 +- .../feature.properties | 2 +- .../feature.xml | 2 +- .../pom.xml | 20 +- .../cbi.p2repo.product | 2 +- org.eclipse.cbi.p2repo.cli.product/pom.xml | 43 +- .../META-INF/MANIFEST.MF | 2 +- org.eclipse.cbi.p2repo.cli/about.html | 2 +- org.eclipse.cbi.p2repo.cli/pom.xml | 4 +- .../META-INF/MANIFEST.MF | 2 +- org.eclipse.cbi.p2repo.p2.edit/about.html | 2 +- ...ssingStepList_ProcessingStepDescriptor.gif | Bin 223 -> 0 bytes ...rtifactDescriptor_propertyMap_Property.gif | Bin 223 -> 0 bytes ...tRepository_artifactMap_ArtifactsByKey.gif | Bin 223 -> 0 bytes .../CreateArtifactsByKey_key_ArtifactKey.gif | Bin 223 -> 0 bytes ...rtifactsByKey_value_ArtifactDescriptor.gif | Bin 223 -> 0 bytes ...tsByKey_value_SimpleArtifactDescriptor.gif | Bin 223 -> 0 bytes ...itFragment_hostList_RequiredCapability.gif | Bin 976 -> 0 bytes ...leUnitFragment_host_RequiredCapability.gif | Bin 223 -> 0 bytes ...stallableUnitFragment_host_Requirement.gif | Bin 223 -> 0 bytes ...stallableUnit_artifactList_ArtifactKey.gif | Bin 945 -> 0 bytes ...t_fragmentList_InstallableUnitFragment.gif | Bin 949 -> 0 bytes ...uiredCapabilityList_RequiredCapability.gif | Bin 976 -> 0 bytes ...ateInstallableUnit_properties_Property.gif | Bin 920 -> 0 bytes ...teInstallableUnit_propertyMap_Property.gif | Bin 920 -> 0 bytes ...rovidedCapabilities_ProvidedCapability.gif | Bin 962 -> 0 bytes ...videdCapabilityList_ProvidedCapability.gif | Bin 962 -> 0 bytes ...equiredCapabilities_RequiredCapability.gif | Bin 976 -> 0 bytes ...uiredCapabilityList_RequiredCapability.gif | Bin 976 -> 0 bytes ...Unit_touchpointDataList_TouchpointData.gif | Bin 907 -> 0 bytes ...ructionMap_value_TouchpointInstruction.gif | Bin 907 -> 0 bytes ...itory_installableUnits_InstallableUnit.gif | Bin 996 -> 0 bytes ...stallableUnits_InstallableUnitFragment.gif | Bin 949 -> 0 bytes ..._installableUnits_InstallableUnitPatch.gif | Bin 223 -> 0 bytes ...etadataRepository_propertyMap_Property.gif | Bin 920 -> 0 bytes ...ository_references_RepositoryReference.gif | Bin 223 -> 0 bytes ...positoryReferences_RepositoryReference.gif | Bin 962 -> 0 bytes .../CreateRepository_propertyMap_Property.gif | Bin 223 -> 0 bytes ...criptor_repositoryPropertyMap_Property.gif | Bin 223 -> 0 bytes ...leArtifactRepository_rules_MappingRule.gif | Bin 223 -> 0 bytes ...ointData_instructionMap_InstructionMap.gif | Bin 920 -> 0 bytes .../icons/full/obj16/InstallableUnitPatch.gif | Bin 129 -> 609 bytes .../icons/full/obj16/ProvidedCapability.gif | Bin 129 -> 369 bytes .../icons/full/obj16/RequiredCapability.gif | Bin 129 -> 349 bytes .../full/obj16/RequiredPropertiesMatch.gif | Bin 0 -> 223 bytes .../icons/full/ovr16/excluded.gif | Bin 0 -> 57 bytes .../icons/full/ovr16/greedy.gif | Bin 0 -> 1600 bytes .../icons/full/ovr16/optional.gif | Bin 0 -> 78 bytes .../plugin.properties | 11 +- org.eclipse.cbi.p2repo.p2.edit/pom.xml | 4 +- .../ArtifactDescriptorItemProvider.java | 10 + .../p2/provider/ArtifactKeyItemProvider.java | 10 + .../ArtifactRepositoryItemProvider.java | 10 + .../provider/ArtifactsByKeyItemProvider.java | 10 + .../p2/provider/CopyrightItemProvider.java | 10 + .../InstallableUnitFragmentItemProvider.java | 13 + .../provider/InstallableUnitItemProvider.java | 16 + .../InstallableUnitPatchItemProvider.java | 16 + .../provider/InstructionMapItemProvider.java | 10 + .../p2/provider/LicenseItemProvider.java | 10 + .../p2/provider/MappingRuleItemProvider.java | 10 + .../MetadataRepositoryItemProvider.java | 10 + .../P2ItemProviderAdapterFactory.java | 27 + .../ProcessingStepDescriptorItemProvider.java | 10 + .../p2/provider/PropertyItemProvider.java | 10 + .../ProvidedCapabilityItemProvider.java | 10 + .../p2/provider/RepositoryItemProvider.java | 10 + .../RepositoryReferenceItemProvider.java | 10 + .../RequiredCapabilityItemProvider.java | 17 +- .../RequiredPropertiesMatchItemProvider.java | 158 + .../RequirementChangeItemProvider.java | 10 + .../p2/provider/RequirementItemProvider.java | 54 +- .../SimpleArtifactDescriptorItemProvider.java | 10 + .../SimpleArtifactRepositoryItemProvider.java | 10 + .../provider/TouchpointDataItemProvider.java | 10 + .../TouchpointInstructionItemProvider.java | 10 + .../provider/TouchpointTypeItemProvider.java | 10 + .../UpdateDescriptorItemProvider.java | 10 + .../feature.xml | 2 +- .../pom.xml | 21 +- .../META-INF/MANIFEST.MF | 2 +- .../about.html | 2 +- .../plugin.properties | 2 +- .../pom.xml | 4 +- .../META-INF/MANIFEST.MF | 2 +- org.eclipse.cbi.p2repo.p2.maven/about.html | 2 +- org.eclipse.cbi.p2repo.p2.maven/pom.xml | 4 +- .../META-INF/MANIFEST.MF | 2 +- org.eclipse.cbi.p2repo.p2.tests/about.html | 2 +- org.eclipse.cbi.p2repo.p2.tests/pom.xml | 6 +- .../META-INF/MANIFEST.MF | 2 +- org.eclipse.cbi.p2repo.p2/about.html | 2 +- org.eclipse.cbi.p2repo.p2/model/p2.ecore | 30 +- org.eclipse.cbi.p2repo.p2/model/p2.genmodel | 11 +- org.eclipse.cbi.p2repo.p2/plugin.properties | 2 +- org.eclipse.cbi.p2repo.p2/pom.xml | 4 +- .../org/eclipse/cbi/p2repo/p2/P2Factory.java | 10 + .../org/eclipse/cbi/p2repo/p2/P2Package.java | 301 +- .../p2repo/p2/RequiredPropertiesMatch.java | 82 + .../p2/impl/MetadataRepositoryImpl.java | 35 +- .../cbi/p2repo/p2/impl/P2FactoryImpl.java | 98 +- .../cbi/p2repo/p2/impl/P2PackageImpl.java | 115 +- .../p2/impl/RequiredPropertiesMatchImpl.java | 262 ++ .../p2/impl/TouchpointInstructionImpl.java | 10 +- .../cbi/p2repo/p2/util/P2AdapterFactory.java | 21 + .../eclipse/cbi/p2repo/p2/util/P2Bridge.java | 10 + .../eclipse/cbi/p2repo/p2/util/P2Switch.java | 28 + .../p2/util/RepositoryTranslationSupport.java | 4 + .../.gitignore | 1 + org.eclipse.cbi.p2repo.releng.parent/pom.xml | 367 +- .../promotion/pom.xml | 148 + ...lipse.cbi.p2repo.aggregator.prereqs.target | 12 +- org.eclipse.cbi.p2repo.releng.target/pom.xml | 28 +- .../category.xml | 6 + org.eclipse.cbi.p2repo.site.eclipse/pom.xml | 8 +- .../org.eclipse.core.resources.prefs | 2 + .../feature.xml | 2 +- org.eclipse.cbi.p2repo.tests.feature/pom.xml | 27 +- .../META-INF/MANIFEST.MF | 2 +- org.eclipse.cbi.p2repo.util/about.html | 2 +- org.eclipse.cbi.p2repo.util/pom.xml | 4 +- .../org.eclipse.core.resources.prefs | 2 + org.eclipse.cbi.tycho/about.html | 2 +- org.eclipse.cbi.tycho/plugin.xml | 2 +- org.eclipse.cbi.tycho/pom.xml | 2 +- 389 files changed, 24563 insertions(+), 3325 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 cbi.svg create mode 100644 cbi16.png create mode 100644 favicon.ico create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.classpath create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.project create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.core.resources.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.jdt.ui.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.ltk.core.refactoring.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.pde.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/COPYRIGHT create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/META-INF/MANIFEST.MF create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/about.html create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/build.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/Analysis.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/CapabilityAnalysis.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/CapabilityResolution.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/ContributionAnalysis.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/ContributionAnalysisDisabled.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/GitRepository.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/InstallableUnitAnalysis.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/PatternGroup.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/Project.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/RequirementAnalysis.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/RequirementResolution.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayBlank.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayMappedBottom.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayMappedTop.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayUnmappedBottom.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayUnmappedTop.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/plugin.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/plugin.xml create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/pom.xml create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AggregationAnalyzerEditPlugin.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalysisItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalyzerItemProviderAdapter.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalyzerItemProviderAdapterFactory.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/CapabilityAnalysisItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/CapabilityResolutionItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/ContributionAnalysisItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/GitRepositoryItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/InstallableUnitAnalysisItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/ProjectItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/RequirementAnalysisItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/RequirementResolutionItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.project create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.settings/org.eclipse.core.resources.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/build.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/feature.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/feature.xml create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/pom.xml create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.classpath create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.project create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.core.resources.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.jdt.ui.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.ltk.core.refactoring.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.pde.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/COPYRIGHT create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/META-INF/MANIFEST.MF create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.html create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.ini create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.mappings create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/build.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/cbi32.png create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/obj16/AnalyzerModelFile.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/obj16/clear.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/obj16/history.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/obj16/namespace.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/wizban/NewAnalyzer.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/plugin.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/plugin.xml create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/pom.xml create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AggregationAnalyzerEditorPlugin.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerActionBarContributor.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerEditor.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerModelWizard.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/BreadCrumbSupport.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/AnalyzeHandler.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/BaseHandler.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/ClearCacheHandler.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/LastModifiedHandler.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/ProjectReconcilerHandler.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/.classpath create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/.gitignore create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/.project create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.core.resources.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.core.runtime.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.jdt.core.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.jdt.ui.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.ltk.core.refactoring.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.pde.prefs create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/COPYRIGHT create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/META-INF/MANIFEST.MF create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/about.html create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/build.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/model/AggregationAnalyzer.ecore create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/model/AggregationAnalyzer.genmodel create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/plugin.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/plugin.xml create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/pom.xml create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AggregationAnalyzer.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AggregationAnalyzerPlugin.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/Analysis.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AnalyzerFactory.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AnalyzerPackage.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/CapabilityAnalysis.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/CapabilityResolution.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/ContributionAnalysis.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/GitRepository.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/InstallableUnitAnalysis.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/Project.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/RequirementAnalysis.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/RequirementResolution.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalysisImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalyzerFactoryImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalyzerPackageImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/CapabilityAnalysisImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/CapabilityResolutionImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/ContributionAnalysisImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/GitRepositoryImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/InstallableUnitAnalysisImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/ProjectImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/RequirementAnalysisImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/RequirementResolutionImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerAdapterFactory.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerResourceFactoryImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerResourceImpl.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerSwitch.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerUtil.java delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_configurations_Configuration.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_contacts_Contact.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_contributions_Contribution.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_customCategories_CustomCategory.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_mavenMappings_MavenMapping.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_validationRepositories_MappedRepository.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_validationRepositories_MetadataRepositoryReference.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_validationSets_ValidationSet.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregatorResourceView_validationSets_ValidationSet.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateContribution_mavenMappings_MavenMapping.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateContribution_repositories_MappedRepository.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_bundles_Bundle.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_categories_Category.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_features_Feature.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_mapRules_ExclusionRule.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_mapRules_ValidConfigurationsRule.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_products_Product.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateValidationSet_contributions_Contribution.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateValidationSet_validationRepositories_MappedRepository.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateValidationSet_validationRepositories_MetadataRepositoryReference.gif delete mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/icons/full/obj16/Contribution.png create mode 100644 org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2/provider/P2ItemProviderAdapterFactory.java create mode 100644 org.eclipse.cbi.p2repo.aggregator.editor/about.ini create mode 100644 org.eclipse.cbi.p2repo.aggregator.editor/about.mappings create mode 100644 org.eclipse.cbi.p2repo.aggregator.editor/about.properties create mode 100644 org.eclipse.cbi.p2repo.aggregator.editor/cbi32.png create mode 100644 org.eclipse.cbi.p2repo.aggregator.editor/icons/full/obj16/clean_task.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.editor/icons/full/obj16/repository_8.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator.editor/icons/full/obj16/validate_task.gif create mode 100644 org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2view/util/MetadataRepositoryStructuredViewBuilder.java delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactDescriptor_processingStepList_ProcessingStepDescriptor.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactDescriptor_propertyMap_Property.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactRepository_artifactMap_ArtifactsByKey.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactsByKey_key_ArtifactKey.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactsByKey_value_ArtifactDescriptor.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactsByKey_value_SimpleArtifactDescriptor.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnitFragment_hostList_RequiredCapability.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnitFragment_host_RequiredCapability.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnitFragment_host_Requirement.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_artifactList_ArtifactKey.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_fragmentList_InstallableUnitFragment.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_metaRequiredCapabilityList_RequiredCapability.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_properties_Property.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_propertyMap_Property.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_providedCapabilities_ProvidedCapability.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_providedCapabilityList_ProvidedCapability.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_requiredCapabilities_RequiredCapability.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_requiredCapabilityList_RequiredCapability.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_touchpointDataList_TouchpointData.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstructionMap_value_TouchpointInstruction.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_installableUnits_InstallableUnit.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_installableUnits_InstallableUnitFragment.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_installableUnits_InstallableUnitPatch.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_propertyMap_Property.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_references_RepositoryReference.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_repositoryReferences_RepositoryReference.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateRepository_propertyMap_Property.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateSimpleArtifactDescriptor_repositoryPropertyMap_Property.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateSimpleArtifactRepository_rules_MappingRule.gif delete mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateTouchpointData_instructionMap_InstructionMap.gif create mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/obj16/RequiredPropertiesMatch.gif create mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ovr16/excluded.gif create mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ovr16/greedy.gif create mode 100644 org.eclipse.cbi.p2repo.p2.edit/icons/full/ovr16/optional.gif create mode 100644 org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequiredPropertiesMatchItemProvider.java create mode 100644 org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/RequiredPropertiesMatch.java create mode 100644 org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/RequiredPropertiesMatchImpl.java create mode 100644 org.eclipse.cbi.p2repo.releng.parent/.gitignore create mode 100644 org.eclipse.cbi.p2repo.releng.parent/promotion/pom.xml create mode 100644 org.eclipse.cbi.p2repo.tests.feature/.settings/org.eclipse.core.resources.prefs create mode 100644 org.eclipse.cbi.tycho/.settings/org.eclipse.core.resources.prefs diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/Build.launch b/Build.launch index fb1b92f88..0735bc566 100644 --- a/Build.launch +++ b/Build.launch @@ -8,6 +8,6 @@ - + diff --git a/cbi.svg b/cbi.svg new file mode 100644 index 000000000..2695b0251 --- /dev/null +++ b/cbi.svg @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + cbi + + diff --git a/cbi16.png b/cbi16.png new file mode 100644 index 0000000000000000000000000000000000000000..09491d01d1445641732a282b302b7bdee871505b GIT binary patch literal 678 zcmV;X0$KfuP)4*5JU)t2{DT>rUIdy zmeDGtKOlslMT@YANP}pRrACJNHR_D>zP<0gr^TQ&L!jWZJUsVzp36B0*rG&bVRf+S zFo0tM`mO8Bv6|}>xlI8$4f0}54_Kh+?3lbQx}kuy1=tawHwS=A&gT*s-v-p?fy+Lv z0ld1#j3%bg)yclnW1zWy>cak}v4vrQO zzX|{-Ut1po5Vhtb-=t7SeBXNVefsH*nWf#`0KiQ6z1)0FY59x<_Ek=S*d_)bCQu*& z5!MiS04NmtXZ|%R7Aqy7EE~O1^=o>;jVG6P#gJl+FD3uaujG_9ZuP$K{%Y|oxF zNu6Pc&q63JOCZwF0EQK*&Z2MklT>@-HFGZ<(>=asibdxiOHzki-yW#^f&hR*wy~X9 z3_0357{7TsE-kOcW&1tRb`3w5f{7fnDVLV+j{}#?>TtBx2peDL=I*VmliX}FvpSf3 zSlMACt#6_|JJm~o>t>S~PM7v$Gy2alB{~3kLXdjrddBER$Fybr1={V?u;=U?JOBUy M07*qoM6N<$g6jh&y#N3J literal 0 HcmV?d00001 diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5d8ecf6e431d244260d289126a600c33db75ae26 GIT binary patch literal 1150 zcmcIjOKTHR6h5`JK2n=WJ7y-y+&hzLVp5ZZ1x4KW*a(8IeC6FVRf$$55vthLEG%M$ zD#=9X&W(uq0q)hJxKY>Q14M9FwZ%-_IG&SnAk>Xnc!%%aJKvdazH{%n7oZOxK>+ME zC=USm0U(Y*3K@sT0RUr%`W$rL|3jykt-Y$*npN&u2edn1DTRM)hP{EC?FHUw-vYzN zOnYmj<7TVYo67l`HGb^jru9Bjvo}?@jD{|F{fDc=!y|?u2o;a8t0D;6tk*k6U!Mcm zcx9_Faa9zzxn8J!#2T&Yl*EswwDFabdeY7-(Kn@lo;?*#*eP{*zb{w!UlipYet(yYKo>OX`E15`B9{<|nFNNk^aMvM3*+MC=wC15{ z_Y-FT4BiCr;S_J3)0zPN#4X`Da=Gpi@6JBDKg_iD_jG@{f6~L;wgJ8&o*`Z%49wP` WY!QQqfj@KN7AF8+A)X>gL)zcnHP1Q# literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.classpath b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.classpath new file mode 100644 index 000000000..39e5c779e --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.project b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.project new file mode 100644 index 000000000..7f3dcf94e --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.project @@ -0,0 +1,28 @@ + + + org.eclipse.cbi.p2repo.aggregator.analyzer.edit + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.core.resources.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 000000000..b3c7fded6 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1 @@ +eclipse.preferences.version=1 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..1fbb982d8 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,418 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assertion_message=0 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_annotations=0 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=132 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..8d15ba4a9 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,129 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=true +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_aggrCleanup +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_aggrFormatEMF +formatter_settings_version=21 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=true +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=false +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=true +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 000000000..39b36fe8e --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Tue Jun 23 16:34:13 CEST 2009 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.pde.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..d857b126b --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/.settings/org.eclipse.pde.prefs @@ -0,0 +1,33 @@ +#Wed Apr 27 17:32:32 CEST 2011 +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=2 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=2 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/COPYRIGHT b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/COPYRIGHT new file mode 100644 index 000000000..f934ce0f5 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/COPYRIGHT @@ -0,0 +1,8 @@ +Copyright (c) 2021 Eclipse Foundation and others. + +This program and the accompanying materials +are made available under the terms of the Eclipse Public License 2.0 +which accompanies this distribution, and is available at +https://www.eclipse.org/legal/epl-2.0/ + +SPDX-License-Identifier: EPL-2.0 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/META-INF/MANIFEST.MF new file mode 100644 index 000000000..4a349dd9f --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/META-INF/MANIFEST.MF @@ -0,0 +1,20 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator.analyzer.edit;singleton:=true +Automatic-Module-Name: org.eclipse.cbi.p2repo.aggregator.analyzer.edit +Bundle-Version: 1.1.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: org.eclipse.cbi.p2repo.aggregator.analyzer.provider.AggregationAnalyzerEditPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Export-Package: org.eclipse.cbi.p2repo.aggregator.analyzer.provider +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.cbi.p2repo.aggregator.analyzer;visibility:=reexport, + org.eclipse.emf.edit;visibility:=reexport, + org.eclipse.cbi.p2repo.aggregator;visibility:=reexport, + org.eclipse.cbi.p2repo.aggregator.edit;visibility:=reexport, + org.eclipse.cbi.p2repo.p2;visibility:=reexport, + org.eclipse.cbi.p2repo.p2.edit;visibility:=reexport +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-11 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/about.html b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/about.html new file mode 100644 index 000000000..16e7373a1 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

November 22, 2017

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v20.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/build.properties b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/build.properties new file mode 100644 index 000000000..60f525de7 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/build.properties @@ -0,0 +1,19 @@ +# Copyright (c) 2021 Eclipse Foundation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src/ +output.. = bin/ +src.includes = COPYRIGHT,\ + about.html diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/Analysis.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/Analysis.gif new file mode 100644 index 0000000000000000000000000000000000000000..13ce11b1490b0691db9fc3b2a7a2a2055a5cf965 GIT binary patch literal 310 zcmZ?wbhEHb6krfwxXQp_5i-F#Vya!t47-?VZYlHA>(@?NeB3%}s%zRpx3q<>Df3;^ z=DVfM_sd_oXx)M9kKaz+bz)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH*fx*@iVG4F4|F|GUueA4sk<{kzVzH$iV!mf3%7K=GfTb5Uwy zNotBhd1gt5g1e`00E6OB7DfgJdj=f_AOLxkfvxhu`~r_Z5A${`y2O#KHvRBzAGh6( z?H18zzv)=XL_E3lv7%wUlY7b|jj8M6j~sMV+SwU@+;#B|3pXWg1uZQ#dlnW}hHeI4 zX=!yCSxrrQ=IP>W5|TWMiuxM5I=U|0Ok$i&@^X550gNJ|jE068i~>T88P1HmcJFs& Gum%7R$F^Aj literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/CapabilityResolution.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/CapabilityResolution.gif new file mode 100644 index 0000000000000000000000000000000000000000..30f0c48da8d4450f7e94a696c4de0a7cc41aa728 GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgte-L}loH;~uRaQAn7P!5RR`@-PYj literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/ContributionAnalysis.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/ContributionAnalysis.gif new file mode 100644 index 0000000000000000000000000000000000000000..62809274a2eac6abaf27c4842c39c5afedd779c3 GIT binary patch literal 233 zcmZ?wbhEHb6krfwXpv-Sl9mqD*FPd5Az^bQ#>r`qxp{oN{TdIC`gr^LdLW9In0jPy zdAY<99f>0|=g+UdKi~eyE{Xm7=l{QNfB*je|Nrg(|F8f5fByg9AO2$lia%KxxftXb zbQpjDWG4e_+5`2zl+3XncJsr&&fiDe)~{INvTo|ZfFLesgUORc`n8%1 zsuF|dc^pnXy;e=**qaoabs;(eE*4yw+mB}&m~^hVu3nfkrNzU0PPS(ahhampmvW1| Rb(OY0zwJa_eSJj+YXDA}Z8ZP@ literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/ContributionAnalysisDisabled.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/ContributionAnalysisDisabled.gif new file mode 100644 index 0000000000000000000000000000000000000000..a4f6d093f76a5c98ce4cd370af684663379c7de6 GIT binary patch literal 233 zcmZ?wbhEHb6krfwXpv-Sl9mqD*FPd5Az^bQ#>r`qxp{oN{TdIC`gr^LdLW9In0jPy zdAY<99f>0|=g+UdKi~eyE{Xm7=l{QNfB*je|Nrg(|F8f5fByg9AO2$lia%KxxftXb zbQpjDWG4e_+5`2zl+3;+zec9B50e$?;o)ZJ#bh%G$ z+Iq-j?aV1&W``@*a^-&!G?P0ov}{_>w2I4*L?RvMCp`$*nKaYSQ8mcXP{cU7TG`S+ SO-o2$$hL&dNnc-)!5RR2K5d-< literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/GitRepository.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/GitRepository.gif new file mode 100644 index 0000000000000000000000000000000000000000..e149a8b7d2d4e6215dfff01acf12512a32bcf4c8 GIT binary patch literal 588 zcmZ?wbhEHb6krfwI2OfVU}$7zV{7N&=;-3=;_7xvPye)@{uzCJjusA`Y5Ka;^!29e zo6a_CZfoD&WwE!{bpHh7gA=t6PBb_?N#pPoy`xiAj!x4$I$iPbRHq};oR7_tJ2q3} z_$>M3vs91G^f)y>|!nKOQySfAqxDq$-TlC?G0 zSJE*s6<<^@?dcN~;O$^1x>n3}ySLa2t`%~(Id%HX>3RWo%gD=Du0~qc z^LtoCXtMA|u!nGS@I+YD^SPRZGljord(ZXWtX@*WIE>MeA&f07OoU<1!V}ItT3T#8 lD}okyO=aOr*2ywly69+kaFkBe!HtWL_pNo(;$mU21_0)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&?f$esFIN11vEt9G_5VK}I@rgs zubbi0_OxHOYJT5s{{MRO|JPgoe}DM@=ktAC442jhyt&x@|LKzdUvF=%W7ty1u)c!f z(hB$gpRTScVR(G7_U^9QySr;|ZYn(7X?DEZd|!*n-e!}{1#17nfMF;A#h)yU3=AF& zIv~e_;)H>HS%XKDbBl9Rdq~J}oVCbJuoz8=Dmz?0gy;M;zK$@QF)tiSwze znJ60@YkRP;urj=0;FXrvkyX&s^I-lW&L$zrqoQK1YiVIApevA|*vKHLSn{GlMT4Q0 bi?QlULWKqc3n!z78rOut#qKVR3=Gx)we!Y@ literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/PatternGroup.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/PatternGroup.gif new file mode 100644 index 0000000000000000000000000000000000000000..ca7d89ce94942ee8199408b30f2a9933d2a57740 GIT binary patch literal 924 zcmZ?wbhEHb6krfwc&@+z1cI{mGCF>;I(|%6bw)1f0e%+#NiB($OA{-XB~~p>tXh^* zy(qP2QF`sloTjzKtxF5rH4wZ^xcnVZ-4&(|DT141!&7uX%Vw_6FKo+42*(Pr8$5i6IoAiPMa`QS^~o65<4+f z`pHDrKywa@iLAK{418Q-7r3@5a0zR0i7a4X5Sc0+09Cn7VycV`Smg|`N(P`Zpp-fL z4Ir1ZPk~EFfb-7`pn(hw9zbOb4BTL4oInH3LH6dFtMA}u(*Ux~e)*bTb-XE{&cF}> zF$Ab)sMRyxEi1=P!OULNV3{42TFw_ zNe@e=;!hSvE{6XMIw0SH@&p4%CBuJC5s9P+`SBQ5445%|!hombYW zWyZ#2XJ!GXE|JUxg^tM@!K?nbFIakdx&b@e28YdQXBjxzD^@rpHnni@%hU)=*ucQf wC)-zaphH}$AX46H(9w^*jN~>0TUMBr~m)} literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/Project.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/obj16/Project.gif new file mode 100644 index 0000000000000000000000000000000000000000..9c7c89f939ebca51da83992f10f5a481f938ba62 GIT binary patch literal 351 zcmZ?wbhEHb6krfwxXJ(m|NsA=+SoC*v9q(fx2SM(e9GK}lz9n2GIefp`po#$xnc41 z0%H~j#V&FUUEvzG!YgWN>%&Seg|6F8S#PBzcr94?)kg2*G_|W{~uRaQAn7P!5RSBPcTCO literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayBlank.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayBlank.gif new file mode 100644 index 0000000000000000000000000000000000000000..0ace1e0e9ccf8fe0a0a95a9ba54c32b731ba6189 GIT binary patch literal 67 zcmZ?wbhEHbWM|-DIK;}Zf4=?w`S$YHftjOX O*PVX`rzSHnSOWlk6&Vo# literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayMappedBottom.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayMappedBottom.gif new file mode 100644 index 0000000000000000000000000000000000000000..ff89436ab95668e9b9fa7e5ec40cb7700cb23e5d GIT binary patch literal 158 zcmZ?wbhEHbWM|-DIKsd%w@h+DsrZ6&>A3~c^9yBW=g7^^k$t%_dRD6ZtYoFBNs9Mo zINh7>e7R0*O0>#kD5(R P%+z@Oc+KKa4hCxg4cRI& literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayMappedTop.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayMappedTop.gif new file mode 100644 index 0000000000000000000000000000000000000000..3d5bfc00531b0cfed00c92f98e5cfac714918fd4 GIT binary patch literal 108 zcmZ?wbhEHbWM|-D*v!Dd7%`h6X$3>>CWhoCjJfL=EA}unA7N-b%-D5~Vd52ro^!m@ zuFB26X0+(We=tz|$->CMz|Ww=00ba27+54fc)q+;!?*IKpK-`R16FmNBTrclw=(L9 IF)~;K03swNS^xk5 literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayUnmappedBottom.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayUnmappedBottom.gif new file mode 100644 index 0000000000000000000000000000000000000000..e84a7f14d9fe63dcfaf20fbb01f31898a8f18b15 GIT binary patch literal 108 zcmZ?wbhEHbWM|-D*v!E2|Nr0lRYLPi#O9Ss&ncFkS19xU-MQI0GPASgXQ#@~PE(kX ztT;1XVM?s(e=tz|$->CMz|Ww=00ba27+54f*orSHO}Y`uvy(kRVbWxYQ(FyYU(UHK I#>ij|0OR#2aR2}S literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayUnmappedTop.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/icons/full/ovr16/OverlayUnmappedTop.gif new file mode 100644 index 0000000000000000000000000000000000000000..f17971fce7399f3e54180187dddfc153ae9595aa GIT binary patch literal 108 zcmZ?wbhEHbWM|-D*v!E2|KERx=miW(OPO-F-h2IpA$bWy`A&ws4NT>G8G0@*>>m~qn8|6ri_lZBCifuBK#0SG{5FtA8|@O*izCU5CWk;EyE3>@YH$DeW>ZDrLH IV`Q)f01hiCj{pDw literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/plugin.properties b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/plugin.properties new file mode 100644 index 000000000..4c4efa2f9 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/plugin.properties @@ -0,0 +1,85 @@ +# Copyright (c) 2021 Eclipse Foundation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 + +pluginName = CBI Aggregator Analysis Model Edit Support +providerName = Eclipse CBI + +_UI_CreateChild_text = {0} +_UI_CreateChild_text2 = {1} {0} +_UI_CreateChild_text3 = {1} +_UI_CreateChild_tooltip = Create New {0} Under {1} Feature +_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. +_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. + +_UI_PropertyDescriptor_description = The {0} of the {1} + +_UI_Analysis_type = Analysis +_UI_Unknown_type = Object + +_UI_Unknown_datatype= Value + +_UI_Analysis_aggregation_feature = Aggregation +_UI_Unknown_feature = Unspecified + +_UI_ContributionAnalysis_type = Contribution Analysis +_UI_Analysis_releaseDate_feature = Release Date +_UI_Analysis_releaseDate_description = The date of the next scheduled release +_UI_Analysis_contributions_feature = Contributions +_UI_ContributionAnalysis_contribution_feature = Contribution +_UI_ContributionAnalysis_label_feature = Label +_UI_InstallableUnitAnalysis_type = Installable Unit Analysis +_UI_ContributionAnalysis_installableUnits_feature = Installable Units +_UI_InstallableUnitAnalysis_installableUnit_feature = Installable Unit +_UI_RequirementAnalysis_type = Requirement Analysis +_UI_InstallableUnitAnalysis_contribution_feature = Contribution +_UI_InstallableUnitAnalysis_requirements_feature = Requirements +_UI_RequirementAnalysis_requirement_feature = Requirement +_UI_RequirementAnalysis_resolutions_feature = Resolutions +_UI_RequirementResolution_type = Requirement Resolution +_UI_RequirementResolution_installableUnit_feature = Installable Unit +_UI_Analysis_dominators_feature = Dominators +_UI_Analysis_levels_feature = Levels +_UI_CapabilityAnalysis_type = Capability Analysis +_UI_CapabilityResolution_type = Capability Resolution +_UI_InstallableUnitAnalysis_capabilities_feature = Capabilities +_UI_RequirementAnalysis_installableUnit_feature = Installable Unit +_UI_CapabilityAnalysis_capability_feature = Capability +_UI_CapabilityAnalysis_resolutions_feature = Resolutions +_UI_CapabilityResolution_requirement_feature = Requirement +_UI_RequirementResolution_requirement_feature = Requirement +_UI_NameToPatternMapEntry_type = Name To Pattern Map Entry +_UI_Analysis_exclusion_feature = Exclusion +_UI_Analysis_exclusion_description = A pattern that maches all installable units that will be omitted from analysis +_UI_Analysis_groups_feature = Groups +_UI_NameToPatternMapEntry_key_feature = Key +_UI_NameToPatternMapEntry_key_description = The name of the contribution analysis group in which the installable units that match the value pattern will be placed +_UI_NameToPatternMapEntry_value_feature = Value +_UI_NameToPatternMapEntry_value_description = A pattern that matches all installable unit to be included in the group +_UI_CapabilityResolution_capability_feature = Capability +_UI_CapabilityAnalysis_installableUnit_feature = Installable Unit +_UI_RequirementResolution_capability_feature = Capability +_UI_ContributionAnalysis_match_feature = Match +_UI_ContributionAnalysis_match_description = A pattern that matches all installable unit to be included in the group +_UI_ContributionAnalysis_dominant_feature = Dominant +_UI_ContributionAnalysis_lastModified_feature = Last Modified +_UI_Project_type = Project +_UI_GitRepository_type = Git Repository +_UI_ContributionAnalysis_projects_feature = Projects +_UI_Project_name_feature = Name +_UI_Project_site_feature = Site +_UI_Project_version_feature = Version +_UI_Project_contribution_feature = Contribution +_UI_Project_parent_feature = Parent +_UI_Project_repositories_feature = Repositories +_UI_Project_subprojects_feature = Subprojects +_UI_GitRepository_uRI_feature = URI +_UI_GitRepository_lastModified_feature = Last Modified +_UI_GitRepository_project_feature = Project +_UI_Project_releaseDate_feature = Release Date +_UI_Project_releaseDate_description = The date of the version release diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/plugin.xml b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/plugin.xml new file mode 100644 index 000000000..7d677d532 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/plugin.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/pom.xml b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/pom.xml new file mode 100644 index 000000000..418af45e5 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + org.eclipse.cbi.p2repo.aggregator.analyzer.edit + 1.1.0-SNAPSHOT + eclipse-plugin + + org.eclipse.cbi + org.eclipse.cbi.p2repo.releng.parent + ../org.eclipse.cbi.p2repo.releng.parent + 1.1.0-SNAPSHOT + + \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AggregationAnalyzerEditPlugin.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AggregationAnalyzerEditPlugin.java new file mode 100644 index 000000000..891b75047 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AggregationAnalyzerEditPlugin.java @@ -0,0 +1,96 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import org.eclipse.cbi.p2repo.aggregator.provider.AggregatorEditPlugin; +import org.eclipse.cbi.p2repo.p2.provider.P2EditPlugin; +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the AggregationAnalyzer edit plugin. + * + * + * @generated + */ +public final class AggregationAnalyzerEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final AggregationAnalyzerEditPlugin INSTANCE = new AggregationAnalyzerEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public AggregationAnalyzerEditPlugin() { + super(new ResourceLocator[] { AggregatorEditPlugin.INSTANCE, P2EditPlugin.INSTANCE, }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalysisItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalysisItemProvider.java new file mode 100644 index 000000000..7f77c165c --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalysisItemProvider.java @@ -0,0 +1,261 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.cbi.p2repo.aggregator.Aggregation; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +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.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemColorProvider; +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.ViewerNotification; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis} object. + * + * + * @generated + */ +public class AnalysisItemProvider extends AnalyzerItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, + IItemLabelProvider, IItemPropertySource, IItemColorProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public AnalysisItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addReleaseDatePropertyDescriptor(object); + addExclusionPropertyDescriptor(object); + addLevelsPropertyDescriptor(object); + addAggregationPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Release Date feature. + * + * + * @generated + */ + protected void addReleaseDatePropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_Analysis_releaseDate_feature"), getString("_UI_Analysis_releaseDate_description"), + AnalyzerPackage.Literals.ANALYSIS__RELEASE_DATE, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null, + URI.createURI("editor://org.eclipse.nebula.widgets.cdatetime/yyyy-MM-dd"))); + } + + /** + * This adds a property descriptor for the Exclusion feature. + * + * + * @generated + */ + protected void addExclusionPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_Analysis_exclusion_feature"), + getString("_UI_Analysis_exclusion_description"), AnalyzerPackage.Literals.ANALYSIS__EXCLUSION, + true, false, false, ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Levels feature. + * + * + * @generated + */ + protected void addLevelsPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_Analysis_levels_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Analysis_levels_feature", + "_UI_Analysis_type"), + AnalyzerPackage.Literals.ANALYSIS__LEVELS, true, false, false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Aggregation feature. + * + * + * @generated + */ + protected void addAggregationPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_Analysis_aggregation_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Analysis_aggregation_feature", + "_UI_Analysis_type"), + AnalyzerPackage.Literals.ANALYSIS__AGGREGATION, false, false, true, null, null, null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(AnalyzerPackage.Literals.ANALYSIS__CONTRIBUTIONS); + } + return childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns Analysis.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Analysis")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + Analysis analysis = (Analysis) object; + Aggregation aggregation = analysis.getAggregation(); + if (aggregation != null) { + String label = aggregation.getLabel(); + String location = EcoreUtil.getURI((EObject) aggregation).trimFragment().toString(); + if (label != null) { + return label + " [" + location + "]"; + } + return location; + } + return getString("_UI_Analysis_type"); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(Analysis.class)) { + case AnalyzerPackage.ANALYSIS__RELEASE_DATE: + case AnalyzerPackage.ANALYSIS__EXCLUSION: + case AnalyzerPackage.ANALYSIS__LEVELS: + case AnalyzerPackage.ANALYSIS__AGGREGATION: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case AnalyzerPackage.ANALYSIS__CONTRIBUTIONS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + default: + super.notifyChanged(notification); + return; + } + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(AnalyzerPackage.Literals.ANALYSIS__CONTRIBUTIONS, + AnalyzerFactory.eINSTANCE.createContributionAnalysis())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return AggregationAnalyzerEditPlugin.INSTANCE; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalyzerItemProviderAdapter.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalyzerItemProviderAdapter.java new file mode 100644 index 000000000..f57eb7d4a --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalyzerItemProviderAdapter.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2021 Eclipse contributors and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedImage; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; + +public class AnalyzerItemProviderAdapter extends ItemProviderAdapter { + + private AdapterFactoryItemDelegator itemDelegator; + + public AnalyzerItemProviderAdapter(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * @return the itemDelegator + */ + public AdapterFactoryItemDelegator getItemDelegator() { + if (itemDelegator == null) { + itemDelegator = new AdapterFactoryItemDelegator( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory()); + } + return itemDelegator; + } + + @Override + protected ItemPropertyDescriptor createItemPropertyDescriptor(AdapterFactory adapterFactory, + ResourceLocator resourceLocator, String displayName, String description, EStructuralFeature feature, + boolean isSettable, boolean multiLine, boolean sortChoices, Object staticImage, String category, + String[] filterFlags, Object propertyEditorFactory) { + return new ItemPropertyDescriptor(adapterFactory, resourceLocator, displayName, description, feature, + isSettable, multiLine, sortChoices, staticImage, category, filterFlags, propertyEditorFactory) { + @Override + protected Object createPropertyValueWrapper(Object object, Object propertyValue) { + if (propertyValue instanceof EObject) { + return new PropertyValueWrapper(adapterFactory, object, propertyValue, propertyValue); + } + return super.createPropertyValueWrapper(object, propertyValue); + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.emf.edit.provider.ItemPropertyDescriptor#getChoiceOfValues(java.lang.Object) + */ + @Override + public Collection getChoiceOfValues(Object object) { + // TODO Auto-generated method stub + return super.getChoiceOfValues(object); + } + + }; + } + + protected Object getDirectionOverlay(Object object) { + return null; + } + + @Override + protected Object overlayImage(Object object, Object image) { + Object overlay = getDirectionOverlay(object); + if (overlay != null) { + List images = new ArrayList<>(); + images.add(image); + images.add(overlay); + return super.overlayImage(object, new DecoratedImage(images)); + } + return super.overlayImage(object, image); + } + + private static final class DecoratedImage extends ComposedImage { + private DecoratedImage(Collection images) { + super(images); + } + + @Override + public List getDrawPoints(Size size) { + Point point = new Point(); + point.x = size.width - 7; + point.y = size.height - 8; + return Arrays.asList(new Point[] { new Point(), point }); + } + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalyzerItemProviderAdapterFactory.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalyzerItemProviderAdapterFactory.java new file mode 100644 index 000000000..788da409c --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/AnalyzerItemProviderAdapterFactory.java @@ -0,0 +1,415 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.util.AnalyzerAdapterFactory; +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemColorProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; + +/** + * This is the factory that is used to provide the interfaces needed to support Viewers. + * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. + * The adapters also support Eclipse property sheets. + * Note that most of the adapters are shared among multiple instances. + * + * + * @generated + */ +public class AnalyzerItemProviderAdapterFactory extends AnalyzerAdapterFactory + implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * + * + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * + * + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * + * + * @generated + */ + protected Collection supportedTypes = new ArrayList<>(); + + /** + * This constructs an instance. + * + * + * @generated + */ + public AnalyzerItemProviderAdapterFactory() { + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); + supportedTypes.add(IItemColorProvider.class); + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis} instances. + * + * + * @generated + */ + protected AnalysisItemProvider analysisItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis}. + * + * + * @generated + */ + @Override + public Adapter createAnalysisAdapter() { + if (analysisItemProvider == null) { + analysisItemProvider = new AnalysisItemProvider(this); + } + + return analysisItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis} instances. + * + * + * @generated + */ + protected ContributionAnalysisItemProvider contributionAnalysisItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis}. + * + * + * @generated + */ + @Override + public Adapter createContributionAnalysisAdapter() { + if (contributionAnalysisItemProvider == null) { + contributionAnalysisItemProvider = new ContributionAnalysisItemProvider(this); + } + + return contributionAnalysisItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis} instances. + * + * + * @generated + */ + protected InstallableUnitAnalysisItemProvider installableUnitAnalysisItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis}. + * + * + * @generated + */ + @Override + public Adapter createInstallableUnitAnalysisAdapter() { + if (installableUnitAnalysisItemProvider == null) { + installableUnitAnalysisItemProvider = new InstallableUnitAnalysisItemProvider(this); + } + + return installableUnitAnalysisItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis} instances. + * + * + * @generated + */ + protected RequirementAnalysisItemProvider requirementAnalysisItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis}. + * + * + * @generated + */ + @Override + public Adapter createRequirementAnalysisAdapter() { + if (requirementAnalysisItemProvider == null) { + requirementAnalysisItemProvider = new RequirementAnalysisItemProvider(this); + } + + return requirementAnalysisItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution} instances. + * + * + * @generated + */ + protected RequirementResolutionItemProvider requirementResolutionItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution}. + * + * + * @generated + */ + @Override + public Adapter createRequirementResolutionAdapter() { + if (requirementResolutionItemProvider == null) { + requirementResolutionItemProvider = new RequirementResolutionItemProvider(this); + } + + return requirementResolutionItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis} instances. + * + * + * @generated + */ + protected CapabilityAnalysisItemProvider capabilityAnalysisItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis}. + * + * + * @generated + */ + @Override + public Adapter createCapabilityAnalysisAdapter() { + if (capabilityAnalysisItemProvider == null) { + capabilityAnalysisItemProvider = new CapabilityAnalysisItemProvider(this); + } + + return capabilityAnalysisItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution} instances. + * + * + * @generated + */ + protected CapabilityResolutionItemProvider capabilityResolutionItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution}. + * + * + * @generated + */ + @Override + public Adapter createCapabilityResolutionAdapter() { + if (capabilityResolutionItemProvider == null) { + capabilityResolutionItemProvider = new CapabilityResolutionItemProvider(this); + } + + return capabilityResolutionItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project} instances. + * + * + * @generated + */ + protected ProjectItemProvider projectItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project}. + * + * + * @generated + */ + @Override + public Adapter createProjectAdapter() { + if (projectItemProvider == null) { + projectItemProvider = new ProjectItemProvider(this); + } + + return projectItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository} instances. + * + * + * @generated + */ + protected GitRepositoryItemProvider gitRepositoryItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository}. + * + * + * @generated + */ + @Override + public Adapter createGitRepositoryAdapter() { + if (gitRepositoryItemProvider == null) { + gitRepositoryItemProvider = new GitRepositoryItemProvider(this); + } + + return gitRepositoryItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * @generated + */ + @Override + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * @generated + */ + @Override + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * + * + * @generated + */ + @Override + public boolean isFactoryForType(Object type) { + return supportedTypes.contains(type) || super.isFactoryForType(type); + } + + /** + * This implementation substitutes the factory itself as the key for the adapter. + * + * + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * + * + * @generated + */ + @Override + public Object adapt(Object object, Object type) { + if (isFactoryForType(type)) { + Object adapter = super.adapt(object, type); + if (!(type instanceof Class) || (((Class) type).isInstance(adapter))) { + return adapter; + } + } + + return null; + } + + /** + * This adds a listener. + * + * + * @generated + */ + @Override + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * @generated + */ + @Override + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * @generated + */ + @Override + public void fireNotifyChanged(Notification notification) { + changeNotifier.fireNotifyChanged(notification); + + if (parentAdapterFactory != null) { + parentAdapterFactory.fireNotifyChanged(notification); + } + } + + /** + * This disposes all of the item providers created by this factory. + * + * + * @generated + */ + @Override + public void dispose() { + if (analysisItemProvider != null) + analysisItemProvider.dispose(); + if (contributionAnalysisItemProvider != null) + contributionAnalysisItemProvider.dispose(); + if (installableUnitAnalysisItemProvider != null) + installableUnitAnalysisItemProvider.dispose(); + if (requirementAnalysisItemProvider != null) + requirementAnalysisItemProvider.dispose(); + if (requirementResolutionItemProvider != null) + requirementResolutionItemProvider.dispose(); + if (capabilityAnalysisItemProvider != null) + capabilityAnalysisItemProvider.dispose(); + if (capabilityResolutionItemProvider != null) + capabilityResolutionItemProvider.dispose(); + if (projectItemProvider != null) + projectItemProvider.dispose(); + if (gitRepositoryItemProvider != null) + gitRepositoryItemProvider.dispose(); + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/CapabilityAnalysisItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/CapabilityAnalysisItemProvider.java new file mode 100644 index 000000000..d6ca9e75e --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/CapabilityAnalysisItemProvider.java @@ -0,0 +1,221 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.util.CapabilityNamespace; +import org.eclipse.cbi.p2repo.aggregator.util.CapabilityNamespaceImageProvider; +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.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemColorProvider; +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.ViewerNotification; +import org.eclipse.equinox.p2.metadata.IProvidedCapability; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis} object. + * + * + * @generated + */ +public class CapabilityAnalysisItemProvider extends AnalyzerItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, + IItemLabelProvider, IItemPropertySource, IItemColorProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public CapabilityAnalysisItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addCapabilityPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Capability feature. + * + * + * @generated + */ + protected void addCapabilityPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_CapabilityAnalysis_capability_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_CapabilityAnalysis_capability_feature", + "_UI_CapabilityAnalysis_type"), + AnalyzerPackage.Literals.CAPABILITY_ANALYSIS__CAPABILITY, true, false, true, null, null, null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(AnalyzerPackage.Literals.CAPABILITY_ANALYSIS__RESOLUTIONS); + } + return childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + protected Object getDirectionOverlay(Object object) { + return getResourceLocator().getImage("full/ovr16/OverlayMappedBottom"); + } + + /** + * This returns CapabilityAnalysis.gif. + * + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + CapabilityAnalysis capabilityAnalysis = (CapabilityAnalysis) object; + IProvidedCapability capability = capabilityAnalysis.getCapability(); + Object image = capability == null ? null : CapabilityNamespaceImageProvider.getImage(capability.getNamespace()); + if (image == null) { + image = getResourceLocator().getImage("full/obj16/CapabilityAnalysis"); + } + + return overlayImage(object, image); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + CapabilityAnalysis capabilityAnalysis = (CapabilityAnalysis) object; + IProvidedCapability capability = capabilityAnalysis.getCapability(); + if (capability != null) { + StringBuilder result = new StringBuilder(); + CapabilityNamespace capabilityNamespace = CapabilityNamespace.byId(capability.getNamespace()); + if (capabilityNamespace == CapabilityNamespace.UNKNOWN) { + + result.append(capability.getNamespace() + ":" + " " + capability.getName()); + } else { + result.append(capabilityNamespace.getLabel() + " " + capability.getName()); + } + result.append(" / "); + result.append(capability.getVersion().toString()); + return result.toString(); + } + return getString("_UI_CapabilityAnalysis_type"); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(CapabilityAnalysis.class)) { + case AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + default: + super.notifyChanged(notification); + return; + } + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(AnalyzerPackage.Literals.CAPABILITY_ANALYSIS__RESOLUTIONS, + AnalyzerFactory.eINSTANCE.createCapabilityResolution())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return AggregationAnalyzerEditPlugin.INSTANCE; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/CapabilityResolutionItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/CapabilityResolutionItemProvider.java new file mode 100644 index 000000000..9d8a53cbe --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/CapabilityResolutionItemProvider.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.cbi.p2repo.p2.util.P2Utils; +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.IItemColorProvider; +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.equinox.internal.p2.metadata.IRequiredCapability; +import org.eclipse.equinox.internal.p2.metadata.RequiredPropertiesMatch; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.IRequirement; +import org.eclipse.equinox.p2.metadata.expression.IFilterExpression; +import org.eclipse.equinox.p2.metadata.expression.IMatchExpression; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution} object. + * + * + * @generated + */ +public class CapabilityResolutionItemProvider extends AnalyzerItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, + IItemLabelProvider, IItemPropertySource, IItemColorProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public CapabilityResolutionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addRequirementPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Requirement feature. + * + * + * @generated + */ + protected void addRequirementPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_CapabilityResolution_requirement_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_CapabilityResolution_requirement_feature", + "_UI_CapabilityResolution_type"), + AnalyzerPackage.Literals.CAPABILITY_RESOLUTION__REQUIREMENT, true, false, true, null, null, null)); + } + + @Override + protected Object getDirectionOverlay(Object object) { + return getResourceLocator().getImage("full/ovr16/OverlayMappedTop"); + } + + /** + * This returns CapabilityResolution.gif. + * + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + CapabilityResolution capabilityResolution = (CapabilityResolution) object; + RequirementAnalysis requirementAnalysis = capabilityResolution.getRequirement(); + if (requirementAnalysis != null) { + IRequirement requirement = requirementAnalysis.getRequirement(); + if (requirement instanceof IRequiredCapability) { + IRequiredCapability requiredCapability = (IRequiredCapability) requirement; + P2Utils.versionRangeToString(requiredCapability.getRange()); + } + } + + return overlayImage(object, getResourceLocator().getImage("full/obj16/CapabilityResolution")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + CapabilityResolution capabilityResolution = (CapabilityResolution) object; + RequirementAnalysis requirementAnalysis = capabilityResolution.getRequirement(); + if (requirementAnalysis != null) { + InstallableUnitAnalysis installableUnitAnalysis = requirementAnalysis.getInstallableUnit(); + if (installableUnitAnalysis != null) { + ContributionAnalysis contribution = installableUnitAnalysis.getContribution(); + if (contribution != null) { + String suffix = getItemDelegator().getText(installableUnitAnalysis) + " - " + + contribution.getLabel(); + IRequirement requirement = requirementAnalysis.getRequirement(); + if (requirement instanceof IRequiredCapability) { + IRequiredCapability requiredCapability = (IRequiredCapability) requirement; + return P2Utils.versionRangeToString(requiredCapability.getRange()) + " - " + suffix; + } else { + IMatchExpression matches = requirement.getMatches(); + if (RequiredPropertiesMatch.isPropertiesMatchRequirement(matches)) { + IFilterExpression propertiesMatch = RequiredPropertiesMatch.extractPropertiesMatch(matches); + return propertiesMatch + " - " + suffix; + } else { + return matches + " - " + suffix; + } + } + } + } + } + + return getString("_UI_CapabilityResolution_type"); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return AggregationAnalyzerEditPlugin.INSTANCE; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/ContributionAnalysisItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/ContributionAnalysisItemProvider.java new file mode 100644 index 000000000..5e509fb12 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/ContributionAnalysisItemProvider.java @@ -0,0 +1,310 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.cbi.p2repo.aggregator.Contribution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +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.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemColorProvider; +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.ViewerNotification; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis} object. + * + * + * @generated + */ +public class ContributionAnalysisItemProvider extends AnalyzerItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, + IItemLabelProvider, IItemPropertySource, IItemColorProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ContributionAnalysisItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addLabelPropertyDescriptor(object); + addDominantPropertyDescriptor(object); + addMatchPropertyDescriptor(object); + addLastModifiedPropertyDescriptor(object); + addContributionPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Label feature. + * + * + * @generated + */ + protected void addLabelPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_ContributionAnalysis_label_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ContributionAnalysis_label_feature", + "_UI_ContributionAnalysis_type"), + AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__LABEL, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Dominant feature. + * + * + * @generated + */ + protected void addDominantPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_ContributionAnalysis_dominant_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ContributionAnalysis_dominant_feature", + "_UI_ContributionAnalysis_type"), + AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__DOMINANT, true, false, false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Match feature. + * + * + * @generated + */ + protected void addMatchPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_ContributionAnalysis_match_feature"), + getString("_UI_ContributionAnalysis_match_description"), + AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__MATCH, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Last Modified feature. + * + * + * @generated + */ + protected void addLastModifiedPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_ContributionAnalysis_lastModified_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ContributionAnalysis_lastModified_feature", + "_UI_ContributionAnalysis_type"), + AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__LAST_MODIFIED, true, false, false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Contribution feature. + * + * + * @generated + */ + protected void addContributionPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_ContributionAnalysis_contribution_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ContributionAnalysis_contribution_feature", + "_UI_ContributionAnalysis_type"), + AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__CONTRIBUTION, false, false, true, null, null, null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS); + childrenFeatures.add(AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__PROJECTS); + } + return childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + private boolean isDisabled(Object object) { + ContributionAnalysis contributionAnalysis = (ContributionAnalysis) object; + Contribution contribution = contributionAnalysis.getContribution(); + return contribution != null && !((EObject) contribution).eIsProxy() && !contribution.isEnabled(); + } + + /** + * This returns ContributionAnalysis.gif. + * + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, + getResourceLocator() + .getImage(((ContributionAnalysis) object).getContribution() == null ? "full/obj16/PatternGroup" + : "full/obj16/ContributionAnalysis")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.emf.edit.provider.ItemProviderAdapter#getForeground(java.lang.Object) + */ + @Override + public Object getForeground(Object object) { + if (isDisabled(object) || ((ContributionAnalysis) object).getContribution() == null) { + return GRAYED_OUT_COLOR; + } + + return super.getForeground(object); + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + ContributionAnalysis contributionAnalysis = (ContributionAnalysis) object; + String label = contributionAnalysis.getLabel(); + if (label != null && !label.isEmpty()) { + return label; + } + + Contribution contribution = contributionAnalysis.getContribution(); + if (contribution != null) { + String location = EcoreUtil.getURI((EObject) contribution).trimFragment().toString(); + return location; + } + + return getString("_UI_ContributionAnalysis_type"); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(ContributionAnalysis.class)) { + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LABEL: + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__DOMINANT: + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__MATCH: + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LAST_MODIFIED: + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__CONTRIBUTION: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS: + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__PROJECTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + default: + super.notifyChanged(notification); + return; + } + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS, + AnalyzerFactory.eINSTANCE.createInstallableUnitAnalysis())); + + newChildDescriptors.add(createChildParameter(AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__PROJECTS, + AnalyzerFactory.eINSTANCE.createProject())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return AggregationAnalyzerEditPlugin.INSTANCE; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/GitRepositoryItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/GitRepositoryItemProvider.java new file mode 100644 index 000000000..fb0ff4c41 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/GitRepositoryItemProvider.java @@ -0,0 +1,187 @@ +/** + * Copyright (c) 2022 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +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.common.util.URI; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemColorProvider; +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.ViewerNotification; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository} object. + * + * + * @generated + */ +public class GitRepositoryItemProvider extends AnalyzerItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, + IItemLabelProvider, IItemPropertySource, IItemColorProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public GitRepositoryItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addURIPropertyDescriptor(object); + addLastModifiedPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the URI feature. + * + * + * @generated + */ + protected void addURIPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_GitRepository_uRI_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_GitRepository_uRI_feature", + "_UI_GitRepository_type"), + AnalyzerPackage.Literals.GIT_REPOSITORY__URI, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Last Modified feature. + * + * + * @generated + */ + protected void addLastModifiedPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_GitRepository_lastModified_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_GitRepository_lastModified_feature", + "_UI_GitRepository_type"), + AnalyzerPackage.Literals.GIT_REPOSITORY__LAST_MODIFIED, true, false, false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, null, null)); + } + + /** + * This returns GitRepository.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/GitRepository")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + GitRepository gitRepository = (GitRepository) object; + URI uri = gitRepository.getURI(); + if (uri != null) { + String lastSegment = uri.lastSegment(); + if (lastSegment != null) { + return lastSegment + " - " + uri.trimSegments(1); + } + return uri.toString(); + } + return getString("_UI_GitRepository_type"); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(GitRepository.class)) { + case AnalyzerPackage.GIT_REPOSITORY__URI: + case AnalyzerPackage.GIT_REPOSITORY__LAST_MODIFIED: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + default: + super.notifyChanged(notification); + return; + } + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return AggregationAnalyzerEditPlugin.INSTANCE; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/InstallableUnitAnalysisItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/InstallableUnitAnalysisItemProvider.java new file mode 100644 index 000000000..7608f9684 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/InstallableUnitAnalysisItemProvider.java @@ -0,0 +1,224 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +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.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemColorProvider; +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.ViewerNotification; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.Version; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis} object. + * + * + * @generated + */ +public class InstallableUnitAnalysisItemProvider extends AnalyzerItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, + IItemLabelProvider, IItemPropertySource, IItemColorProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public InstallableUnitAnalysisItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addContributionPropertyDescriptor(object); + addInstallableUnitPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Contribution feature. + * + * + * @generated + */ + protected void addContributionPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_InstallableUnitAnalysis_contribution_feature"), + getString("_UI_PropertyDescriptor_description", + "_UI_InstallableUnitAnalysis_contribution_feature", "_UI_InstallableUnitAnalysis_type"), + AnalyzerPackage.Literals.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION, false, false, false, null, + null, null)); + } + + /** + * This adds a property descriptor for the Installable Unit feature. + * + * + * @generated + */ + protected void addInstallableUnitPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_InstallableUnitAnalysis_installableUnit_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_InstallableUnitAnalysis_installableUnit_feature", + "_UI_InstallableUnitAnalysis_type"), + AnalyzerPackage.Literals.INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT, true, false, true, null, null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(AnalyzerPackage.Literals.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS); + childrenFeatures.add(AnalyzerPackage.Literals.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES); + } + return childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns InstallableUnitAnalysis.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/InstallableUnitAnalysis")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + InstallableUnitAnalysis installableUnitAnalysis = (InstallableUnitAnalysis) object; + IInstallableUnit installableUnit = installableUnitAnalysis.getInstallableUnit(); + if (installableUnit != null) { + String id = installableUnit.getId(); + Version version = installableUnit.getVersion(); + return "" + id + " /" + version; + } + return getString("_UI_InstallableUnitAnalysis_type"); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(InstallableUnitAnalysis.class)) { + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS: + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + default: + super.notifyChanged(notification); + return; + } + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(AnalyzerPackage.Literals.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS, + AnalyzerFactory.eINSTANCE.createRequirementAnalysis())); + + newChildDescriptors.add(createChildParameter(AnalyzerPackage.Literals.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES, + AnalyzerFactory.eINSTANCE.createCapabilityAnalysis())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return AggregationAnalyzerEditPlugin.INSTANCE; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/ProjectItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/ProjectItemProvider.java new file mode 100644 index 000000000..dac73e259 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/ProjectItemProvider.java @@ -0,0 +1,289 @@ +/** + * Copyright (c) 2022 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.Collection; +import java.util.Date; +import java.util.List; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +import org.eclipse.cbi.p2repo.aggregator.analyzer.util.AnalyzerUtil; +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.common.util.URI; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemColorProvider; +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.ViewerNotification; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project} object. + * + * + * @generated + */ +public class ProjectItemProvider extends AnalyzerItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, + IItemLabelProvider, IItemPropertySource, IItemColorProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public ProjectItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addNamePropertyDescriptor(object); + addSitePropertyDescriptor(object); + addVersionPropertyDescriptor(object); + addReleaseDatePropertyDescriptor(object); + addContributionPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_Project_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Project_name_feature", "_UI_Project_type"), + AnalyzerPackage.Literals.PROJECT__NAME, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Site feature. + * + * + * @generated + */ + protected void addSitePropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_Project_site_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Project_site_feature", "_UI_Project_type"), + AnalyzerPackage.Literals.PROJECT__SITE, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Version feature. + * + * + * @generated + */ + protected void addVersionPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_Project_version_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Project_version_feature", + "_UI_Project_type"), + AnalyzerPackage.Literals.PROJECT__VERSION, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Release Date feature. + * + * + * @generated + */ + protected void addReleaseDatePropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_Project_releaseDate_feature"), getString("_UI_Project_releaseDate_description"), + AnalyzerPackage.Literals.PROJECT__RELEASE_DATE, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null, + URI.createURI("editor://org.eclipse.nebula.widgets.cdatetime/yyyy-MM-dd"))); + } + + /** + * This adds a property descriptor for the Contribution feature. + * + * + * @generated + */ + protected void addContributionPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_Project_contribution_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Project_contribution_feature", + "_UI_Project_type"), + AnalyzerPackage.Literals.PROJECT__CONTRIBUTION, true, false, true, null, null, null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(AnalyzerPackage.Literals.PROJECT__REPOSITORIES); + childrenFeatures.add(AnalyzerPackage.Literals.PROJECT__SUBPROJECTS); + } + return childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns Project.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Project")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + Project project = (Project) object; + String name = project.getName(); + if (name != null && !name.isBlank()) { + String qualifier = ""; + URI version = project.getVersion(); + if (version != null) { + String lastSegment = version.lastSegment(); + if (lastSegment != null) { + qualifier = " - " + URI.decode(lastSegment); + } + } + Date releaseDate = project.getReleaseDate(); + if (releaseDate != null) { + qualifier += " ~ " + AnalyzerUtil.format(releaseDate); + } + return name + qualifier; + } + return getString("_UI_Project_type"); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(Project.class)) { + case AnalyzerPackage.PROJECT__NAME: + case AnalyzerPackage.PROJECT__SITE: + case AnalyzerPackage.PROJECT__VERSION: + case AnalyzerPackage.PROJECT__RELEASE_DATE: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case AnalyzerPackage.PROJECT__REPOSITORIES: + case AnalyzerPackage.PROJECT__SUBPROJECTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + default: + super.notifyChanged(notification); + return; + } + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(AnalyzerPackage.Literals.PROJECT__REPOSITORIES, + AnalyzerFactory.eINSTANCE.createGitRepository())); + + newChildDescriptors.add(createChildParameter(AnalyzerPackage.Literals.PROJECT__SUBPROJECTS, + AnalyzerFactory.eINSTANCE.createProject())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return AggregationAnalyzerEditPlugin.INSTANCE; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/RequirementAnalysisItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/RequirementAnalysisItemProvider.java new file mode 100644 index 000000000..4073fe733 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/RequirementAnalysisItemProvider.java @@ -0,0 +1,226 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +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.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemColorProvider; +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.ViewerNotification; +import org.eclipse.equinox.p2.metadata.IRequirement; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis} object. + * + * + * @generated + */ +public class RequirementAnalysisItemProvider extends AnalyzerItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, + IItemLabelProvider, IItemPropertySource, IItemColorProvider { + + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public RequirementAnalysisItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addInstallableUnitPropertyDescriptor(object); + addRequirementPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Requirement feature. + * + * + * @generated + */ + protected void addRequirementPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_RequirementAnalysis_requirement_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_RequirementAnalysis_requirement_feature", + "_UI_RequirementAnalysis_type"), + AnalyzerPackage.Literals.REQUIREMENT_ANALYSIS__REQUIREMENT, true, false, true, null, null, null)); + } + + /** + * This adds a property descriptor for the Installable Unit feature. + * + * + * @generated + */ + protected void addInstallableUnitPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_RequirementAnalysis_installableUnit_feature"), + getString("_UI_PropertyDescriptor_description", + "_UI_RequirementAnalysis_installableUnit_feature", "_UI_RequirementAnalysis_type"), + AnalyzerPackage.Literals.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT, false, false, false, null, + null, null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(AnalyzerPackage.Literals.REQUIREMENT_ANALYSIS__RESOLUTIONS); + } + return childrenFeatures; + } + + /** + * + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + @Override + protected Object getDirectionOverlay(Object object) { + return getResourceLocator().getImage("full/ovr16/OverlayMappedTop"); + } + + /** + * This returns RequirementAnalysis.gif. + * + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + RequirementAnalysis requirementAnalysis = (RequirementAnalysis) object; + IRequirement requirement = requirementAnalysis.getRequirement(); + if (requirement != null) { + return overlayImage(object, getItemDelegator().getImage(requirement)); + } + return overlayImage(object, getResourceLocator().getImage("full/obj16/RequirementAnalysis")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + RequirementAnalysis requirementAnalysis = (RequirementAnalysis) object; + IRequirement requirement = requirementAnalysis.getRequirement(); + if (requirement != null) { + return getItemDelegator().getText(requirement); + } + return getString("_UI_RequirementAnalysis_type"); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(RequirementAnalysis.class)) { + case AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + default: + super.notifyChanged(notification); + return; + } + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(AnalyzerPackage.Literals.REQUIREMENT_ANALYSIS__RESOLUTIONS, + AnalyzerFactory.eINSTANCE.createRequirementResolution())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return AggregationAnalyzerEditPlugin.INSTANCE; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/RequirementResolutionItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/RequirementResolutionItemProvider.java new file mode 100644 index 000000000..d8d67022b --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.edit/src/org/eclipse/cbi/p2repo/aggregator/analyzer/provider/RequirementResolutionItemProvider.java @@ -0,0 +1,203 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution; +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.IItemColorProvider; +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; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution} object. + * + * + * @generated + */ +public class RequirementResolutionItemProvider extends AnalyzerItemProviderAdapter + implements IEditingDomainItemProvider, IStructuredItemContentProvider, ITreeItemContentProvider, + IItemLabelProvider, IItemPropertySource, IItemColorProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public RequirementResolutionItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addRequirementPropertyDescriptor(object); + addInstallableUnitPropertyDescriptor(object); + addCapabilityPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Requirement feature. + * + * + * @generated + */ + protected void addRequirementPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_RequirementResolution_requirement_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_RequirementResolution_requirement_feature", + "_UI_RequirementResolution_type"), + AnalyzerPackage.Literals.REQUIREMENT_RESOLUTION__REQUIREMENT, false, false, false, null, null, null)); + } + + /** + * This adds a property descriptor for the Installable Unit feature. + * + * + * @generated + */ + protected void addInstallableUnitPropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_RequirementResolution_installableUnit_feature"), + getString("_UI_PropertyDescriptor_description", + "_UI_RequirementResolution_installableUnit_feature", "_UI_RequirementResolution_type"), + AnalyzerPackage.Literals.REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT, true, false, true, null, + null, null)); + } + + /** + * This adds a property descriptor for the Capability feature. + * + * + * @generated + */ + protected void addCapabilityPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_RequirementResolution_capability_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_RequirementResolution_capability_feature", + "_UI_RequirementResolution_type"), + AnalyzerPackage.Literals.REQUIREMENT_RESOLUTION__CAPABILITY, true, false, true, null, null, null)); + } + + @Override + protected Object getDirectionOverlay(Object object) { + return getResourceLocator().getImage("full/ovr16/OverlayMappedBottom"); + } + + /** + * This returns RequirementResolution.gif. + * + * + * @generated NOT + */ + @Override + public Object getImage(Object object) { + RequirementResolution requirementResolution = (RequirementResolution) object; + InstallableUnitAnalysis installableUnit = requirementResolution.getInstallableUnit(); + if (installableUnit != null) { + return overlayImage(object, getItemDelegator().getImage(installableUnit)); + } + return overlayImage(object, getResourceLocator().getImage("full/obj16/RequirementResolution")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + RequirementResolution requirementResolution = (RequirementResolution) object; + InstallableUnitAnalysis installableUnit = requirementResolution.getInstallableUnit(); + if (installableUnit != null) { + String result = getItemDelegator().getText(installableUnit); + ContributionAnalysis contribution = installableUnit.getContribution(); + if (contribution != null) { + return result + " - " + contribution.getLabel(); + } + return result; + } + return getString("_UI_RequirementResolution_type"); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return AggregationAnalyzerEditPlugin.INSTANCE; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.project b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.project new file mode 100644 index 000000000..f3f874ade --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.project @@ -0,0 +1,28 @@ + + + org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + + + 1637246765304 + + 10 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-target + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.settings/org.eclipse.core.resources.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 000000000..b3c7fded6 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1 @@ +eclipse.preferences.version=1 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/build.properties b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/build.properties new file mode 100644 index 000000000..c1681e254 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/build.properties @@ -0,0 +1,4 @@ +bin.includes = feature.xml,\ + feature.properties +generateSourceReferences = true +src.includes = pom.xml diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/feature.properties b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/feature.properties new file mode 100644 index 000000000..f53debf67 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/feature.properties @@ -0,0 +1,17 @@ +# Copyright (c) 2021 Eclipse Foundation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 + +featureName=CBI Aggregator Analysis Editor + +# "description" property - description of the feature +description=This is the CBI Aggregator Analysis Editor for analyzing the dependencies between contributions in an aggregation. + +providerName=Eclipse CBI + +copyright=Copyright (c) 2021 Eclipse Foundation and others. diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/feature.xml b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/feature.xml new file mode 100644 index 000000000..2498970c5 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/feature.xml @@ -0,0 +1,48 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/pom.xml b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/pom.xml new file mode 100644 index 000000000..12233e4f7 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature/pom.xml @@ -0,0 +1,32 @@ + + 4.0.0 + org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature + 1.1.0-SNAPSHOT + eclipse-feature + + org.eclipse.cbi + org.eclipse.cbi.p2repo.releng.parent + ../org.eclipse.cbi.p2repo.releng.parent + 1.1.0-SNAPSHOT + + + + + + org.eclipse.tycho + tycho-source-plugin + ${tycho-version} + + + package + feature-source + + feature-source + + + + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.classpath b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.classpath new file mode 100644 index 000000000..39e5c779e --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.project b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.project new file mode 100644 index 000000000..8c55b8e88 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.project @@ -0,0 +1,28 @@ + + + org.eclipse.cbi.p2repo.aggregator.analyzer.editor + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.core.resources.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 000000000..b3c7fded6 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1 @@ +eclipse.preferences.version=1 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..1fbb982d8 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,418 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assertion_message=0 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_annotations=0 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=132 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..8d15ba4a9 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,129 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=true +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_aggrCleanup +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_aggrFormatEMF +formatter_settings_version=21 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=true +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=false +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=true +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 000000000..39b36fe8e --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Tue Jun 23 16:34:13 CEST 2009 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.pde.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..d857b126b --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/.settings/org.eclipse.pde.prefs @@ -0,0 +1,33 @@ +#Wed Apr 27 17:32:32 CEST 2011 +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=2 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=2 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/COPYRIGHT b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/COPYRIGHT new file mode 100644 index 000000000..f934ce0f5 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/COPYRIGHT @@ -0,0 +1,8 @@ +Copyright (c) 2021 Eclipse Foundation and others. + +This program and the accompanying materials +are made available under the terms of the Eclipse Public License 2.0 +which accompanies this distribution, and is available at +https://www.eclipse.org/legal/epl-2.0/ + +SPDX-License-Identifier: EPL-2.0 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/META-INF/MANIFEST.MF new file mode 100644 index 000000000..c3008f014 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/META-INF/MANIFEST.MF @@ -0,0 +1,28 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator.analyzer.editor;singleton:=true +Automatic-Module-Name: org.eclipse.cbi.p2repo.aggregator.analyzer.editor +Bundle-Version: 1.1.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.AggregationAnalyzerEditorPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Export-Package: org.eclipse.cbi.p2repo.aggregator.analyzer.presentation +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources;visibility:=reexport, + org.eclipse.cbi.p2repo.aggregator.analyzer.edit;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.eclipse.emf.edit.ui;visibility:=reexport, + org.eclipse.jface.text, + org.eclipse.ui.ide;visibility:=reexport, + org.eclipse.cbi.p2repo.aggregator.edit;visibility:=reexport, + org.eclipse.cbi.p2repo.p2.edit;visibility:=reexport, + org.eclipse.ui, + org.eclipse.cbi.p2repo.aggregator.engine, + org.eclipse.core.expressions, + org.eclipse.zest.core, + org.eclipse.zest.layouts, + org.eclipse.jdt.ui +Bundle-ActivationPolicy: lazy +Bundle-RequiredExecutionEnvironment: JavaSE-11 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.html b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.html new file mode 100644 index 000000000..16e7373a1 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

November 22, 2017

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v20.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.ini b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.ini new file mode 100644 index 000000000..f17fcd885 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.ini @@ -0,0 +1,17 @@ +# about.ini +# contains information about a feature +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# "%key" are externalized strings defined in about.properties +# This file does not need to be translated. + +# Property "aboutText" contains blurb for "About" dialog (translated) + aboutText=%featureText + +# Property "featureImage" contains path to feature image (32x32) +featureImage=cbi32.png + +# Property "appName" contains name of the application (translated) + appName=%featureName + +# Property "welcomePage" contains path to welcome page (special XML-based format) +# welcomePage=$nl$/welcome.xml diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.mappings b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.mappings new file mode 100644 index 000000000..6362b4482 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.mappings @@ -0,0 +1,5 @@ +# about.mappings +# contains fill-ins for about.properties + +0=${build.id} +1=${git.commit} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.properties b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.properties new file mode 100644 index 000000000..c3b204d98 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/about.properties @@ -0,0 +1,21 @@ +# Copyright (c) 2022 Eclipse Foundation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 + +featureName=CBI Aggregator Analysis Editor + +featureText=Eclipse CBI Aggregator Analysis Editor\n\ +Version: {featureVersion}\n\ +Build: {0}\n\ +Commit: {1}\n\ +\n\ +(c) Copyright Eclipse Foundation and others. 2021, 2022. All rights reserved.\n\ +\n\ +This is the CBI Aggregator Analysis Editor for analyzing the dependencies between contributions in an aggregation.\n\ +\n\ +Visit https://github.com/eclipse-cbi/p2repo-aggregator diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/build.properties b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/build.properties new file mode 100644 index 000000000..6ee299195 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/build.properties @@ -0,0 +1,24 @@ +# Copyright (c) 2021 Eclipse Foundation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + about.html,\ + about.ini,\ + about.mappings,\ + about.properties,\ + cbi32.png +jars.compile.order = . +source.. = src/ +output.. = bin +src.includes = COPYRIGHT,\ + about.html diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/cbi32.png b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/cbi32.png new file mode 100644 index 0000000000000000000000000000000000000000..544a796baae732178168f2fc9ddd704f96745aed GIT binary patch literal 1415 zcmV;21$g?2P)nKQSx(~)A4^kTdhH3kxW@DdY!^1%pRxFjZc2^v7HHv|<& zMa8Iuv=oE~@j-|o!5705CTc>WiIG5}m}t;iN}*Gj&Nwrjb7s!j+lOIbstm0GdC~uA z@3rt&*4y_SqbLX2%>lcAtwiUQhmi?N8p$o+gG^l{?yCURBWjmr50k4Hu z483vo@V90{C0cE_AAw~JD)U|xiZiS2U>??t)jWTzfYyk+$=!*_d_>*~FaNy(Im~Vw z+!6^*+^4j`@pNfUq0EnG8+S?b(Bjsn%r=068{IjQW=TT<&OpaY2=fuXu*ZI1+lU;% zG<-K`l~Kw#*DyppFKCqkuqq+9-Zx2ryQ!l`!J9x%`~Ff%q0X6kn(%##d@+6upj5FZ zE&C(^8eRuXkb%fkM~5#2IY1`gw>^_*``LV_1)Q4we8BNNqpxOfjX(Q%#4g-#nqH^U zlCOBy4~`Srm@RHNSf9u@jh6Q06Q2aF@?53N69va!KmJGm9)PB%r*Do0OT7SICG>SV z*T3a&0u(F&M8n?LGrx@jv?W)(n~aY5|PZ7*5=IhHH#e# zZByk}Zp}ICezUZm)!H=v5J0Zje2mJ zhNtUiZx}wU&6(>x-#Tpz1>IS(_}CJrfB~Sl&b5Gf0KS%e0Fh{6iD~*FfNZg4&*9-~ zt{ffizABxa@v&CMq;0RY!N`gB4MQVcbJN+jZ8du^P`+bY0!r@jnYFgE0!IM?fyzw) zz6zA{PIN7-87q)Vr!$)$$>tLMlLbK834b(Ed3(Q`iNEA}p)7!inmxS=h;iwuz8^~- zJ_%rm-wxn<*3n#Uyrm2P5p}%QFSc|iVOd3M3RRy@Lh9UC-6W)pY78hPWALCqrGW70 z@F?H|NI+dy4K{uSur0Se(KNoW77z}nX16x4{IF5N*5>gAw&lzM(ApT8N^Sr^Qh23) z{T(8=nCM%9{Z2W!FB&f1E}}`sGw%k?$`HA>Xx^5$TexTwwu|WV00biL^ zJWJ&!ntnb*9y*yVCSNF(Qq}iF8{#VyUzup6{#KoQM4W++U0U-1n)Tt8L#wOS=c9?3 zde{m%UCNhYsbqgsbU)Y&5DTvA@eH#Kly)5ZKq8i1WSD-F>&HGX6y7;h%iBV##j(pb z0cdRux$e5dXBFV~bzG+m4gwQeyg8BOBS)qx;rU|H@d`aPbVzGn2AYJx4xQp39KQ=7 z03f_#=skhmXl`>Z=~#Es1&E+SC*q5N9l+{Re@E)y6wvUV)*5jJI#R%Dkljv2o=o%( zW-pq68l27DS8Lz@0AUXBnr+S4c_BY0)Bl=n>h9Ed3j}&VzS7G0B^>9#`F_p*$DevC V61)D?HgEs{002ovPDHLkV1hP+oWTG9 literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/obj16/AnalyzerModelFile.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/obj16/AnalyzerModelFile.gif new file mode 100644 index 0000000000000000000000000000000000000000..13ce11b1490b0691db9fc3b2a7a2a2055a5cf965 GIT binary patch literal 310 zcmZ?wbhEHb6krfwxXQp_5i-F#Vya!t47-?VZYlHA>(@?NeB3%}s%zRpx3q<>Df3;^ z=DVfM_sd_oXx)M9kKaz+bzhbqaZ-0IJ^!vxxKfiwb`}^na$!!lV9Q^wB z*~gcUzP)|+_097iAK!j^^Zf76@BjY%{`>papPxVe{rU6%-@pH0z%X=x;!hSv1_n0< z9gvejal*h}*WlLF+|t_C#M{}`-r?HU&)dW0;@~V`=E~L1XJ%?@@8rtgBkX9r+*p*m zoyW=6NXb@&r-#GD#@fzOnxmalSyNF#QiijKOg_vuDO85-rkO?Y5UD{#2dXW=svX)vT zO*e?0C?3==9@Hlh(5)2S?N+y`Xu+A{MQ09NeNo=fvEt0j;}5(zEe*Mk&yB~kwe*g2{$KP*% z{{Qgn|E+i5?|uCB{@4G$ZO2~!{QvdO|5ayhJp1wg?XUk|{`{Y?^Z2@RH@^Sg)7Yg@CY z1dD`cds76PN=Q_sDqBRmcyL(g+)yu_HXpU*rR)I#fimVPQk*=p{DQ)w$*gWWf)rAe z4RrMkH8i(!SRb<&TPw}YCmS_Tsz3b{1%H{0#nBk{qJW1+6CiOfZXMaRY5)!Q=eR2&Lq TU}R)s_#ts%qNj5s1A{dHI`RK= literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/obj16/namespace.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/obj16/namespace.gif new file mode 100644 index 0000000000000000000000000000000000000000..9155abc2ef39dd62e8f25c5093de3b9bf1ade055 GIT binary patch literal 574 zcmZ?wbhEHb6krfwIF`&%;VWL|CsE-iR^cyI79d&aFH`9+R}mmp31kOI*Z9j+1xQze zkW5veY;Ax-b)Z~rpki&1LRGLrZIDuJka7)>5iDO5tXvzcR2`yJ8=}|{tX3DIToIIMte}axE(?p(7gq(Xt`A+_kiWDuV?{^)rvB#DlMB~O zE?hgMXzi5ZtrOa}Ol;XQsde-8#*H&-H_fcwIlp@s2=(lpH)Y@a=?9n2JhW`~vCZ?( z?pt+k-|7noH(Wfp;nKmamk(~eacuwN>lYr~xbWo0h3EIKKfizd-@W|t?emZC zU;fhuDE?$& zY+-M%XC$lT6&94>#oi=r>JzodnAs`VAkmqziB)sWIy+8f6%}QkW+rCGVEv>ffs79g cOf62_E_aj@8!joZ3Te3%cx+5M>cC(P0Cf-*{r~^~ literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/wizban/NewAnalyzer.gif b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/icons/full/wizban/NewAnalyzer.gif new file mode 100644 index 0000000000000000000000000000000000000000..f3829ed22d1b1fce087cb91091f4adac4acd2643 GIT binary patch literal 2462 zcmd6m`8OMg8ivzyXM`x-QPZJfTAHHK&QR5jT4P#9t7t6^##XzkW!$Ks6H6r4G!aW; zt;8;gttyrz!XQdiVu=(HG?p$#XUw>N#eL6n-XFj7eCK?hwXKzjskc4g7T_~rKYM$7 z>l78u_ z$6CQLHoiFy0r_`=3hx9JI6lESJ;6DLzH|vExP;@~qKIx$MUP@iJY&ne_9=zOll&6P z1ClC(ldD5hUxlUCME*{Bno$>rZukw`^c$uzxqyZ&prMM|(~CMVq;Bj!uk$K;aMiuI zY9^t!zqpQ7vd;jykyAq-rnZmJm=pBg$sVqNH9E(eULK!bnh;9(vnw;=b%AJgQMx6T zY+QYqaqUs2`NQ<<9$D8tGH-gJEg%281;*Mp$I1s|_iHXJAkQ%b=M;i-4twbmL2!w{ zyG9XR_vMSd;>tW@OTFSs;Rz()#PVQdbr7;D5=Dv5sEb86Ao5z03u(wgS{j~#B6gsN z?U^N=S*2ZBrJWdZH zj5KtOHNP2eAK-Vf-@V}q21e%w$3;UE;*qJv;Yl%Xdg-lDA{4Jri&p0rKg@{NR%M?G zYnTK|U-7>K>jx@Yxs;9(TJJ;`=Uwj~Gpw;W&iFh}uskyLet2?WVn!lf*%U3yRz7@M zUfUiRn;V*3;0c!A&Pe!kE3=CqgyOYnkyI-CwDRHO^4ivituO1FpBGoR#48)i>)UIa zpSP)=+tZC(^Zk>(_7x zvvV`t{y&CUqodr3DgMI$ZtefBAp1u9zW`9!1IQ_8+SHf4Nme+j|Ipv)#6c&Jjvc{d zRJ%G|RWDF*?qWV7P0cVu(-!LmNz=0MgRmPHY;*N5wi2pkJ^-{HoJwYI`9X>mB34$X zc#G_kTks=A0o(p}oop=(E=*klIFav0qX=yqm6LdvQmZ_aQNdJ`Kd;7NH)r0Z&V?B$ zj8k=i`mr}xgoCtDs(V}5g@j$`IrP7Ebm-TkDcq(hufJbqnp^gEuK{h0RHt_=9)o)1IEdDQ$#(B|bbWXJs40j z$Gu$)6~>+ZxHuCH9HI%~wTu(&#O50|gU{-@XB52(5BTMV7#@E%7agU3sW=>b%>*wu zAqk$kM;FOGq-(Chjr`6 z=i6%hez<}Sz^iIYQ&W75tbl}dLnW-y#n7(fe{j3G>PiCb zG_36FbUB&(xbd7_3AdiZr#cyS{mBsk2V*RONsIcUF@?SzBy3_2n$mQn| zqc`myf3+*UB1rZ;ELgi0$6m8W>kde8!$u%P;YCM#e`#c)&ZWyY9ehLKdv-5Be`#&2 z1Iy07m(!4+q$ye#)+3KyDpfpNsOpic=%}7iEWW}j-4^($4L(ob)$loiQpHn4)EYzttpC7BVxvh8Q3=sXS_i!t{&&q!T$v*W$$@5EHc*+{$ zRAAYiaTAb_E&k+ng@s6vcb1ibJf+ruji-k^G%&L7V=sJ@ugbK@ILd;?48 z5)+dhY-OBb#J1I#$6DXj9y}znHq=8$rMQta%=!72cAL3XFkSt0FE;GH>^@L(d*JUA z0LKP)>M5xB4y>BvLB!^v1tjKUoPGCUPAExJ;b;sS;8}L$*bt%uoGDWPKa}2IGk#&X zOg` zA3)Ff1Q)gc90aBPIR3+ZW&OG5hcn33$gFIe2gE;P%;S!OPhcP1x|gCc=7VZ1JZM^D ztBXT^=j2eU6!gG(*E#zD`LcQ^Al2(zdw!3`r~1_6-`sE^A)Nrqbw0ZOSMh4;2S9)m zdF(;B7O7xpQ5P8J4TDtM8fjgOVONUfd0cQUI%6`e4 literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/plugin.properties b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/plugin.properties new file mode 100644 index 000000000..8b2c5659c --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/plugin.properties @@ -0,0 +1,64 @@ +# Copyright (c) 2021 Eclipse Foundation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 + +pluginName = CBI Aggregator Analysis Editor +providerName = Eclipse CBI + +_UI_AnalyzerEditor_menu = &Analyzer Editor + +_UI_CreateChild_menu_item = &New Child +_UI_CreateSibling_menu_item = N&ew Sibling + +_UI_ShowPropertiesView_menu_item = Show &Properties View +_UI_RefreshViewer_menu_item = &Refresh + +_UI_SelectionPage_label = Analysis Specification +_UI_ParentPage_label = Parent +_UI_ListPage_label = List +_UI_TreePage_label = Tree +_UI_TablePage_label = Table +_UI_TreeWithColumnsPage_label = Tree with Columns +_UI_ObjectColumn_label = Object +_UI_SelfColumn_label = Self + +_UI_NoObjectSelected = Selected Nothing +_UI_SingleObjectSelected = Selected Object: {0} +_UI_MultiObjectSelected = Selected {0} Objects + +_UI_OpenEditorError_label = Open Editor + +_UI_Wizard_category = Example EMF Model Creation Wizards + +_UI_CreateModelError_message = Problems encountered in file "{0}" + +_UI_AnalyzerModelWizard_label = Repository Aggregation Analysis +_UI_AnalyzerModelWizard_description = Create a new Analyzer model + +_UI_AnalyzerEditor_label = Aggregation Analysis Editor + +_UI_AnalyzerEditorFilenameDefaultBase = My +_UI_AnalyzerEditorFilenameExtensions = aggran + +_UI_Wizard_label = New + +_WARN_FilenameExtension = The file name must end in ''.{0}'' +_WARN_FilenameExtensions = The file name must have one of the following extensions: {0} + +_UI_ModelObject = &Model Object +_UI_XMLEncoding = &XML Encoding +_UI_XMLEncodingChoices = UTF-8 ASCII UTF-16 UTF-16BE UTF-16LE ISO-8859-1 +_UI_Wizard_initial_object_description = Select a model object to create + +_UI_FileConflict_label = File Conflict +_WARN_FileConflict = There are unsaved changes that conflict with changes made outside the editor. Do you wish to discard this editor's changes? +_UI_CBIWizard_category = Common Build Infrastructure + +_UI_ReconcileCommand_name = Reconcile +_UI_ReconcileCommand_description = Synchronize the contributions of the analysis with those of the aggregation + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/plugin.xml b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/plugin.xml new file mode 100644 index 000000000..84abfa6a7 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/plugin.xml @@ -0,0 +1,166 @@ + + + + + + + + + + + + %_UI_AnalyzerModelWizard_description + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/pom.xml b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/pom.xml new file mode 100644 index 000000000..7f3f54f1b --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + org.eclipse.cbi.p2repo.aggregator.analyzer.editor + 1.1.0-SNAPSHOT + eclipse-plugin + + org.eclipse.cbi + org.eclipse.cbi.p2repo.releng.parent + ../org.eclipse.cbi.p2repo.releng.parent + 1.1.0-SNAPSHOT + + \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AggregationAnalyzerEditorPlugin.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AggregationAnalyzerEditorPlugin.java new file mode 100644 index 000000000..aec0dfe5a --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AggregationAnalyzerEditorPlugin.java @@ -0,0 +1,151 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.cbi.p2repo.aggregator.provider.AggregatorEditPlugin; +import org.eclipse.cbi.p2repo.p2.provider.P2EditPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.OperationCanceledException; +import org.eclipse.core.runtime.Status; +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.ui.EclipseUIPlugin; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.statushandlers.IStatusAdapterConstants; +import org.eclipse.ui.statushandlers.StatusAdapter; +import org.eclipse.ui.statushandlers.StatusManager; + +/** + * This is the central singleton for the AggregationAnalyzer editor plugin. + * + * + * @generated + */ +public final class AggregationAnalyzerEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final AggregationAnalyzerEditorPlugin INSTANCE = new AggregationAnalyzerEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public AggregationAnalyzerEditorPlugin() { + super(new ResourceLocator[] { AggregatorEditPlugin.INSTANCE, P2EditPlugin.INSTANCE, }); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipseUIPlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + + public static void runInProgressDialog(Shell shell, IRunnableWithProgress runnable) + throws InvocationTargetException, InterruptedException { + ProgressMonitorDialog dialog = new ProgressMonitorDialog(shell) { + @Override + protected Point getInitialSize() { + Point calculatedSize = super.getInitialSize(); + if (calculatedSize.x < 800) { + calculatedSize.x = 800; + } + + return calculatedSize; + } + }; + + try { + dialog.run(true, true, runnable); + } catch (OperationCanceledException ex) { + // Ignore. + } catch (InvocationTargetException ex) { + if (!(ex.getCause() instanceof OperationCanceledException)) { + throw ex; + } + } + } + + public void showError(String title, Throwable throwable) { + if (throwable instanceof InvocationTargetException) { + showError(title, throwable.getCause()); + } else if (throwable instanceof CoreException) { + showError(title, ((CoreException) throwable).getStatus()); + } else { + showError(title, new Status(IStatus.ERROR, getSymbolicName(), throwable.getLocalizedMessage(), throwable)); + } + } + + public void showError(String title, IStatus status) { + StatusAdapter statusAdapter = new StatusAdapter(status); + statusAdapter.setProperty(IStatusAdapterConstants.TITLE_PROPERTY, title); + StatusManager.getManager().handle(statusAdapter, StatusManager.SHOW); + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerActionBarContributor.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerActionBarContributor.java new file mode 100644 index 000000000..ce810dd87 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerActionBarContributor.java @@ -0,0 +1,442 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.common.ui.viewer.IViewerProvider; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.eclipse.emf.edit.ui.action.CollapseAllAction; +import org.eclipse.emf.edit.ui.action.ControlAction; +import org.eclipse.emf.edit.ui.action.CreateChildAction; +import org.eclipse.emf.edit.ui.action.CreateSiblingAction; +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.action.ExpandAllAction; +import org.eclipse.emf.edit.ui.action.FindAction; +import org.eclipse.emf.edit.ui.action.LoadResourceAction; +import org.eclipse.emf.edit.ui.action.RevertAction; +import org.eclipse.emf.edit.ui.action.ValidateAction; +import org.eclipse.emf.edit.ui.provider.DiagnosticDecorator; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.ActionContributionItem; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.action.IContributionItem; +import org.eclipse.jface.action.IContributionManager; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.action.SubContributionItem; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.PartInitException; + +/** + * This is the action bar contributor for the Analyzer model editor. + * + * + * @generated + */ +public class AnalyzerActionBarContributor extends EditingDomainActionBarContributor + implements ISelectionChangedListener { + /** + * This keeps track of the active editor. + * + * + * @generated + */ + protected IEditorPart activeEditorPart; + + /** + * This keeps track of the current selection provider. + * + * + * @generated + */ + protected ISelectionProvider selectionProvider; + + /** + * This action opens the Properties view. + * + * + * @generated + */ + protected IAction showPropertiesViewAction = new Action( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } catch (PartInitException exception) { + AggregationAnalyzerEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * This action refreshes the viewer of the current editor if the editor + * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. + * + * + * @generated + */ + protected IAction refreshViewerAction = new Action( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { + @Override + public boolean isEnabled() { + return activeEditorPart instanceof IViewerProvider; + } + + @Override + public void run() { + if (activeEditorPart instanceof IViewerProvider) { + Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer(); + if (viewer != null) { + viewer.refresh(); + } + } + } + }; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * @generated + */ + protected Collection createChildActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateChild actions. + * + * + * @generated + */ + protected IMenuManager createChildMenuManager; + + /** + * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor + * generated for the current selection by the item provider. + * + * + * @generated + */ + protected Collection createSiblingActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateSibling actions. + * + * + * @generated + */ + protected IMenuManager createSiblingMenuManager; + + /** + * This creates an instance of the contributor. + * + * + * @generated + */ + public AnalyzerActionBarContributor() { + super(ADDITIONS_LAST_STYLE); + loadResourceAction = new LoadResourceAction(); + validateAction = new ValidateAction(); + liveValidationAction = new DiagnosticDecorator.LiveValidator.LiveValidationAction( + AggregationAnalyzerEditorPlugin.getPlugin().getDialogSettings()); + controlAction = new ControlAction(); + findAction = FindAction.create(); + revertAction = new RevertAction(); + expandAllAction = new ExpandAllAction(); + collapseAllAction = new CollapseAllAction(); + } + + /** + * This adds Separators for editor additions to the tool bar. + * + * + * @generated + */ + @Override + public void contributeToToolBar(IToolBarManager toolBarManager) { + super.contributeToToolBar(toolBarManager); + toolBarManager.add(new Separator("analyzer-settings")); + toolBarManager.add(new Separator("analyzer-additions")); + } + + /** + * This adds to the menu bar a menu and some separators for editor additions, + * as well as the sub-menus for object creation items. + * + * + * @generated + */ + @Override + public void contributeToMenu(IMenuManager menuManager) { + super.contributeToMenu(menuManager); + + IMenuManager submenuManager = new MenuManager( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_AnalyzerEditor_menu"), + "org.eclipse.cbi.p2repo.aggregator.analyzerMenuID"); + menuManager.insertAfter("additions", submenuManager); + submenuManager.add(new Separator("settings")); + submenuManager.add(new Separator("actions")); + submenuManager.add(new Separator("additions")); + submenuManager.add(new Separator("additions-end")); + + // Prepare for CreateChild item addition or removal. + // + createChildMenuManager = new MenuManager( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + submenuManager.insertBefore("additions", createSiblingMenuManager); + + // Force an update because Eclipse hides empty menus now. + // + submenuManager.addMenuListener(new IMenuListener() { + @Override + public void menuAboutToShow(IMenuManager menuManager) { + menuManager.updateAll(true); + } + }); + + addGlobalActions(submenuManager); + } + + /** + * When the active editor changes, this remembers the change and registers with it as a selection provider. + * + * + * @generated + */ + @Override + public void setActiveEditor(IEditorPart part) { + super.setActiveEditor(part); + activeEditorPart = part; + + // Switch to the new selection provider. + // + if (selectionProvider != null) { + selectionProvider.removeSelectionChangedListener(this); + } + if (part == null) { + selectionProvider = null; + } else { + selectionProvider = part.getSite().getSelectionProvider(); + selectionProvider.addSelectionChangedListener(this); + + // Fake a selection changed event to update the menus. + // + if (selectionProvider.getSelection() != null) { + selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); + } + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, + * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings + * that can be added to the selected object and updating the menus accordingly. + * + * + * @generated + */ + @Override + public void selectionChanged(SelectionChangedEvent event) { + // Remove any menu items for old selection. + // + if (createChildMenuManager != null) { + depopulateManager(createChildMenuManager, createChildActions); + } + if (createSiblingMenuManager != null) { + depopulateManager(createSiblingMenuManager, createSiblingActions); + } + + // Query the new selection for appropriate new child/sibling descriptors + // + Collection newChildDescriptors = null; + Collection newSiblingDescriptors = null; + + ISelection selection = event.getSelection(); + if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { + Object object = ((IStructuredSelection) selection).getFirstElement(); + + EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain(); + + newChildDescriptors = domain.getNewChildDescriptors(object, null); + newSiblingDescriptors = domain.getNewChildDescriptors(null, object); + } + + // Generate actions for selection; populate and redraw the menus. + // + createChildActions = generateCreateChildActions(newChildDescriptors, selection); + createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); + + if (createChildMenuManager != null) { + populateManager(createChildMenuManager, createChildActions, null); + createChildMenuManager.update(true); + } + if (createSiblingMenuManager != null) { + populateManager(createSiblingMenuManager, createSiblingActions, null); + createSiblingMenuManager.update(true); + } + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * @generated + */ + protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList<>(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in descriptors, + * and returns the collection of these actions. + * + * + * @generated + */ + protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList<>(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, + * by inserting them before the specified contribution item contributionID. + * If contributionID is null, they are simply added. + * + * + * @generated + */ + protected void populateManager(IContributionManager manager, Collection actions, + String contributionID) { + if (actions != null) { + for (IAction action : actions) { + if (contributionID != null) { + manager.insertBefore(contributionID, action); + } else { + manager.add(action); + } + } + } + } + + /** + * This removes from the specified manager all {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. + * + * + * @generated + */ + protected void depopulateManager(IContributionManager manager, Collection actions) { + if (actions != null) { + IContributionItem[] items = manager.getItems(); + for (int i = 0; i < items.length; i++) { + // Look into SubContributionItems + // + IContributionItem contributionItem = items[i]; + while (contributionItem instanceof SubContributionItem) { + contributionItem = ((SubContributionItem) contributionItem).getInnerItem(); + } + + // Delete the ActionContributionItems with matching action. + // + if (contributionItem instanceof ActionContributionItem) { + IAction action = ((ActionContributionItem) contributionItem).getAction(); + if (actions.contains(action)) { + manager.remove(contributionItem); + } + } + } + } + } + + /** + * This populates the pop-up menu before it appears. + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + super.menuAboutToShow(menuManager); + MenuManager submenuManager = null; + + submenuManager = new MenuManager( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + populateManager(submenuManager, createSiblingActions, null); + menuManager.insertBefore("edit", submenuManager); + } + + /** + * This inserts global actions before the "additions-end" separator. + * + * + * @generated + */ + @Override + protected void addGlobalActions(IMenuManager menuManager) { + menuManager.insertAfter("additions-end", new Separator("ui-actions")); + menuManager.insertAfter("ui-actions", showPropertiesViewAction); + + refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); + menuManager.insertAfter("ui-actions", refreshViewerAction); + + super.addGlobalActions(menuManager); + } + + /** + * This ensures that a delete action will clean up all references to deleted objects. + * + * + * @generated + */ + @Override + protected boolean removeAllReferencesOnDelete() { + return true; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerEditor.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerEditor.java new file mode 100644 index 000000000..08d6810a5 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerEditor.java @@ -0,0 +1,3239 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation; + +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.Date; +import java.util.EventObject; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; +import java.util.TreeMap; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicLong; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.BiConsumer; +import java.util.function.Function; +import java.util.stream.Collectors; + +import org.eclipse.cbi.p2repo.aggregator.Contribution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.handlers.AnalyzeHandler; +import org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.handlers.AnalyzeHandler.Analyzer; +import org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.handlers.LastModifiedHandler; +import org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.handlers.LastModifiedHandler.LastModifiedUpdater; +import org.eclipse.cbi.p2repo.aggregator.analyzer.provider.AnalyzerItemProviderAdapterFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.provider.ContributionAnalysisItemProvider; +import org.eclipse.cbi.p2repo.aggregator.analyzer.util.AnalyzerUtil; +import org.eclipse.cbi.p2repo.aggregator.p2view.IUPresentation; +import org.eclipse.cbi.p2repo.aggregator.p2view.MetadataRepositoryStructuredView; +import org.eclipse.cbi.p2repo.aggregator.p2view.P2viewPackage; +import org.eclipse.cbi.p2repo.aggregator.p2view.ProvidedCapabilityWrapper; +import org.eclipse.cbi.p2repo.aggregator.p2view.RequirementWrapper; +import org.eclipse.cbi.p2repo.aggregator.p2view.provider.P2viewItemProviderAdapterFactory; +import org.eclipse.cbi.p2repo.aggregator.provider.AggregatorItemProviderAdapterFactory; +import org.eclipse.cbi.p2repo.p2.provider.P2ItemProviderAdapterFactory; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.core.resources.IResourceDeltaVisitor; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.draw2d.IFigure; +import org.eclipse.draw2d.Label; +import org.eclipse.draw2d.MarginBorder; +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.command.AbstractCommand; +import org.eclipse.emf.common.command.BasicCommandStack; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.command.CommandStackListener; +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.impl.AdapterImpl; +import org.eclipse.emf.common.ui.MarkerHelper; +import org.eclipse.emf.common.ui.editor.ProblemEditorPart; +import org.eclipse.emf.common.ui.viewer.ColumnViewerInformationControlToolTipSupport; +import org.eclipse.emf.common.ui.viewer.IViewerProvider; +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.SegmentSequence; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.URIConverter; +import org.eclipse.emf.ecore.util.EContentAdapter; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.command.ChangeCommand; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; +import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IWrapperItemProvider; +import org.eclipse.emf.edit.provider.ItemProvider; +import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; +import org.eclipse.emf.edit.provider.resource.ResourceItemProvider; +import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; +import org.eclipse.emf.edit.tree.TreeFactory; +import org.eclipse.emf.edit.tree.TreeNode; +import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; +import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; +import org.eclipse.emf.edit.ui.dnd.LocalTransfer; +import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; +import org.eclipse.emf.edit.ui.provider.DecoratingColumLabelProvider; +import org.eclipse.emf.edit.ui.provider.DelegatingStyledCellLabelProvider; +import org.eclipse.emf.edit.ui.provider.DiagnosticDecorator; +import org.eclipse.emf.edit.ui.provider.ExtendedColorRegistry; +import org.eclipse.emf.edit.ui.provider.ExtendedFontRegistry; +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; +import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; +import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; +import org.eclipse.emf.edit.ui.util.EditUIUtil; +import org.eclipse.emf.edit.ui.util.FindAndReplaceTarget; +import org.eclipse.emf.edit.ui.util.IRevertablePart; +import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.IProvidedCapability; +import org.eclipse.equinox.p2.metadata.IRequirement; +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.text.IFindReplaceTarget; +import org.eclipse.jface.util.LocalSelectionTransfer; +import org.eclipse.jface.viewers.CellLabelProvider; +import org.eclipse.jface.viewers.DelegatingStyledCellLabelProvider.IStyledLabelProvider; +import org.eclipse.jface.viewers.IContentProvider; +import org.eclipse.jface.viewers.IDoubleClickListener; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.ISelectionProvider; +import org.eclipse.jface.viewers.IStructuredContentProvider; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.TreePath; +import org.eclipse.jface.viewers.TreeSelection; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.dnd.DND; +import org.eclipse.swt.dnd.FileTransfer; +import org.eclipse.swt.dnd.Transfer; +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; +import org.eclipse.swt.events.MouseAdapter; +import org.eclipse.swt.events.MouseEvent; +import org.eclipse.swt.events.MouseListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.RGB; +import org.eclipse.swt.graphics.Rectangle; +import org.eclipse.swt.layout.FillLayout; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.actions.WorkspaceModifyOperation; +import org.eclipse.ui.dialogs.SaveAsDialog; +import org.eclipse.ui.ide.IGotoMarker; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.MultiPageEditorPart; +import org.eclipse.ui.views.contentoutline.ContentOutline; +import org.eclipse.ui.views.contentoutline.ContentOutlinePage; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; +import org.eclipse.ui.views.properties.IPropertySheetPage; +import org.eclipse.ui.views.properties.PropertySheet; +import org.eclipse.ui.views.properties.PropertySheetPage; +import org.eclipse.zest.core.viewers.GraphViewer; +import org.eclipse.zest.core.viewers.IConnectionStyleProvider; +import org.eclipse.zest.core.viewers.IEntityStyleProvider; +import org.eclipse.zest.core.viewers.IGraphEntityRelationshipContentProvider; +import org.eclipse.zest.core.widgets.Graph; +import org.eclipse.zest.core.widgets.GraphNode; +import org.eclipse.zest.core.widgets.ZestStyles; +import org.eclipse.zest.layouts.LayoutAlgorithm; +import org.eclipse.zest.layouts.LayoutEntity; +import org.eclipse.zest.layouts.LayoutStyles; +import org.eclipse.zest.layouts.algorithms.AbstractLayoutAlgorithm; +import org.eclipse.zest.layouts.algorithms.CompositeLayoutAlgorithm; +import org.eclipse.zest.layouts.dataStructures.InternalNode; +import org.eclipse.zest.layouts.dataStructures.InternalRelationship; + +/** + * This is an example of a Analyzer model editor. + * + * + * @generated + */ +public class AnalyzerEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, + IMenuListener, IViewerProvider, IGotoMarker, IRevertablePart { + /** + * This keeps track of the editing domain that is used to track all changes to the model. + * + * + * @generated + */ + protected AdapterFactoryEditingDomain editingDomain; + + /** + * This is the one adapter factory used for providing views of the model. + * + * + * @generated + */ + protected ComposedAdapterFactory adapterFactory; + + /** + * This is the content outline page. + * + * + * @generated + */ + protected IContentOutlinePage contentOutlinePage; + + /** + * This is a kludge... + * + * + * @generated + */ + protected IStatusLineManager contentOutlineStatusLineManager; + + /** + * This is the content outline page's viewer. + * + * + * @generated + */ + protected TreeViewer contentOutlineViewer; + + /** + * This is the property sheet page. + * + * + * @generated + */ + protected List propertySheetPages = new ArrayList<>(); + + /** + * This is the viewer that shadows the selection in the content outline. + * The parent relation must be correctly defined for this to work. + * + * + * @generated + */ + protected TreeViewer selectionViewer; + + /** + * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. + * + * + * @generated + */ + protected Viewer currentViewer; + + /** + * This listens to which ever viewer is active. + * + * + * @generated + */ + protected ISelectionChangedListener selectionChangedListener; + + /** + * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. + * + * + * @generated + */ + protected Collection selectionChangedListeners = new ArrayList<>(); + + /** + * This keeps track of the selection of the editor as a whole. + * + * + * @generated + */ + protected ISelection editorSelection = StructuredSelection.EMPTY; + + /** + * The MarkerHelper is responsible for creating workspace resource markers presented + * in Eclipse's Problems View. + * + * + * @generated + */ + protected MarkerHelper markerHelper = new EditUIMarkerHelper(); + + /** + * This listens for when the outline becomes active + * + * + * @generated + */ + protected IPartListener partListener = new IPartListener() { + @Override + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(AnalyzerEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(AnalyzerEditor.this); + handleActivate(); + } + } else if (p == AnalyzerEditor.this) { + handleActivate(); + } + } + + @Override + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + + @Override + public void partOpened(IWorkbenchPart p) { + // Ignore. + } + }; + + /** + * Resources that have been removed since last activation. + * + * + * @generated + */ + protected Collection removedResources = new ArrayList<>(); + + /** + * Resources that have been changed since last activation. + * + * + * @generated + */ + protected Collection changedResources = new ArrayList<>(); + + /** + * Resources that have been saved. + * + * + * @generated + */ + protected Collection savedResources = new ArrayList<>(); + + /** + * Map to store the diagnostic associated with a resource. + * + * + * @generated + */ + protected Map resourceToDiagnosticMap = new LinkedHashMap<>(); + + /** + * Controls whether the problem indication should be updated. + * + * + * @generated + */ + protected boolean updateProblemIndication = true; + + /** + * Adapter used to update the problem indication when resources are demanded loaded. + * + * + * @generated + */ + protected EContentAdapter problemIndicationAdapter = new EContentAdapter() { + protected boolean dispatching; + + @Override + public void notifyChanged(Notification notification) { + if (notification.getNotifier() instanceof Resource) { + switch (notification.getFeatureID(Resource.class)) { + case Resource.RESOURCE__IS_LOADED: + case Resource.RESOURCE__ERRORS: + case Resource.RESOURCE__WARNINGS: { + Resource resource = (Resource) notification.getNotifier(); + Diagnostic diagnostic = analyzeResourceProblems(resource, null); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, diagnostic); + } else { + resourceToDiagnosticMap.remove(resource); + } + dispatchUpdateProblemIndication(); + break; + } + default: + break; + } + } else { + super.notifyChanged(notification); + } + } + + protected void dispatchUpdateProblemIndication() { + if (updateProblemIndication && !dispatching) { + dispatching = true; + getSite().getShell().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + dispatching = false; + updateProblemIndication(); + } + }); + } + } + + @Override + protected void setTarget(Resource target) { + basicSetTarget(target); + } + + @Override + protected void unsetTarget(Resource target) { + basicUnsetTarget(target); + resourceToDiagnosticMap.remove(target); + dispatchUpdateProblemIndication(); + } + }; + + /** + * This listens for workspace changes. + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() { + @Override + public void resourceChanged(IResourceChangeEvent event) { + IResourceDelta delta = event.getDelta(); + try { + class ResourceDeltaVisitor implements IResourceDeltaVisitor { + protected ResourceSet resourceSet = editingDomain.getResourceSet(); + protected Collection changedResources = new ArrayList<>(); + protected Collection removedResources = new ArrayList<>(); + + @Override + public boolean visit(final IResourceDelta delta) { + if (delta.getResource().getType() == IResource.FILE) { + if (delta.getKind() == IResourceDelta.REMOVED + || delta.getKind() == IResourceDelta.CHANGED) { + final Resource resource = resourceSet.getResource( + URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); + if (resource != null) { + if (delta.getKind() == IResourceDelta.REMOVED) { + removedResources.add(resource); + } else { + if ((delta.getFlags() & IResourceDelta.MARKERS) != 0) { + DiagnosticDecorator.DiagnosticAdapter.update(resource, + markerHelper.getMarkerDiagnostics(resource, + (IFile) delta.getResource(), false)); + } + if ((delta.getFlags() & IResourceDelta.CONTENT) != 0) { + if (!savedResources.remove(resource)) { + changedResources.add(resource); + } + } + } + } + } + return false; + } + + return true; + } + + public Collection getChangedResources() { + return changedResources; + } + + public Collection getRemovedResources() { + return removedResources; + } + } + + final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); + delta.accept(visitor); + + if (!visitor.getRemovedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(AnalyzerEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == AnalyzerEditor.this) { + handleActivate(); + } + } + }); + } + } catch (CoreException exception) { + AggregationAnalyzerEditorPlugin.INSTANCE.log(exception); + } + } + }; + + protected Map viewers = new LinkedHashMap<>(); + + protected List> showInActionFactories = new ArrayList<>(); + + private TreeViewer analysisViewer; + + private TreeViewer duplicatesViewer; + + private TreeViewer strictRequirementsViewer; + + private TreeViewer namespaceViewer; + + private GraphViewer graphViewer; + + private TreeViewer repositoryViewer; + + private TreeViewer dependentIUsViewer; + + private TreeViewer requiredIUsViewer; + + private AtomicReference analyzer; + + /** + * This creates a model editor. + * + * + * @generated + */ + public AnalyzerEditor() { + super(); + initializeEditingDomain(); + } + + protected void setActivePage(Viewer viewer) { + int pageIndex = 0; + for (Viewer otherViewer : viewers.values()) { + if (otherViewer == viewer) { + setActivePage(pageIndex); + return; + } + ++pageIndex; + } + } + + protected void handleActivate() { + handleActivateGen(); + setReadOnly(false); + } + + /** + * Handles activation of the editor or it's associated views. + * + * + * @generated + */ + protected void handleActivateGen() { + // Recompute the read only state. + // + if (editingDomain.getResourceToReadOnlyMap() != null) { + editingDomain.getResourceToReadOnlyMap().clear(); + + // Refresh any actions that may become enabled or disabled. + // + setSelection(getSelection()); + } + + if (!removedResources.isEmpty()) { + if (handleDirtyConflict()) { + getSite().getPage().closeEditor(AnalyzerEditor.this, false); + } else { + removedResources.clear(); + changedResources.clear(); + savedResources.clear(); + } + } else if (!changedResources.isEmpty()) { + changedResources.removeAll(savedResources); + handleChangedResources(); + changedResources.clear(); + savedResources.clear(); + } + } + + /** + * Handles what to do with changed resources on activation. + * + * + * @generated + */ + protected void handleChangedResources() { + if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + ResourceSet resourceSet = editingDomain.getResourceSet(); + if (isDirty()) { + changedResources.addAll(resourceSet.getResources()); + } + editingDomain.getCommandStack().flush(); + + updateProblemIndication = false; + for (Resource resource : changedResources) { + if (resource.isLoaded()) { + resource.unload(); + try { + resource.load(resourceSet.getLoadOptions()); + } catch (IOException exception) { + if (!resourceToDiagnosticMap.containsKey(resource)) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + } + } + } + + if (AdapterFactoryEditingDomain.isStale(editorSelection)) { + setSelection(StructuredSelection.EMPTY); + } + + updateProblemIndication = true; + updateProblemIndication(); + } + } + + /** + * Updates the problems indication with the information described in the specified diagnostic. + * + * + * @generated + */ + protected void updateProblemIndication() { + if (updateProblemIndication) { + BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, + "org.eclipse.cbi.p2repo.aggregator.analyzer.editor", 0, null, + new Object[] { editingDomain.getResourceSet() }); + for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { + if (childDiagnostic.getSeverity() != Diagnostic.OK) { + diagnostic.add(childDiagnostic); + } + } + + int lastEditorPage = getPageCount() - 1; + if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { + ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); + if (diagnostic.getSeverity() != Diagnostic.OK) { + setActivePage(lastEditorPage); + } + } else if (diagnostic.getSeverity() != Diagnostic.OK) { + ProblemEditorPart problemEditorPart = new ProblemEditorPart(); + problemEditorPart.setDiagnostic(diagnostic); + problemEditorPart.setMarkerHelper(markerHelper); + try { + addPage(++lastEditorPage, problemEditorPart, getEditorInput()); + setPageText(lastEditorPage, problemEditorPart.getPartName()); + setActivePage(lastEditorPage); + showTabs(); + } catch (PartInitException exception) { + AggregationAnalyzerEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + try { + markerHelper.updateMarkers(diagnostic); + } catch (CoreException exception) { + AggregationAnalyzerEditorPlugin.INSTANCE.log(exception); + } + } + } + } + + /** + * Shows a dialog that asks if conflicting changes should be discarded. + * + * + * @generated + */ + protected boolean handleDirtyConflict() { + return MessageDialog.openQuestion(getSite().getShell(), getString("_UI_FileConflict_label"), + getString("_WARN_FileConflict")); + } + + protected void initializeEditingDomain() { + initializeEditingDomainGen(); + adapterFactory.insertAdapterFactory(new ResourceItemProviderAdapterFactory() { + @Override + public Adapter createResourceAdapter() { + return new ResourceItemProvider(this) { + @Override + public Collection getChildren(Object object) { + Collection children = super.getChildren(object); + URI uri = ((Resource) object).getURI(); + if (!children.isEmpty() && !uri.equals(AnalyzeHandler.DUPLICATE_ANALYSIS_RESULT) + && !uri.equals(AnalyzeHandler.STRICT_REQUIREMENT_ANALYSIS_RESULT)) { + return Collections.singleton(children.iterator().next()); + } + return children; + } + }; + } + }); + adapterFactory + .insertAdapterFactory(new org.eclipse.cbi.p2repo.aggregator.p2.provider.P2ItemProviderAdapterFactory()); + editingDomain.setResourceToReadOnlyMap(new HashMap<>()); + } + + /** + * This sets up the editing domain for the model editor. + * + * + * @generated + */ + protected void initializeEditingDomainGen() { + // Create an adapter factory that yields item providers. + // + adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); + + adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new AnalyzerItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new AggregatorItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new P2viewItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new P2ItemProviderAdapterFactory()); + adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); + + // Create the command stack that will notify this editor as commands are executed. + // + BasicCommandStack commandStack = new BasicCommandStack() { + @Override + public void execute(Command command) { + // Cancel live validation before executing a command that will trigger a new round of validation. + // + if (!(command instanceof AbstractCommand.NonDirtying)) { + DiagnosticDecorator.cancel(editingDomain); + } + super.execute(command); + } + }; + + // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus. + // + commandStack.addCommandStackListener(new CommandStackListener() { + @Override + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + firePropertyChange(IEditorPart.PROP_DIRTY); + + // Try to select the affected objects. + // + Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); + if (mostRecentCommand != null) { + setSelectionToViewer(mostRecentCommand.getAffectedObjects()); + } + for (Iterator i = propertySheetPages.iterator(); i.hasNext();) { + PropertySheetPage propertySheetPage = i.next(); + if (propertySheetPage.getControl() == null || propertySheetPage.getControl().isDisposed()) { + i.remove(); + } else { + propertySheetPage.refresh(); + } + } + } + }); + } + }); + + // Create the editing domain with a special command stack. + // + editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); + } + + /** + * This is here for the listener to be able to call it. + * + * + * @generated + */ + @Override + protected void firePropertyChange(int action) { + super.firePropertyChange(action); + } + + /** + * This sets the selection into whichever viewer is active. + * + * + * @generated + */ + public void setSelectionToViewer(Collection collection) { + final Collection theSelection = collection; + // Make sure it's okay. + // + if (theSelection != null && !theSelection.isEmpty()) { + Runnable runnable = new Runnable() { + @Override + public void run() { + // Try to select the items in the current content viewer of the editor. + // + if (currentViewer != null) { + currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); + } + } + }; + getSite().getShell().getDisplay().asyncExec(runnable); + } + } + + /** + * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. + * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} + * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. + * + * + * @generated + */ + @Override + public EditingDomain getEditingDomain() { + return editingDomain; + } + + /** + * + * + * @generated + */ + public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { + /** + * + * + * @generated + */ + public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * + * + * @generated + */ + @Override + public Object[] getElements(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * @generated + */ + @Override + public Object[] getChildren(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * @generated + */ + @Override + public boolean hasChildren(Object object) { + Object parent = super.getParent(object); + return parent != null; + } + + /** + * + * + * @generated + */ + @Override + public Object getParent(Object object) { + return null; + } + } + + /** + * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, + * is the current one. + * + * + * @generated + */ + public void setCurrentViewer(Viewer viewer) { + // If it is changing... + // + if (currentViewer != viewer) { + if (selectionChangedListener == null) { + // Create the listener on demand. + // + selectionChangedListener = new ISelectionChangedListener() { + // This just notifies those things that are affected by the section. + // + @Override + public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { + setSelection(selectionChangedEvent.getSelection()); + } + }; + } + + // Stop listening to the old one. + // + if (currentViewer != null) { + currentViewer.removeSelectionChangedListener(selectionChangedListener); + } + + // Start listening to the new one. + // + if (viewer != null) { + viewer.addSelectionChangedListener(selectionChangedListener); + } + + // Remember it. + // + currentViewer = viewer; + + // Set the editors selection based on the current viewer's selection. + // + setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); + } + } + + /** + * This returns the viewer as required by the {@link IViewerProvider} interface. + * + * + * @generated + */ + @Override + public Viewer getViewer() { + return currentViewer; + } + + /** + * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. + * + * + * @generated + */ + protected void createContextMenuForGen(StructuredViewer viewer) { + MenuManager contextMenu = new MenuManager("#PopUp"); + contextMenu.add(new Separator("additions")); + contextMenu.setRemoveAllWhenShown(true); + contextMenu.addMenuListener(this); + Menu menu = contextMenu.createContextMenu(viewer.getControl()); + viewer.getControl().setMenu(menu); + getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); + + int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), + FileTransfer.getInstance() }; + viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); + viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); + } + + protected void createContextMenuFor(StructuredViewer viewer) { + createContextMenuForGen(viewer); + viewer.getControl().addMouseListener(new MouseAdapter() { + @Override + public void mouseDoubleClick(MouseEvent event) { + if (event.button == 1) { + try { + getEditorSite().getPage().showView("org.eclipse.ui.views.PropertySheet", null, + IWorkbenchPage.VIEW_VISIBLE); + } catch (PartInitException exception) { + AggregationAnalyzerEditorPlugin.INSTANCE.log(exception); + } + } + } + }); + } + + /** + * This is the method called to load a resource into the editing domain's resource set based on the editor's input. + * + * + * @generated + */ + public void createModel() { + URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter()); + Exception exception = null; + Resource resource = null; + try { + // Load the resource through the editing domain. + // + resource = editingDomain.getResourceSet().getResource(resourceURI, true); + } catch (Exception e) { + exception = e; + resource = editingDomain.getResourceSet().getResource(resourceURI, false); + } + + Diagnostic diagnostic = analyzeResourceProblems(resource, exception); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); + } + + /** + * Returns a diagnostic describing the errors and warnings listed in the resource + * and the specified exception (if any). + * + * + * @generated + */ + public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { + boolean hasErrors = !resource.getErrors().isEmpty(); + if (hasErrors || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = new BasicDiagnostic(hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, + "org.eclipse.cbi.p2repo.aggregator.analyzer.editor", 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object[] { exception == null ? (Object) resource : exception }); + basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); + return basicDiagnostic; + } else if (exception != null) { + return new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.cbi.p2repo.aggregator.analyzer.editor", 0, + getString("_UI_CreateModelError_message", resource.getURI()), new Object[] { exception }); + } else { + return Diagnostic.OK_INSTANCE; + } + } + + protected void initialize(Analysis analysis) { + updateProblemIndication = false; + + // Reconcile the GenModel using a ChangeCommand. + class ReconcileCommand extends ChangeCommand { + public ReconcileCommand(Analysis analysis) { + super(analysis); + setLabel(AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_ReconcileCommand_name")); + setDescription(AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_ReconcileCommand_description")); + } + + @Override + protected void doExecute() { + ((Analysis) notifier).reconcile(); + } + + public boolean hasChanges() { + return changeDescription != null && !changeDescription.getObjectChanges().isEmpty(); + } + } + + ReconcileCommand reconcileCommand = new ReconcileCommand(analysis); + CommandStack commandStack = editingDomain.getCommandStack(); + commandStack.execute(reconcileCommand); + + // If the reconcile operation produced no changes, the command is a no-op so we can remove it from the command stack. + // This way the resource is only dirty if it's actually been reconciled in a way that changes the structure. + if (!reconcileCommand.hasChanges()) { + commandStack.undo(); + } + } + + @Override + public void createPages() { + + createPagesGen(); + viewers.put(selectionViewer.getControl(), selectionViewer); + showInActionFactories.add(selection -> new ShowInAction(getPageText(0), selection, selectionViewer) { + @Override + protected void handleSelection(Object element) { + if (element instanceof ContributionAnalysis) { + setTarget(element); + } + } + }); + + ResourceSet resourceSet = editingDomain.getResourceSet(); + Resource resource = resourceSet.getResources().get(0); + Analysis analysis = (Analysis) EcoreUtil.getObjectByType(resource.getContents(), + AnalyzerPackage.Literals.ANALYSIS); + analyzer = new AtomicReference<>(); + if (analysis != null) { + analyzer.set(new AnalyzeHandler.Analyzer(analysis)); + initialize(analysis); + } + + analysisViewer = createViewerWithBreadcrumb(composite -> createAnalysisViewer(composite)); + duplicatesViewer = createViewerWithBreadcrumb(composite -> createDuplicatesViewer(composite)); + strictRequirementsViewer = createViewerWithBreadcrumb(composite -> createStrictRequirementsViewer(composite)); + + dependentIUsViewer = createDependentIUsViewer(); + requiredIUsViewer = createRequiredIUsViewer(); + namespaceViewer = createNamespaceViewer(); + repositoryViewer = createRepositoryReviewer(); + graphViewer = createGraphViewer(); + + resourceSet.eAdapters().add(new AdapterImpl() { + @Override + public void notifyChanged(Notification notification) { + if (notification.getEventType() == Notification.ADD) { + Resource resource = (Resource) notification.getNewValue(); + URI uri = resource.getURI(); + if (uri.equals(AnalyzeHandler.STRICT_REQUIREMENT_ANALYSIS_RESULT)) { + strictRequirementsViewer.setInput(resource); + } else if (uri.equals(AnalyzeHandler.DUPLICATE_ANALYSIS_RESULT)) { + duplicatesViewer.setInput(resource); + } else if (uri.equals(AnalyzeHandler.ANALYSIS_RESULT)) { + analysisViewer.setInput(resource); + analysisViewer.setSelection(new StructuredSelection(resource.getContents().get(0))); + namespaceViewer.setInput(resource); + graphViewer.setInput(resource); + if (analyzer.getAndSet(null) != null) { + setActivePage(analysisViewer); + } + + Analysis analysis = (Analysis) EcoreUtil.getObjectByType(resource.getContents(), + AnalyzerPackage.Literals.ANALYSIS); + if (analysis != null) { + dependentIUsViewer + .setInput(new ItemProvider(Collections.singleton(createIUDependents(analysis)))); + requiredIUsViewer + .setInput(new ItemProvider(Collections.singleton(createIURequirements(analysis)))); + } + } else if (uri.equals(AnalyzeHandler.STRUCTURED_AGGREGATE_REPOSITORY)) { + MetadataRepositoryStructuredView metadataRepositoryStructuredView = (MetadataRepositoryStructuredView) EcoreUtil + .getObjectByType(resource.getContents(), + P2viewPackage.Literals.METADATA_REPOSITORY_STRUCTURED_VIEW); + repositoryViewer.setInput(metadataRepositoryStructuredView.getInstallableUnitList()); + } + } + setReadOnly(false); + } + }); + + showTabs(); + + selectionViewer.setAutoExpandLevel(2); + selectionViewer.setInput(resource); + + addPageChangedListener(event -> { + Viewer viewer = viewers.get(event.getSelectedPage()); + setCurrentViewer(viewer); + if (viewer != null && viewer != selectionViewer) { + Analyzer analyzer2 = analyzer.getAndSet(null); + if (analyzer2 != null && analyzer2.getBuildModelLocation() != null) { + LastModifiedUpdater lastModifiedUpdater = new LastModifiedHandler.LastModifiedUpdater(analysis); + lastModifiedUpdater.perform(analysisViewer.getControl().getShell()); + analyzer2.perform(analysisViewer.getControl().getShell()); + } + } + }); + } + + private R createViewerWithBreadcrumb(Function viewerCreator) { + Composite composite = new Composite(getContainer(), SWT.NONE); + composite.setBackground(selectionViewer.getControl().getBackground()); + composite.setBackground(composite.getDisplay().getSystemColor(SWT.COLOR_BLACK)); + GridLayout layout = new GridLayout(); + layout.verticalSpacing = 1; + layout.marginWidth = 0; + layout.marginHeight = 0; + composite.setLayout(layout); + + R viewer = viewerCreator.apply(composite); + viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); + StructuredViewer breadcrumbViewer = createBreadcrumbViewer(composite, viewer); + breadcrumbViewer.getControl().moveAbove(viewer.getControl()); + viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true)); + return viewer; + } + + protected StructuredViewer createBreadcrumbViewer(Composite parent, StructuredViewer treeViewer) { + try { + Object dummyInput = new Object(); + + parent.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY)); + + BiConsumer viewerConfigurator = (viewer, input) -> { + AdapterFactory adapterFactory = getAdapterFactory(); + AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(adapterFactory) { + @Override + public void notifyChanged(Notification notification) { + // Don't respond to any notification. + // An avalanche of these are produced while creating the elements. + } + + @Override + public Object getParent(Object object) { + if (object == treeViewer.getInput()) { + return null; + } + Object result = super.getParent(object); + return result; + } + + }; + viewer.setContentProvider(contentProvider); + + class MyLabelProvider extends AdapterFactoryLabelProvider implements IStyledLabelProvider { + public MyLabelProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + } + + MyLabelProvider styledLabelProvider = new MyLabelProvider(adapterFactory); + CellLabelProvider labelProvider = new DelegatingStyledCellLabelProvider(styledLabelProvider); + viewer.setLabelProvider(labelProvider); + + viewer.setInput(input); + }; + + StructuredViewer breadCrumbViewer = BreadCrumbSupport.createBreadCrumbViewer(parent, SWT.HORIZONTAL, + viewerConfigurator); + + viewerConfigurator.accept(breadCrumbViewer, dummyInput); + + treeViewer.addPostSelectionChangedListener(event -> { + Object element = event.getStructuredSelection().getFirstElement(); + if (element != null) { + breadCrumbViewer.setInput(element); + } + }); + + breadCrumbViewer.addOpenListener(event -> { + Object element = ((IStructuredSelection) event.getSelection()).getFirstElement(); + if (element != null) { + treeViewer.setSelection(new StructuredSelection(element), true); + setActivePage(treeViewer); + } + }); + + return breadCrumbViewer; + } catch (Throwable ex) { + ex.printStackTrace(); + // Ignore + return null; + } + } + + private Object createIURequirements(Analysis analysis) { + TreeNode root = TreeFactory.eINSTANCE.createTreeNode(); + root.setData(analysis); + List children = analysis.getContributions().stream().map(ContributionAnalysis::getInstallableUnits) + .flatMap(Collection::stream).map(iu -> { + TreeNode iuNode = TreeFactory.eINSTANCE.createTreeNode(); + iuNode.setData(iu); + List grandChildren = iu.getRequirements().stream() + .map(RequirementAnalysis::getResolutions).flatMap(Collection::stream) + .map(RequirementResolution::getInstallableUnit).distinct().map(r -> { + TreeNode requiredNode = TreeFactory.eINSTANCE.createTreeNode(); + requiredNode.setData(r); + return requiredNode; + }).collect(Collectors.toList()); + sort(grandChildren); + iuNode.getChildren().addAll(grandChildren); + return iuNode; + }).collect(Collectors.toList()); + sort(children); + root.getChildren().addAll(children); + return root; + } + + private Object createIUDependents(Analysis analysis) { + TreeNode root = TreeFactory.eINSTANCE.createTreeNode(); + root.setData(analysis); + List children = analysis.getContributions().stream().map(ContributionAnalysis::getInstallableUnits) + .flatMap(Collection::stream).map(iu -> { + TreeNode iuNode = TreeFactory.eINSTANCE.createTreeNode(); + iuNode.setData(iu); + List grandChildren = iu.getCapabilities().stream().map(CapabilityAnalysis::getResolutions) + .flatMap(Collection::stream).map(cr -> cr.getRequirement().getInstallableUnit()) + .filter(r -> r != iu).distinct().map(r -> { + TreeNode dependentNode = TreeFactory.eINSTANCE.createTreeNode(); + dependentNode.setData(r); + return dependentNode; + }).collect(Collectors.toList()); + sort(grandChildren); + iuNode.getChildren().addAll(grandChildren); + return iuNode; + }).collect(Collectors.toList()); + sort(children); + root.getChildren().addAll(children); + return root; + } + + private static void sort(List children) { + children.sort((c1, c2) -> ((InstallableUnitAnalysis) c1.getData()).getInstallableUnit() + .compareTo(((InstallableUnitAnalysis) c2.getData()).getInstallableUnit())); + + } + + protected TreeViewer createTreeViewer(Composite parent, String title, IDoubleClickListener doubleClickListener, + IMenuListener menuListener) { + Tree tree = new Tree(parent, SWT.MULTI); + TreeViewer treeViewer = new TreeViewer(tree); + + treeViewer.setAutoExpandLevel(2); + treeViewer.setUseHashlookup(true); + ComposedAdapterFactory composedAdapterFactory = new ComposedAdapterFactory( + new AdapterFactory[] { new AnalyzerItemProviderAdapterFactory() { + @Override + public Adapter createContributionAnalysisAdapter() { + if (contributionAnalysisItemProvider == null) { + contributionAnalysisItemProvider = new ContributionAnalysisItemProvider(this) { + @Override + public java.util.Collection getChildrenFeatures( + Object object) { + Collection childrenFeatures = super.getChildrenFeatures( + object); + childrenFeatures.remove(AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS__PROJECTS); + return childrenFeatures; + } + }; + } + + return contributionAnalysisItemProvider; + } + }, adapterFactory }); + AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(composedAdapterFactory); + treeViewer.setContentProvider(contentProvider); + treeViewer.setLabelProvider(new DecoratingColumLabelProvider( + new AdapterFactoryLabelProvider.ColorProvider(adapterFactory, selectionViewer), + new DiagnosticDecorator(editingDomain, selectionViewer, + AggregationAnalyzerEditorPlugin.getPlugin().getDialogSettings())) { + @Override + public String getToolTipText(Object element) { + String toolTip = AnalyzerEditor.getToolTip(element); + if (toolTip != null) { + String[] lines = toolTip.split("\r?\n"); + return String.join("
", lines).replaceAll(" ", " "); + } + return super.getToolTipText(element); + } + }); + + new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); + new ColumnViewerInformationControlToolTipSupport(treeViewer, + new DiagnosticDecorator.EditingDomainLocationListener(editingDomain, treeViewer)); + + if (doubleClickListener != null) { + treeViewer.addDoubleClickListener(doubleClickListener); + } + + createContextMenuFor(treeViewer); + if (menuListener != null) { + MenuManager menuManager = (MenuManager) treeViewer.getControl().getMenu().getData(MenuManager.MANAGER_KEY); + menuManager.addMenuListener(menuListener); + } + + Control control = parent == getContainer() ? tree : parent; + int pageIndex = addPage(control); + + setPageText(pageIndex, title); + viewers.put(control, treeViewer); + return treeViewer; + } + + protected TreeViewer createDuplicatesViewer(Composite parent) { + return createTreeViewer(parent, "Duplicate IUs", null, null); + } + + protected TreeViewer createStrictRequirementsViewer(Composite parent) { + showInActionFactories + .add(selection -> new ShowInAction("Strict Requirement IUs", selection, strictRequirementsViewer) { + @Override + protected void handleSelection(Object element) { + if (element instanceof ContributionAnalysis || element instanceof InstallableUnitAnalysis + || element instanceof CapabilityAnalysis || element instanceof CapabilityResolution) { + setTarget(element); + } else if (element instanceof IUPresentation) { + setTarget(((IUPresentation) element).getInstallableUnit()); + } + } + }); + + return createTreeViewer(parent, "Strict Requirement IUs", event -> { + ISelection selection = event.getSelection(); + Object element = ((IStructuredSelection) selection).getFirstElement(); + if (element instanceof CapabilityResolution) { + CapabilityResolution capabilityResolution = (CapabilityResolution) element; + IInstallableUnit installableUnit = capabilityResolution.getRequirement().getInstallableUnit() + .getInstallableUnit(); + for (EObject eObject : capabilityResolution.eResource().getContents()) { + if (((InstallableUnitAnalysis) eObject).getInstallableUnit() == installableUnit) { + setExpandedSelection(strictRequirementsViewer, new StructuredSelection(eObject)); + break; + } + } + } + }, manager -> { + }); + } + + private void selectOpposite(RequirementResolution requirementResolution) { + InstallableUnitAnalysis installableUnit = requirementResolution.getInstallableUnit(); + CapabilityAnalysis capabilityAnalysis = requirementResolution.getCapability(); + if (capabilityAnalysis != null) { + Optional capabilityResoltuion = capabilityAnalysis.getResolutions().stream() + .filter(rc -> rc.getCapability() == capabilityAnalysis).findFirst(); + analysisViewer.setSelection(new StructuredSelection( + capabilityResoltuion.isPresent() ? capabilityResoltuion.get() : capabilityAnalysis), true); + } else { + analysisViewer.setSelection(new StructuredSelection(installableUnit), true); + } + } + + private void selectOpposite(CapabilityResolution capabilityResolution) { + RequirementAnalysis requirement = capabilityResolution.getRequirement(); + Optional requirementResolution = requirement.getResolutions().stream() + .filter(rc -> rc.getRequirement() == requirement).findFirst(); + analysisViewer.setSelection( + new StructuredSelection(requirementResolution.isPresent() ? requirementResolution.get() : requirement)); + } + + protected TreeViewer createAnalysisViewer(Composite parent) { + showInActionFactories.add(selection -> new ShowInAction("Contributed IUs", selection, analysisViewer) { + @Override + protected void handleSelection(Object element) { + if (element instanceof ContributionAnalysis || element instanceof InstallableUnitAnalysis + || element instanceof RequirementAnalysis || element instanceof CapabilityAnalysis) { + setTarget(element); + } else if (element instanceof IUPresentation) { + setTarget(((IUPresentation) element).getInstallableUnit()); + } else if (element instanceof RequirementWrapper) { + setTarget(((RequirementWrapper) element).getGenuine()); + } else if (element instanceof ProvidedCapabilityWrapper) { + setTarget(((ProvidedCapabilityWrapper) element).getGenuine()); + } + } + }); + + return createTreeViewer(parent, "Contributed IUs", event -> { + ISelection selection = event.getSelection(); + Object element = ((IStructuredSelection) selection).getFirstElement(); + if (element instanceof CapabilityResolution) { + CapabilityResolution capabilityResolution = (CapabilityResolution) element; + selectOpposite(capabilityResolution); + } else if (element instanceof RequirementResolution) { + RequirementResolution requirementResolution = (RequirementResolution) element; + selectOpposite(requirementResolution); + } + }, null); + } + + protected TreeViewer createDependentIUsViewer() { + TreeViewer iuDependenciesViewer = createTreeViewer(getContainer(), "Dependent IUs", event -> { + ISelection selection = event.getSelection(); + Object element = ((IStructuredSelection) selection).getFirstElement(); + if (element instanceof TreeNode) { + TreeNode treeNode = (TreeNode) element; + TreeNode parent = treeNode.getParent(); + if (parent != null) { + TreeNode root = parent.getParent(); + if (root != null) { + EObject data = treeNode.getData(); + root.getChildren().stream().filter(it -> it.getData() == data).findFirst().ifPresent(it -> { + setExpandedSelection(AnalyzerEditor.this.dependentIUsViewer, new StructuredSelection(it)); + }); + } + } + } + }, null); + + showInActionFactories.add(selection -> new ShowInAction("Dependent IUs", selection, iuDependenciesViewer) { + @Override + protected void handleSelection(Object element) { + if (element instanceof InstallableUnitAnalysis) { + setTarget(element); + } else if (element instanceof IUPresentation) { + setTarget(((IUPresentation) element).getInstallableUnit()); + } + } + }); + + return iuDependenciesViewer; + } + + protected TreeViewer createRequiredIUsViewer() { + TreeViewer requiredIUsViewer = createTreeViewer(getContainer(), "Required IUs", event -> { + ISelection selection = event.getSelection(); + Object element = ((IStructuredSelection) selection).getFirstElement(); + if (element instanceof TreeNode) { + TreeNode treeNode = (TreeNode) element; + TreeNode parent = treeNode.getParent(); + if (parent != null) { + TreeNode root = parent.getParent(); + if (root != null) { + EObject data = treeNode.getData(); + root.getChildren().stream().filter(it -> it.getData() == data).findFirst().ifPresent(it -> { + setExpandedSelection(AnalyzerEditor.this.requiredIUsViewer, new StructuredSelection(it)); + }); + } + } + } + }, null); + + showInActionFactories.add(selection -> new ShowInAction("Required IUs", selection, requiredIUsViewer) { + @Override + protected void handleSelection(Object element) { + if (element instanceof InstallableUnitAnalysis) { + setTarget(element); + } else if (element instanceof IUPresentation) { + setTarget(((IUPresentation) element).getInstallableUnit()); + } + } + }); + + return requiredIUsViewer; + } + + protected TreeViewer createRepositoryReviewer() { + showInActionFactories.add(selection -> new ShowInAction("Aggregated Repository", selection, repositoryViewer) { + @Override + protected void handleSelection(Object element) { + if (element instanceof InstallableUnitAnalysis) { + setTarget(((InstallableUnitAnalysis) element).getInstallableUnit()); + } else if (element instanceof RequirementAnalysis) { + setTarget(((RequirementAnalysis) element).getRequirement()); + } else if (element instanceof CapabilityAnalysis) { + setTarget(((CapabilityAnalysis) element).getCapability()); + } + } + }); + return createTreeViewer(getContainer(), "Aggregated Repository", null, null); + } + + protected TreeViewer createNamespaceViewer() { + TreeViewer namespaceViewer = createTreeViewer(getContainer(), "Contributed Namespaces", null, null); + namespaceViewer.setAutoExpandLevel(3); + + showInActionFactories.add(selection -> new ShowInAction("Contributed Namespaces", selection, namespaceViewer) { + @Override + protected void handleSelection(Object element) { + if (element instanceof ContributionAnalysis || element instanceof InstallableUnitAnalysis + || element instanceof IUPresentation) { + setTarget(element); + } + } + }); + + AnalyzerItemProviderAdapterFactory analyzerItemProviderAdapterFactory = new AnalyzerItemProviderAdapterFactory() { + @Override + public Adapter createContributionAnalysisAdapter() { + return new ContributionAnalysisItemProvider(this) { + private List children; + + @Override + public Collection getChildren(Object object) { + if (children == null) { + ContributionAnalysis contributionAnalysis = (ContributionAnalysis) object; + Set shortNamespaces = new LinkedHashSet<>(); + Set namespaces = new LinkedHashSet<>(); + Set longIDs = Set.of(SegmentSequence.create(".", "org.eclipse.emf")); + List ids = contributionAnalysis.getInstallableUnits().stream() + .map(iu -> getID(iu)).collect(Collectors.toList()); + for (SegmentSequence id : ids) { + int segmentCount = id.segmentCount(); + if (segmentCount >= 3) { + SegmentSequence prefix = getPrefix(id, 3); + if (namespaces.add(prefix) || longIDs.contains(prefix)) { + if (segmentCount > 3) { + if (longIDs.contains(prefix) && !ids.contains(prefix)) { + shortNamespaces.add(prefix); + namespaces.add(getPrefix(id, 4)); + } else { + String nextSegment = id.segment(3); + boolean hasCommonNextSegment = true; + for (SegmentSequence otherID : ids) { + int otherSegmentCount = otherID.segmentCount(); + if (otherSegmentCount >= 3) { + SegmentSequence otherPrefix = getPrefix(otherID, 3); + if (otherPrefix.equals(prefix)) { + if (otherSegmentCount == 3 + || !otherID.segment(3).equals(nextSegment)) { + hasCommonNextSegment = false; + break; + } + } + } + } + if (hasCommonNextSegment) { + shortNamespaces.add(prefix); + namespaces.add(getPrefix(id, 4)); + } + } + } + } + } else { + namespaces.add(id); + } + } + + namespaces.removeAll(shortNamespaces); + + children = namespaces.stream().map(namespace -> { + List children = contributionAnalysis.getInstallableUnits().stream() + .filter(iu -> { + int segmentCount = namespace.segmentCount(); + SegmentSequence id = getID(iu); + return id.segmentCount() >= segmentCount + && getPrefix(id, segmentCount).equals(namespace); + }).map(iu -> { + AdapterFactoryItemDelegator itemDelegator = getItemDelegator(); + class MyItemProvider extends ItemProvider implements IWrapperItemProvider { + public MyItemProvider() { + super(itemDelegator.getText(iu), itemDelegator.getImage(iu)); + } + + @Override + public Object getValue() { + return iu; + } + + @Override + public Object getOwner() { + return object; + } + + @Override + public EStructuralFeature getFeature() { + return null; + } + + @Override + public int getIndex() { + return 0; + } + + @Override + public void setIndex(int index) { + + } + } + return new MyItemProvider(); + }).collect(Collectors.toList()); + + return new ItemProvider(adapterFactory, namespace.toString(), + ExtendedImageRegistry.INSTANCE + .getImageDescriptor(AggregationAnalyzerEditorPlugin.INSTANCE + .getImage("full/obj16/namespace")), + contributionAnalysis, children); + }).collect(Collectors.toList()); + + Comparator comparator = CommonPlugin.INSTANCE.getComparator(); + + children.sort((i1, i2) -> comparator.compare(i1.getText(), i2.getText())); + + } + return children; + } + }; + } + + private SegmentSequence getPrefix(SegmentSequence id, int length) { + return SegmentSequence.create(".", id.subSegments(0, length)); + } + + private SegmentSequence getID(InstallableUnitAnalysis iu) { + return SegmentSequence.create(".", iu.getInstallableUnit().getId()); + } + }; + + ComposedAdapterFactory composedAdapterFactory = new ComposedAdapterFactory( + new AdapterFactory[] { analyzerItemProviderAdapterFactory, adapterFactory }); + namespaceViewer.setContentProvider(new AdapterFactoryContentProvider(composedAdapterFactory)); + namespaceViewer.setLabelProvider( + new AdapterFactoryLabelProvider.ColorProvider(composedAdapterFactory, namespaceViewer)); + + return namespaceViewer; + } + + private static class Link { + public static final Link NONE = new Link(null, null, null); + + private ContributionAnalysis source; + private ContributionAnalysis destination; + private Set dependencies; + + public Link(ContributionAnalysis source, ContributionAnalysis destination, + Set dependencies) { + this.source = source; + this.destination = destination; + this.dependencies = dependencies; + } + + public ContributionAnalysis getSource() { + return source; + } + + public ContributionAnalysis getDestination() { + return destination; + } + + public Set getDependencies() { + return dependencies; + } + } + + private GraphViewer createGraphViewer() { + // TreeNode root = (TreeNode) resource.getContents().get(0); + // EList children = root.getChildren(); + // Map contributions = children.stream() + // .collect(Collectors.toMap(it -> it.getData(), it -> it)); + + GraphViewer graphViewer = new GraphViewer(getContainer(), SWT.NONE); + Graph graph = graphViewer.getGraphControl(); + int pageIndex = addPage(graph); + + showInActionFactories.add(selection -> new ShowInAction("Dependencies", selection, graphViewer) { + @Override + protected void handleSelection(Object element) { + if (element instanceof ContributionAnalysis) { + setTarget(element); + } + } + }); + + List selection = new ArrayList<>(); + graphViewer.addPostSelectionChangedListener(it -> { + selection.clear(); + List list = it.getStructuredSelection().toList(); + selection.addAll(list); + graphViewer.refresh(true); + }); + + Map usageCounts = new HashMap<>(); + AtomicLong oldestLastModified = new AtomicLong(System.currentTimeMillis()); + + class MyContentProvider implements IGraphEntityRelationshipContentProvider { + + private Analysis analysis; + + final Map, Link> links = new HashMap<>(); + + @Override + public Object[] getElements(Object inputElement) { + Analysis analysis = (Analysis) EcoreUtil.getObjectByType(((Resource) inputElement).getContents(), + AnalyzerPackage.Literals.ANALYSIS); + if (analysis != null) { + EList contributions = analysis.getContributions(); + if (this.analysis != analysis) { + // Populate the usage counts. + this.analysis = analysis; + usageCounts.clear(); + for (ContributionAnalysis source : contributions) { + long lastModified = source.getLastModified(); + if (lastModified != Long.MIN_VALUE) { + oldestLastModified.set(Math.min(lastModified, oldestLastModified.get())); + } + + for (ContributionAnalysis destination : contributions) { + getRelationships(source, destination); + } + } + } + return contributions.toArray(); + } + return new Object[0]; + } + + @Override + public Object[] getRelationships(Object source, Object destination) { + return getRelationships((ContributionAnalysis) source, (ContributionAnalysis) destination); + } + + public Collection getSources(Object destination) { + Set result = links.entrySet().stream() + .filter(entry -> entry.getValue() != Link.NONE).map(Map.Entry::getKey).map(Map::entrySet) + .flatMap(Set::stream).filter(entry -> entry.getValue() == destination).map(Map.Entry::getKey) + .collect(Collectors.toSet()); + return result; + } + + public Collection getDestinations(Object source) { + Set result = links.entrySet().stream() + .filter(entry -> entry.getValue() != Link.NONE).map(Map.Entry::getKey).map(Map::entrySet) + .flatMap(Set::stream).filter(entry -> entry.getKey() == source).map(Map.Entry::getValue) + .collect(Collectors.toSet()); + return result; + } + + public Object[] getRelationships(ContributionAnalysis source, ContributionAnalysis destination) { + AtomicInteger usageCount = usageCounts.computeIfAbsent(destination, x -> new AtomicInteger()); + if (source != destination) { + Link link = links.computeIfAbsent(Collections.singletonMap(source, destination), it -> { + Set dependencies = source.getInstallableUnits().stream() + .map(InstallableUnitAnalysis::getRequirements)// + .flatMap(Collection::stream) + .filter(r -> r.getRequirement().getMin() > 0 || r.getRequirement().isGreedy())// + .map(r -> { + // If any resolution is a dominator, then return only that resolution. + List resolutions = r.getResolutions(); + for (RequirementResolution requirementResolution : resolutions) { + if (requirementResolution.getInstallableUnit().getContribution().isDominant()) { + return Collections.singleton(requirementResolution); + } + } + return resolutions; + }).flatMap(Collection::stream) + .filter(iu -> iu.getInstallableUnit().getContribution() == destination) + .collect(Collectors.toSet()); + if (!dependencies.isEmpty()) { + usageCount.incrementAndGet(); + return new Link(source, destination, dependencies); + } + + return Link.NONE; + }); + if (link != Link.NONE) { + return new Object[] { link }; + } + } + return new Object[0]; + } + } + + MyContentProvider contentProvider = new MyContentProvider(); + + graph.addMouseListener(MouseListener.mouseDoubleClickAdapter(it -> { + for (Object object : selection) { + if (object instanceof Link) { + Link link = (Link) object; + analysisViewer.setSelection(new StructuredSelection(link.getDependencies().toArray()), true); + setActivePage(analysisViewer); + return; + } + } + + Set moreSelection = new LinkedHashSet<>(); + boolean shift = (it.stateMask & SWT.SHIFT) != 0; + if (shift) { + Set collect = selection.stream().map(contentProvider::getSources).flatMap(Collection::stream) + .collect(Collectors.toSet()); + moreSelection.addAll(collect); + } else { + Set collect = selection.stream().map(contentProvider::getDestinations).flatMap(Collection::stream) + .collect(Collectors.toSet()); + moreSelection.addAll(collect); + } + + if (!moreSelection.isEmpty()) { + moreSelection.addAll(selection); + graphViewer.setSelection(new StructuredSelection(moreSelection.toArray()), true); + } + })); + + Font font = graph.getFont(); + + Color black = graph.getDisplay().getSystemColor(SWT.COLOR_BLACK); + Color green = graph.getDisplay().getSystemColor(SWT.COLOR_GREEN); + Color blue = graph.getDisplay().getSystemColor(SWT.COLOR_BLUE); + + long now = System.currentTimeMillis(); + + class MyLabelProvider extends AdapterFactoryLabelProvider.FontProvider + implements IConnectionStyleProvider, IEntityStyleProvider { + public MyLabelProvider(AdapterFactory adapterFactory) { + super(adapterFactory, font); + } + + @Override + public Image getImage(Object object) { + if (object instanceof Link) { + return null; + } + return super.getImage(object); + } + + @Override + public String getText(Object object) { + if (object instanceof Link) { + return null; + } + + String text = super.getText(object); + if (object instanceof ContributionAnalysis) { + ContributionAnalysis contributionAnalysis = (ContributionAnalysis) object; + Float ageInDays = AnalyzerUtil.getAgeInDays(contributionAnalysis); + Float gitRepositoryAgeInDays = AnalyzerUtil.getGitRepositoryAgeInDays(contributionAnalysis); + if (ageInDays != null) { + text += " [" + (int) (float) ageInDays + + (gitRepositoryAgeInDays == null ? "" : "/" + (int) (float) gitRepositoryAgeInDays) + + "]"; + } else if (gitRepositoryAgeInDays != null) { + text += " [-/" + (int) (float) gitRepositoryAgeInDays + "]"; + } + + Contribution contribution = contributionAnalysis.getContribution(); + if (contribution != null && !contribution.isEnabled()) { + return text + " - x"; + } + } + + return text + " - " + usageCounts.get(object); + } + + @Override + public int getConnectionStyle(Object rel) { + return ZestStyles.CONNECTIONS_DIRECTED; + } + + @Override + public Font getFont(Object element) { + Font font = super.getFont(element); + AtomicInteger usageCount = usageCounts.get(element); + if (usageCount != null) { + int count = usageCount.get(); + if (count == 0) { + return ExtendedFontRegistry.INSTANCE.getFont(defaultFont, URI.createURI("font:////italic")); + } + + return ExtendedFontRegistry.INSTANCE.getFont(defaultFont, + URI.createURI("font:///+" + count + "/normal")); + } + return font; + } + + @Override + public Color getColor(Object rel) { + if (rel instanceof Link) { + Link link = (Link) rel; + if (selection.contains(link.getSource())) { + return green; + } + if (selection.contains(link.getDestination())) { + return blue; + } + } + return null; + } + + @Override + public Color getHighlightColor(Object rel) { + if (selection.contains(rel)) { + return black; + } + return null; + } + + @Override + public int getLineWidth(Object rel) { + return 0; + } + + @Override + public IFigure getTooltip(Object entity) { + String toolTip = AnalyzerEditor.getToolTip(entity); + if (toolTip != null) { + Label label = new Label(toolTip.strip()); + label.setBorder(new MarginBorder(5)); + return label; + } + return null; + } + + @Override + public Color getNodeHighlightColor(Object entity) { + return null; + } + + @Override + public Color getBorderColor(Object entity) { + return getBackgroundColour(entity); + } + + @Override + public Color getBorderHighlightColor(Object entity) { + return null; + } + + @Override + public int getBorderWidth(Object entity) { + if (Boolean.TRUE) { + return 0; + } + AtomicInteger count = usageCounts.get(entity); + return count == null ? 0 : count.get(); + } + + @Override + public Color getBackgroundColour(Object entity) { + if (entity instanceof ContributionAnalysis) { + Contribution contribution = ((ContributionAnalysis) entity).getContribution(); + if (contribution != null && !contribution.isEnabled()) { + RGB rgb = graph.LIGHT_BLUE.getRGB(); + return ExtendedColorRegistry.INSTANCE.getColor(null, null, URI.createURI("color://rgb/" + // + (rgb.red + (255 - rgb.red) * 7 / 8) + "/" + // + (rgb.blue + (255 - rgb.blue) * 2 / 3) + "/" + // + (rgb.green + (255 - rgb.green) * 2 / 3))); + } + + } + return null; + } + + @Override + public Color getForegroundColour(Object entity) { + if (entity instanceof ContributionAnalysis) { + long lastModified = ((ContributionAnalysis) entity).getLastModified(); + if (lastModified != Long.MIN_VALUE) { + long oldest = Math.max(0, now - oldestLastModified.get()); + if (oldest != 0) { + long delta = oldest - Math.max(0, now - lastModified); + float brightness = 1.0f - ((float) delta) / oldest; + return ExtendedColorRegistry.INSTANCE.getColor(null, null, + URI.createURI("color://hsb/360/1.0/" + String.format("%.5f", brightness))); + } + } + return black; + } + + return null; + } + + @Override + public boolean fisheyeNode(Object entity) { + return false; + } + } + + MyLabelProvider labelProvider = new MyLabelProvider(adapterFactory); + graphViewer.setLabelProvider(labelProvider); + + graphViewer.setContentProvider(contentProvider); + + class MyLayout extends AbstractLayoutAlgorithm { + public MyLayout(int styles) { + super(styles); + } + + @Override + public void setLayoutArea(double x, double y, double width, double height) { + } + + @Override + protected boolean isValidConfiguration(boolean asynchronous, boolean continuous) { + return true; + } + + @Override + protected void applyLayoutInternal(InternalNode[] entitiesToLayout, + InternalRelationship[] relationshipsToConsider, double boundsX, double boundsY, double boundsWidth, + double boundsHeight) { + + Map> rows = new TreeMap<>(Comparator.reverseOrder()); + int[] ranges = contentProvider.analysis.getLevels().stream().mapToInt(Integer::intValue).toArray(); + + for (InternalNode node : entitiesToLayout) { + int usageCount = getUsageCount(node); + int groupCount = usageCount; + for (int range : ranges) { + if (usageCount > range) { + groupCount = range; + break; + } + } + + add(rows, groupCount, node); + } + + List> partitionedRows = new ArrayList<>(); + for (Collection> collection : List.of(rows.values(), + partitionedRows)) { + final double heightPadding = 30.0; + final double spacing = 10.0; + double rowHeight = 0.0; + double offset = 10.0; + double width = 0.0; + + for (Collection nodes : collection) { + List nodeList = new ArrayList<>(nodes); + nodeList.sort(new Comparator() { + Comparator comparator = CommonPlugin.INSTANCE.getComparator(); + + @Override + public int compare(InternalNode o1, InternalNode o2) { + int result = Integer.compare(getUsageCount(o2), getUsageCount(o1)); + if (result == 0) { + result = comparator.compare(labelProvider.getText(o1), labelProvider.getText(o2)); + } + return result; + } + }); + + double fullRowWidth = spacing; + for (InternalNode node : nodeList) { + double widthInLayout = node.getWidthInLayout(); + fullRowWidth += widthInLayout + spacing; + } + + double padding = Math.max(0, (boundsWidth - fullRowWidth) / (nodes.size() + 1)); + + offset += rowHeight + heightPadding; + rowHeight = 0.0; + double rowWidth = spacing + padding; + List nodesInCurrentRow = new ArrayList<>(); + partitionedRows.add(nodesInCurrentRow); + for (InternalNode node : nodeList) { + double heightInLayout = node.getHeightInLayout(); + rowHeight = Math.max(rowHeight, heightInLayout); + + double widthInLayout = node.getWidthInLayout(); + if (rowWidth + widthInLayout > boundsWidth) { + offset += rowHeight + heightPadding; + nodesInCurrentRow = new ArrayList<>(); + partitionedRows.add(nodesInCurrentRow); + rowWidth = spacing + padding; + } + nodesInCurrentRow.add(node); + + node.setInternalLocation(rowWidth, offset); + + rowWidth += widthInLayout + spacing + padding; + } + + width = Math.max(width, rowWidth); + } + + partitionedRows = new ArrayList<>(); + } + + updateLayoutLocations(entitiesToLayout); + } + + private int getUsageCount(InternalNode node) { + InternalNode layoutEntity = (InternalNode) node.getLayoutEntity(); + LayoutEntity graphData = layoutEntity.getLayoutEntity(); + GraphNode graphData2 = (GraphNode) graphData.getGraphData(); + Object data = graphData2.getData(); + int usageCount = usageCounts.get(data).get(); + return usageCount; + } + + @Override + protected void preLayoutAlgorithm(InternalNode[] entitiesToLayout, + InternalRelationship[] relationshipsToConsider, double x, double y, double width, double height) { + } + + @Override + protected void postLayoutAlgorithm(InternalNode[] entitiesToLayout, + InternalRelationship[] relationshipsToConsider) { + + } + + @Override + protected int getTotalNumberOfLayoutSteps() { + return 0; + } + + @Override + protected int getCurrentLayoutStep() { + return 0; + } + } + + graph.setLayoutAlgorithm(new CompositeLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING, + new LayoutAlgorithm[] { new MyLayout(LayoutStyles.NO_LAYOUT_NODE_RESIZING), }), true); + setPageText(pageIndex, "Dependencies"); + + MenuManager contextMenu = new MenuManager("#PopUp"); + contextMenu.add(new Separator("additions")); + contextMenu.setRemoveAllWhenShown(true); + contextMenu.addMenuListener(this); + Menu menu = contextMenu.createContextMenu(graphViewer.getControl()); + graphViewer.getControl().setMenu(menu); + + contextMenu.addMenuListener(manager -> { + Action action = new Action("Layout") { + @Override + public void run() { + graphViewer.applyLayout(); + } + }; + manager.insertAfter("additions", new Separator()); + manager.insertAfter("additions", action); + }); + + viewers.put(graphViewer.getControl(), graphViewer); + return graphViewer; + } + + /** + * This is the method used by the framework to install your own controls. + * + * + * @generated + */ + public void createPagesGen() { + // Creates the model from the editor input + // + createModel(); + + // Only creates the other pages if there is something that can be edited + // + if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { + // Create a page for the selection tree view. + // + Tree tree = new Tree(getContainer(), SWT.MULTI); + selectionViewer = new TreeViewer(tree); + setCurrentViewer(selectionViewer); + + selectionViewer.setUseHashlookup(true); + selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + selectionViewer.setLabelProvider(new DecoratingColumLabelProvider( + new AdapterFactoryLabelProvider.ColorProvider(adapterFactory, selectionViewer), + new DiagnosticDecorator(editingDomain, selectionViewer, + AggregationAnalyzerEditorPlugin.getPlugin().getDialogSettings()))); + selectionViewer.setInput(editingDomain.getResourceSet()); + selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), + true); + + new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); + new ColumnViewerInformationControlToolTipSupport(selectionViewer, + new DiagnosticDecorator.EditingDomainLocationListener(editingDomain, selectionViewer)); + + createContextMenuFor(selectionViewer); + int pageIndex = addPage(tree); + setPageText(pageIndex, getString("_UI_SelectionPage_label")); + + getSite().getShell().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + if (!getContainer().isDisposed()) { + setActivePage(0); + } + } + }); + } + + // Ensures that this editor will only display the page's tab + // area if there are more than one page + // + getContainer().addControlListener(new ControlAdapter() { + boolean guard = false; + + @Override + public void controlResized(ControlEvent event) { + if (!guard) { + guard = true; + hideTabs(); + guard = false; + } + } + }); + + getSite().getShell().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + updateProblemIndication(); + } + }); + } + + protected void hideTabs() { + } + + /** + * If there is just one page in the multi-page editor part, + * this hides the single tab at the bottom. + * + * + * @generated + */ + protected void hideTabsGen() { + if (getPageCount() <= 1) { + setPageText(0, ""); + if (getContainer() instanceof CTabFolder) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); + } + } + } + + /** + * If there is more than one page in the multi-page editor part, + * this shows the tabs at the bottom. + * + * + * @generated + */ + protected void showTabs() { + if (getPageCount() > 1) { + setPageText(0, getString("_UI_SelectionPage_label")); + if (getContainer() instanceof CTabFolder) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, clientArea.height + clientArea.y); + } + } + } + + /** + * This is used to track the active viewer. + * + * + * @generated + */ + @Override + protected void pageChange(int pageIndex) { + super.pageChange(pageIndex); + + if (contentOutlinePage != null) { + handleContentOutlineSelection(contentOutlinePage.getSelection()); + } + } + + /** + * This is how the framework determines which interfaces we implement. + * + * + * @generated + */ + @Override + public T getAdapter(Class key) { + if (key.equals(IContentOutlinePage.class)) { + return showOutlineView() ? key.cast(getContentOutlinePage()) : null; + } else if (key.equals(IPropertySheetPage.class)) { + return key.cast(getPropertySheetPage()); + } else if (key.equals(IGotoMarker.class)) { + return key.cast(this); + } else if (key.equals(IFindReplaceTarget.class)) { + return FindAndReplaceTarget.getAdapter(key, this, AggregationAnalyzerEditorPlugin.getPlugin()); + } else { + return super.getAdapter(key); + } + } + + /** + * This accesses a cached version of the content outliner. + * + * + * @generated + */ + public IContentOutlinePage getContentOutlinePage() { + if (contentOutlinePage == null) { + // The content outline is just a tree. + // + class MyContentOutlinePage extends ContentOutlinePage { + @Override + public void createControl(Composite parent) { + super.createControl(parent); + contentOutlineViewer = getTreeViewer(); + contentOutlineViewer.addSelectionChangedListener(this); + + // Set up the tree viewer. + // + contentOutlineViewer.setUseHashlookup(true); + contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + contentOutlineViewer.setLabelProvider(new DecoratingColumLabelProvider( + new AdapterFactoryLabelProvider.ColorProvider(adapterFactory, contentOutlineViewer), + new DiagnosticDecorator(editingDomain, contentOutlineViewer, + AggregationAnalyzerEditorPlugin.getPlugin().getDialogSettings()))); + contentOutlineViewer.setInput(editingDomain.getResourceSet()); + + new ColumnViewerInformationControlToolTipSupport(contentOutlineViewer, + new DiagnosticDecorator.EditingDomainLocationListener(editingDomain, contentOutlineViewer)); + + // Make sure our popups work. + // + createContextMenuFor(contentOutlineViewer); + + if (!editingDomain.getResourceSet().getResources().isEmpty()) { + // Select the root object in the view. + // + contentOutlineViewer.setSelection( + new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + } + } + + @Override + public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, + IStatusLineManager statusLineManager) { + super.makeContributions(menuManager, toolBarManager, statusLineManager); + contentOutlineStatusLineManager = statusLineManager; + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + } + + contentOutlinePage = new MyContentOutlinePage(); + + // Listen to selection so that we can handle it is a special way. + // + contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() { + // This ensures that we handle selections correctly. + // + @Override + public void selectionChanged(SelectionChangedEvent event) { + handleContentOutlineSelection(event.getSelection()); + } + }); + } + + return contentOutlinePage; + } + + /** + * This accesses a cached version of the property sheet. + * + * + * @generated + */ + public IPropertySheetPage getPropertySheetPage() { + PropertySheetPage propertySheetPage = new ExtendedPropertySheetPage(editingDomain, + ExtendedPropertySheetPage.Decoration.LIVE, + AggregationAnalyzerEditorPlugin.getPlugin().getDialogSettings(), 1, true) { + @Override + public void setSelectionToViewer(List selection) { + AnalyzerEditor.this.setSelectionToViewer(selection); + AnalyzerEditor.this.setFocus(); + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + propertySheetPages.add(propertySheetPage); + + return propertySheetPage; + } + + /** + * This deals with how we want selection in the outliner to affect the other views. + * + * + * @generated + */ + public void handleContentOutlineSelection(ISelection selection) { + if (selectionViewer != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { + Iterator selectedElements = ((IStructuredSelection) selection).iterator(); + if (selectedElements.hasNext()) { + // Get the first selected element. + // + Object selectedElement = selectedElements.next(); + + ArrayList selectionList = new ArrayList<>(); + selectionList.add(selectedElement); + while (selectedElements.hasNext()) { + selectionList.add(selectedElements.next()); + } + + // Set the selection to the widget. + // + selectionViewer.setSelection(new StructuredSelection(selectionList)); + } + } + } + + /** + * This is for implementing {@link IEditorPart} and simply tests the command stack. + * + * + * @generated + */ + @Override + public boolean isDirty() { + return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); + } + + /** + * This is for implementing {@link IRevertablePart}. + * + * + * @generated + */ + @Override + public void doRevert() { + DiagnosticDecorator.cancel(editingDomain); + + ResourceSet resourceSet = editingDomain.getResourceSet(); + List resources = resourceSet.getResources(); + List unloadedResources = new ArrayList<>(); + updateProblemIndication = false; + for (int i = 0; i < resources.size(); ++i) { + Resource resource = resources.get(i); + if (resource.isLoaded()) { + resource.unload(); + unloadedResources.add(resource); + } + } + + resourceToDiagnosticMap.clear(); + for (Resource resource : unloadedResources) { + try { + resource.load(resourceSet.getLoadOptions()); + } catch (IOException exception) { + if (!resourceToDiagnosticMap.containsKey(resource)) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + } + } + + editingDomain.getCommandStack().flush(); + + if (AdapterFactoryEditingDomain.isStale(editorSelection)) { + setSelection(StructuredSelection.EMPTY); + } + + updateProblemIndication = true; + updateProblemIndication(); + } + + @Override + public void doSave(IProgressMonitor progressMonitor) { + setReadOnly(true); + doSaveGen(progressMonitor); + } + + private void setReadOnly(boolean clean) { + ResourceSet resourceSet = editingDomain.getResourceSet(); + URIConverter uriConverter = resourceSet.getURIConverter(); + List resources = resourceSet.getResources(); + Map resourceToReadOnlyMap = editingDomain.getResourceToReadOnlyMap(); + for (int i = 1; i < resources.size(); ++i) { + Resource resource = resources.get(i); + if (clean && !uriConverter.exists(resource.getURI(), Map.of())) { + resource.unload(); + resources.remove(i--); + } else { + resourceToReadOnlyMap.put(resource, true); + } + } + } + + /** + * This is for implementing {@link IEditorPart} and simply saves the model file. + * + * + * @generated + */ + public void doSaveGen(IProgressMonitor progressMonitor) { + // Save only resources that have actually changed. + // + final Map saveOptions = new HashMap<>(); + saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); + saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); + + // Do the work within an operation because this is a long running activity that modifies the workbench. + // + WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { + // This is the method that gets invoked when the operation runs. + // + @Override + public void execute(IProgressMonitor monitor) { + // Save the resources to the file system. + // + boolean first = true; + List resources = editingDomain.getResourceSet().getResources(); + for (int i = 0; i < resources.size(); ++i) { + Resource resource = resources.get(i); + if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) + && !editingDomain.isReadOnly(resource)) { + try { + long timeStamp = resource.getTimeStamp(); + resource.save(saveOptions); + if (resource.getTimeStamp() != timeStamp) { + savedResources.add(resource); + } + } catch (Exception exception) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + first = false; + } + } + } + }; + + updateProblemIndication = false; + try { + // This runs the options, and shows progress. + // + new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); + + // Refresh the necessary state. + // + ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); + firePropertyChange(IEditorPart.PROP_DIRTY); + } catch (Exception exception) { + // Something went wrong that shouldn't. + // + AggregationAnalyzerEditorPlugin.INSTANCE.log(exception); + } + updateProblemIndication = true; + updateProblemIndication(); + } + + /** + * This returns whether something has been persisted to the URI of the specified resource. + * The implementation uses the URI converter from the editor's resource set to try to open an input stream. + * + * + * @generated + */ + protected boolean isPersisted(Resource resource) { + boolean result = false; + try { + InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); + if (stream != null) { + result = true; + stream.close(); + } + } catch (IOException e) { + // Ignore + } + return result; + } + + /** + * This always returns true because it is not currently supported. + * + * + * @generated + */ + @Override + public boolean isSaveAsAllowed() { + return true; + } + + /** + * This also changes the editor's input. + * + * + * @generated + */ + @Override + public void doSaveAs() { + SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); + saveAsDialog.open(); + IPath path = saveAsDialog.getResult(); + if (path != null) { + IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); + if (file != null) { + doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); + } + } + } + + /** + * + * + * @generated + */ + protected void doSaveAs(URI uri, IEditorInput editorInput) { + (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null + ? getActionBars().getStatusLineManager().getProgressMonitor() + : new NullProgressMonitor(); + doSave(progressMonitor); + } + + /** + * + * + * @generated + */ + @Override + public void gotoMarker(IMarker marker) { + List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); + if (!targetObjects.isEmpty()) { + setSelectionToViewer(targetObjects); + } + } + + /** + * This is called during startup. + * + * + * @generated + */ + @Override + public void init(IEditorSite site, IEditorInput editorInput) { + setSite(site); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + site.setSelectionProvider(this); + site.getPage().addPartListener(partListener); + ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, + IResourceChangeEvent.POST_CHANGE); + } + + /** + * + * + * @generated + */ + @Override + public void setFocus() { + getControl(getActivePage()).setFocus(); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + @Override + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + @Override + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * @generated + */ + @Override + public ISelection getSelection() { + return editorSelection; + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. + * Calling this result will notify the listeners. + * + * + * @generated + */ + @Override + public void setSelection(ISelection selection) { + editorSelection = selection; + + for (ISelectionChangedListener listener : selectionChangedListeners) { + listener.selectionChanged(new SelectionChangedEvent(this, selection)); + } + setStatusLineManager(selection); + } + + /** + * + * + * @generated + */ + public void setStatusLineManager(ISelection selection) { + IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer + ? contentOutlineStatusLineManager + : getActionBars().getStatusLineManager(); + + if (statusLineManager != null) { + if (selection instanceof IStructuredSelection) { + Collection collection = ((IStructuredSelection) selection).toList(); + switch (collection.size()) { + case 0: { + statusLineManager.setMessage(getString("_UI_NoObjectSelected")); + break; + } + case 1: { + String text = new AdapterFactoryItemDelegator(adapterFactory) + .getText(collection.iterator().next()); + statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); + break; + } + default: { + statusLineManager + .setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); + break; + } + } + } else { + statusLineManager.setMessage(""); + } + } + } + + /** + * This looks up a string in the plugin's plugin.properties file. + * + * + * @generated + */ + private static String getString(String key) { + return AggregationAnalyzerEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return AggregationAnalyzerEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); + } + + /** + * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. + * + * + * @generated + */ + public void menuAboutToShowGen(IMenuManager menuManager) { + ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); + } + + @Override + public void menuAboutToShow(IMenuManager menuManager) { + menuAboutToShowGen(menuManager); + if (currentViewer instanceof StructuredViewer) { + createShowInActions((StructuredViewer) currentViewer, menuManager); + } + } + + protected void createShowInActions(StructuredViewer viewer, IMenuManager manager) { + IStructuredSelection selection = viewer.getStructuredSelection(); + MenuManager showInMenu = new MenuManager("Show In"); + manager.insertAfter("edit", new Separator("show-in")); + manager.insertAfter("edit", showInMenu); + for (Function factory : showInActionFactories) { + final ShowInAction action = factory.apply(selection); + if (action.getViewer() != currentViewer) { + showInMenu.add(action); + } + } + } + + /** + * + * + * @generated + */ + public EditingDomainActionBarContributor getActionBarContributor() { + return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); + } + + /** + * + * + * @generated + */ + public IActionBars getActionBars() { + return getActionBarContributor().getActionBars(); + } + + /** + * + * + * @generated + */ + public AdapterFactory getAdapterFactory() { + return adapterFactory; + } + + /** + * + * + * @generated + */ + @Override + public void dispose() { + updateProblemIndication = false; + + ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); + + getSite().getPage().removePartListener(partListener); + + adapterFactory.dispose(); + + if (getActionBarContributor().getActiveEditor() == this) { + getActionBarContributor().setActiveEditor(null); + } + + for (PropertySheetPage propertySheetPage : propertySheetPages) { + propertySheetPage.dispose(); + } + + if (contentOutlinePage != null) { + contentOutlinePage.dispose(); + } + + super.dispose(); + } + + /** + * Returns whether the outline view should be presented to the user. + * + * + * @generated + */ + protected boolean showOutlineView() { + return false; + } + + @SuppressWarnings("unused") + private void breakpoint() { + // In some lambdas one cannot set a breakpoint so call this method and set the breakpoint here. + System.err.println("###"); + } + + public static Set getSet(Map> map, K key) { + Set set = map.get(key); + if (set == null) { + set = new LinkedHashSet<>(); + map.put(key, set); + } + + return set; + } + + public static boolean add(Map> map, K key, V value) { + Set set = getSet(map, key); + return set.add(value); + } + + static void setExpandedSelection(TreeViewer treeViewer, IStructuredSelection selection) { + Tree tree = treeViewer.getTree(); + tree.setRedraw(false); + Object[] elements = selection.toArray(); + Object[] expandedElements = treeViewer.getExpandedElements(); + List allExpandedElements = new ArrayList<>(); + allExpandedElements.addAll(Arrays.asList(elements)); + allExpandedElements.addAll(Arrays.asList(expandedElements)); + treeViewer.setExpandedElements(allExpandedElements.toArray()); + ITreeContentProvider provider = (ITreeContentProvider) treeViewer.getContentProvider(); + for (Object element : elements) { + Object[] children = provider.getChildren(element); + if (children.length != 0) { + treeViewer.setSelection(new StructuredSelection(children[children.length - 1]), true); + } + } + treeViewer.setSelection(selection, true); + tree.setRedraw(true); + } + + static String getToolTip(Object object) { + if (object instanceof ContributionAnalysis) { + EList projects = ((ContributionAnalysis) object).getProjects(); + if (!projects.isEmpty()) { + StringBuilder builder = new StringBuilder(); + for (Project project : projects) { + new Object() { + void visit(String indent, Project project) { + builder.append(indent); + builder.append(project.getName()); + URI version = project.getVersion(); + if (version != null) { + String lastSegment = version.lastSegment(); + if (lastSegment != null) { + builder.append(" - ").append(lastSegment); + } + } + Date releaseDate = project.getReleaseDate(); + if (releaseDate != null) { + builder.append(" ~ ").append(AnalyzerUtil.format(releaseDate)); + } + builder.append('\n'); + + for (GitRepository gitRepository : project.getRepositories()) { + builder.append(indent).append(" ").append(gitRepository.getURI()); + Float ageInDays = AnalyzerUtil.getAgeInDays(gitRepository); + if (ageInDays != null) { + builder.append(" - " + (int) (float) ageInDays); + } + builder.append('\n'); + } + + for (Project subproject : project.getSubprojects()) { + visit(indent + " ", subproject); + } + } + }.visit("", project); + } + return builder.toString(); + } + } + return null; + } + + @SuppressWarnings("unused") + private class MyDialog extends Dialog { + private TreeViewer viewer; + + protected MyDialog(Shell parentShell) { + super(parentShell); + setBlockOnOpen(false); + setShellStyle(SWT.SHELL_TRIM | SWT.MODELESS); + } + + @Override + protected void configureShell(Shell newShell) { + super.configureShell(newShell); + newShell.setText("Strict Requirements"); + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + } + + protected void setInput(InstallableUnitAnalysis element) { + viewer.setInput(new ItemProvider( + Collections.singleton(AnalyzeHandler.Analyzer.computeStrictlyRequiredBy(element)))); + } + + @Override + protected Control createDialogArea(Composite parent) { + Composite composite = (Composite) super.createDialogArea(parent); + + Tree tree = new Tree(composite, SWT.MULTI); + viewer = new TreeViewer(tree); + + viewer.setAutoExpandLevel(2); + viewer.setUseHashlookup(true); + viewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + viewer.setLabelProvider(new AdapterFactoryLabelProvider.ColorProvider(adapterFactory, viewer)); + + composite.setLayout(new FillLayout()); + + return composite; + } + } + + protected abstract class ShowInAction extends Action { + private final StructuredViewer viewer; + private Object target; + + public ShowInAction(String text, IStructuredSelection selection, StructuredViewer viewer) { + super(text); + this.viewer = viewer; + handleSelection(selection); + } + + @Override + public boolean isEnabled() { + return target != null; + } + + @Override + public void run() { + analyzeIfNeeded(); + IContentProvider contentProvider = viewer.getContentProvider(); + if (contentProvider instanceof IStructuredContentProvider) { + IStructuredContentProvider structuredContentProvider = (IStructuredContentProvider) contentProvider; + Object input = viewer.getInput(); + List paths = new ArrayList<>(); + for (Object object : structuredContentProvider.getElements(input)) { + TreePath path = new TreePath(new Object[] { object }); + if (matches(object)) { + setSelection(new StructuredSelection(object)); + return; + } + paths.add(path); + } + + if (contentProvider instanceof ITreeContentProvider) { + ITreeContentProvider treeContentProvider = (ITreeContentProvider) contentProvider; + find(treeContentProvider, paths); + } + } + } + + protected boolean find(ITreeContentProvider treeContentProvider, List paths) { + List nestedPaths = new ArrayList<>(); + for (TreePath treePath : paths) { + Object[] children = treeContentProvider.getChildren(treePath.getLastSegment()); + for (Object child : children) { + TreePath childPath = treePath.createChildPath(child); + if (matches(child)) { + setSelection(new TreeSelection(childPath)); + return true; + } + nestedPaths.add(childPath); + } + } + + if (!nestedPaths.isEmpty()) { + return find(treeContentProvider, nestedPaths); + } + + return false; + } + + protected void setSelection(IStructuredSelection selection) { + if (viewer instanceof TreeViewer) { + setExpandedSelection((TreeViewer) viewer, selection); + } else { + viewer.setSelection(selection); + } + + setActivePage(viewer); + } + + protected boolean matches(Object object) { + if (object instanceof TreeNode) { + return matches(((TreeNode) object).getData()); + } else if (object instanceof IWrapperItemProvider) { + return matches(((IWrapperItemProvider) object).getValue()); + } else if (object instanceof ContributionAnalysis) { + if (target instanceof ContributionAnalysis) { + return Objects.equals(((ContributionAnalysis) object).getLabel(), + ((ContributionAnalysis) target).getLabel()); + } + } else if (object instanceof ProvidedCapabilityWrapper) { + return ((ProvidedCapabilityWrapper) object).getGenuine() == target; + } else if (object instanceof RequirementWrapper) { + return ((RequirementWrapper) object).getGenuine() == target; + } else if (object instanceof IUPresentation) { + return ((IUPresentation) object).getInstallableUnit() == target; + } else if (object instanceof InstallableUnitAnalysis) { + IInstallableUnit installableUnit = ((InstallableUnitAnalysis) object).getInstallableUnit(); + if (target instanceof IInstallableUnit) { + return installableUnit == target; + } else if (target instanceof InstallableUnitAnalysis) { + return installableUnit == ((InstallableUnitAnalysis) target).getInstallableUnit(); + } else if (target instanceof IUPresentation) { + return ((IUPresentation) target).getInstallableUnit() == installableUnit; + } + } else if (object instanceof RequirementAnalysis) { + if (target instanceof IRequirement) { + return ((RequirementAnalysis) object).getRequirement() == target; + } else if (target instanceof RequirementAnalysis) { + return ((RequirementAnalysis) object).getRequirement() == ((RequirementAnalysis) target) + .getRequirement(); + } + } else if (object instanceof CapabilityAnalysis) { + if (target instanceof IProvidedCapability) { + return ((CapabilityAnalysis) object).getCapability() == target; + } else if (target instanceof CapabilityAnalysis) { + return ((CapabilityAnalysis) object).getCapability() == ((CapabilityAnalysis) target) + .getCapability(); + } + } else if (object instanceof CapabilityResolution) { + if (target instanceof CapabilityResolution) { + return ((CapabilityResolution) object).getRequirement() + .getRequirement() == ((CapabilityResolution) target).getRequirement().getRequirement(); + } + } + + return Objects.equals(target, object); + } + + protected void setTarget(Object target) { + this.target = target; + } + + protected void handleSelection(IStructuredSelection selection) { + if (selection.size() == 1) { + Object element = selection.getFirstElement(); + if (element instanceof TreeNode) { + handleSelection(((TreeNode) element).getData()); + } else if (element instanceof IWrapperItemProvider) { + handleSelection(((IWrapperItemProvider) element).getValue()); + } else { + handleSelection(element); + } + } + } + + abstract void handleSelection(Object element); + + protected void analyzeIfNeeded() { + Analyzer analyzer2 = analyzer.getAndSet(null); + if (analyzer2 != null && analyzer2.getBuildModelLocation() != null) { + analyzer2.perform(analysisViewer.getControl().getShell()); + } + } + + public StructuredViewer getViewer() { + return viewer; + } + } +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerModelWizard.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerModelWizard.java new file mode 100644 index 000000000..831ff7e6d --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/AnalyzerModelWizard.java @@ -0,0 +1,617 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.MissingResourceException; +import java.util.StringTokenizer; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.provider.AggregationAnalyzerEditPlugin; +import org.eclipse.core.resources.IContainer; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IFolder; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.Path; +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.ModifyEvent; +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.actions.WorkspaceModifyOperation; +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + +/** + * This is a simple wizard for creating a new model file. + * + * + * @generated + */ +public class AnalyzerModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = Collections + .unmodifiableList(Arrays.asList(AggregationAnalyzerEditorPlugin.INSTANCE + .getString("_UI_AnalyzerEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = AggregationAnalyzerEditorPlugin.INSTANCE + .getString("_UI_AnalyzerEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected AnalyzerPackage analyzerPackage = AnalyzerPackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected AnalyzerFactory analyzerFactory = analyzerPackage.getAnalyzerFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected AnalyzerModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected AnalyzerModelWizardInitialObjectCreationPage initialObjectCreationPage; + + /** + * Remember the selection during initialization for populating the default container. + * + * + * @generated + */ + protected IStructuredSelection selection; + + /** + * Remember the workbench during initialization. + * + * + * @generated + */ + protected IWorkbench workbench; + + /** + * Caches the names of the types that can be created as the root object. + * + * + * @generated + */ + protected List initialObjectNames; + + /** + * This just records the information. + * + * + * @generated + */ + @Override + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE + .getImageDescriptor(AggregationAnalyzerEditorPlugin.INSTANCE.getImage("full/wizban/NewAnalyzer"))); + } + + /** + * Returns the names of the types that can be created as the root object. + * + * + * @generated + */ + protected Collection getInitialObjectNames() { + if (initialObjectNames == null) { + initialObjectNames = new ArrayList<>(); + for (EClassifier eClassifier : analyzerPackage.getEClassifiers()) { + if (eClassifier instanceof EClass) { + EClass eClass = (EClass) eClassifier; + if (!eClass.isAbstract()) { + initialObjectNames.add(eClass.getName()); + } + } + } + Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator()); + } + return initialObjectNames; + } + + /** + * Create a new model. + * + * + * @generated + */ + protected EObject createInitialModel() { + EClass eClass = (EClass) analyzerPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = analyzerFactory.create(eClass); + return rootObject; + } + + /** + * Do the work after everything is specified. + * + * + * @generated + */ + @Override + public boolean performFinish() { + try { + // Remember the file. + // + final IFile modelFile = getModelFile(); + + // Do the work within an operation. + // + WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { + @Override + protected void execute(IProgressMonitor progressMonitor) { + try { + // Create a resource set + // + ResourceSet resourceSet = new ResourceSetImpl(); + + // Get the URI of the model file. + // + URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true); + + // Create a resource for this file. + // + Resource resource = resourceSet.createResource(fileURI); + + // Add the initial model object to the contents. + // + EObject rootObject = createInitialModel(); + if (rootObject != null) { + resource.getContents().add(rootObject); + } + + // Save the contents of the resource to the file system. + // + Map options = new HashMap<>(); + options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); + resource.save(options); + } catch (Exception exception) { + AggregationAnalyzerEditorPlugin.INSTANCE.log(exception); + } finally { + progressMonitor.done(); + } + } + }; + + getContainer().run(false, false, operation); + + // Select the new file resource in the current view. + // + IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow(); + IWorkbenchPage page = workbenchWindow.getActivePage(); + final IWorkbenchPart activePart = page.getActivePart(); + if (activePart instanceof ISetSelectionTarget) { + final ISelection targetSelection = new StructuredSelection(modelFile); + getShell().getDisplay().asyncExec(new Runnable() { + @Override + public void run() { + ((ISetSelectionTarget) activePart).selectReveal(targetSelection); + } + }); + } + + // Open an editor on the new file. + // + try { + page.openEditor(new FileEditorInput(modelFile), + workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId()); + } catch (PartInitException exception) { + MessageDialog.openError(workbenchWindow.getShell(), + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), + exception.getMessage()); + return false; + } + + return true; + } catch (Exception exception) { + AggregationAnalyzerEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class AnalyzerModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public AnalyzerModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { + super(pageId, selection); + } + + /** + * The framework calls this to see if the file is correct. + * + * + * @generated + */ + @Override + protected boolean validatePage() { + if (super.validatePage()) { + String extension = new Path(getFileName()).getFileExtension(); + if (extension == null || !FILE_EXTENSIONS.contains(extension)) { + String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension"; + setErrorMessage(AggregationAnalyzerEditorPlugin.INSTANCE.getString(key, + new Object[] { FORMATTED_FILE_EXTENSIONS })); + return false; + } + return true; + } + return false; + } + + /** + * + * + * @generated + */ + public IFile getModelFile() { + return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName())); + } + } + + /** + * This is the page where the type of object to create is selected. + * + * + * @generated + */ + public class AnalyzerModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public AnalyzerModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * @generated + */ + @Override + public void createControl(Composite parent) { + Composite composite = new Composite(parent, SWT.NONE); + { + GridLayout layout = new GridLayout(); + layout.numColumns = 1; + layout.verticalSpacing = 12; + composite.setLayout(layout); + + GridData data = new GridData(); + data.verticalAlignment = GridData.FILL; + data.grabExcessVerticalSpace = true; + data.horizontalAlignment = GridData.FILL; + composite.setLayoutData(data); + } + + Label containerLabel = new Label(composite, SWT.LEFT); + { + containerLabel.setText(AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_ModelObject")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + containerLabel.setLayoutData(data); + } + + initialObjectField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + initialObjectField.setLayoutData(data); + } + + for (String objectName : getInitialObjectNames()) { + initialObjectField.add(getLabel(objectName)); + } + + if (initialObjectField.getItemCount() == 1) { + initialObjectField.select(0); + } + initialObjectField.addModifyListener(validator); + + Label encodingLabel = new Label(composite, SWT.LEFT); + { + encodingLabel.setText(AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); + + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + encodingLabel.setLayoutData(data); + } + encodingField = new Combo(composite, SWT.BORDER); + { + GridData data = new GridData(); + data.horizontalAlignment = GridData.FILL; + data.grabExcessHorizontalSpace = true; + encodingField.setLayoutData(data); + } + + for (String encoding : getEncodings()) { + encodingField.add(encoding); + } + + encodingField.select(0); + encodingField.addModifyListener(validator); + + setPageComplete(validatePage()); + setControl(composite); + } + + /** + * + * + * @generated + */ + protected ModifyListener validator = new ModifyListener() { + @Override + public void modifyText(ModifyEvent e) { + setPageComplete(validatePage()); + } + }; + + /** + * + * + * @generated + */ + protected boolean validatePage() { + return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); + } + + /** + * + * + * @generated + */ + @Override + public void setVisible(boolean visible) { + super.setVisible(visible); + if (visible) { + if (initialObjectField.getItemCount() == 1) { + initialObjectField.clearSelection(); + encodingField.setFocus(); + } else { + encodingField.clearSelection(); + initialObjectField.setFocus(); + } + } + } + + /** + * + * + * @generated + */ + public String getInitialObjectName() { + String label = initialObjectField.getText(); + + for (String name : getInitialObjectNames()) { + if (getLabel(name).equals(label)) { + return name; + } + } + return null; + } + + /** + * + * + * @generated + */ + public String getEncoding() { + return encodingField.getText(); + } + + /** + * Returns the label for the specified type name. + * + * + * @generated + */ + protected String getLabel(String typeName) { + try { + return AggregationAnalyzerEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } catch (MissingResourceException mre) { + AggregationAnalyzerEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList<>(); + for (StringTokenizer stringTokenizer = new StringTokenizer( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer + .hasMoreTokens();) { + encodings.add(stringTokenizer.nextToken()); + } + } + return encodings; + } + } + + /** + * The framework calls this to create the contents of the wizard. + * + * + * @generated + */ + @Override + public void addPages() { + // Create a page, set the title, and the initial model file name. + // + newFileCreationPage = new AnalyzerModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage + .setTitle(AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_AnalyzerModelWizard_label")); + newFileCreationPage.setDescription( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_AnalyzerModelWizard_description")); + newFileCreationPage + .setFileName(AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_AnalyzerEditorFilenameDefaultBase") + + "." + FILE_EXTENSIONS.get(0)); + addPage(newFileCreationPage); + + // Try and get the resource selection to determine a current directory for the file dialog. + // + if (selection != null && !selection.isEmpty()) { + // Get the resource... + // + Object selectedElement = selection.iterator().next(); + if (selectedElement instanceof IResource) { + // Get the resource parent, if its a file. + // + IResource selectedResource = (IResource) selectedElement; + if (selectedResource.getType() == IResource.FILE) { + selectedResource = selectedResource.getParent(); + } + + // This gives us a directory... + // + if (selectedResource instanceof IFolder || selectedResource instanceof IProject) { + // Set this for the container. + // + newFileCreationPage.setContainerFullPath(selectedResource.getFullPath()); + + // Make up a unique new name here. + // + String defaultModelBaseFilename = AggregationAnalyzerEditorPlugin.INSTANCE + .getString("_UI_AnalyzerEditorFilenameDefaultBase"); + String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0); + String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension; + for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) { + modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension; + } + newFileCreationPage.setFileName(modelFilename); + } + } + } + initialObjectCreationPage = new AnalyzerModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage + .setTitle(AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_AnalyzerModelWizard_label")); + initialObjectCreationPage.setDescription( + AggregationAnalyzerEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); + addPage(initialObjectCreationPage); + } + + /** + * Get the file from the page. + * + * + * @generated + */ + public IFile getModelFile() { + return newFileCreationPage.getModelFile(); + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/BreadCrumbSupport.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/BreadCrumbSupport.java new file mode 100644 index 000000000..a7496aac5 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/BreadCrumbSupport.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2022 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation; + +import java.lang.reflect.Method; +import java.util.function.BiConsumer; + +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Widget; + +public final class BreadCrumbSupport { + private BreadCrumbSupport() { + throw new RuntimeException("Cannot instantiate"); + } + + public static StructuredViewer createBreadCrumbViewer(Composite parent, int style, + BiConsumer dropDownViewerConfigurator) { + return new BreadcrumbViewer(parent, style, dropDownViewerConfigurator); + } + + @SuppressWarnings("restriction") + private static final class BreadcrumbViewer + extends org.eclipse.jdt.internal.ui.javaeditor.breadcrumb.BreadcrumbViewer { + final private BiConsumer dropDownViewerConfigurator; + + public BreadcrumbViewer(Composite parent, int style, + BiConsumer dropDownViewerConfigurator) { + super(parent, style); + this.dropDownViewerConfigurator = dropDownViewerConfigurator; + + addDoubleClickListener(event -> { + Object element = ((IStructuredSelection) event.getSelection()).getFirstElement(); + Widget item = findItem(((ITreeContentProvider) getContentProvider()).getParent(element)); + if (item != null) { + try { + Method openDropDownMenuMethod = item.getClass().getDeclaredMethod("openDropDownMenu"); + openDropDownMenuMethod.setAccessible(true); + openDropDownMenuMethod.invoke(item); + } catch (Exception ex) { + // Ignore. + } + } + }); + } + + @Override + protected void configureDropDownViewer(TreeViewer viewer, Object input) { + dropDownViewerConfigurator.accept(viewer, input); + } + } +} \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/AnalyzeHandler.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/AnalyzeHandler.java new file mode 100644 index 000000000..44edb2818 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/AnalyzeHandler.java @@ -0,0 +1,614 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.handlers; + +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.function.Function; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import org.eclipse.cbi.p2repo.aggregator.Aggregation; +import org.eclipse.cbi.p2repo.aggregator.Contribution; +import org.eclipse.cbi.p2repo.aggregator.MappedRepository; +import org.eclipse.cbi.p2repo.aggregator.MappedUnit; +import org.eclipse.cbi.p2repo.aggregator.ValidationSet; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution; +import org.eclipse.cbi.p2repo.aggregator.engine.Builder; +import org.eclipse.cbi.p2repo.aggregator.engine.Builder.ActionType; +import org.eclipse.cbi.p2repo.aggregator.p2.util.MetadataRepositoryResourceFactoryImpl; +import org.eclipse.cbi.p2repo.aggregator.p2view.util.MetadataRepositoryStructuredViewBuilder; +import org.eclipse.cbi.p2repo.p2.InstallableUnit; +import org.eclipse.cbi.p2repo.p2.MetadataRepository; +import org.eclipse.cbi.p2repo.p2.P2Factory; +import org.eclipse.cbi.p2repo.p2.impl.MetadataRepositoryImpl; +import org.eclipse.cbi.p2repo.p2.util.P2Bridge; +import org.eclipse.cbi.p2repo.p2.util.P2ResourceFactoryImpl; +import org.eclipse.cbi.p2repo.p2.util.P2Utils; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability; +import org.eclipse.equinox.internal.p2.metadata.RequiredPropertiesMatch; +import org.eclipse.equinox.internal.p2.metadata.ResolvedInstallableUnit; +import org.eclipse.equinox.internal.p2.metadata.TranslationSupport; +import org.eclipse.equinox.internal.p2.metadata.index.CapabilityIndex; +import org.eclipse.equinox.internal.p2.metadata.index.IdIndex; +import org.eclipse.equinox.internal.p2.metadata.index.IndexProvider; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.IProvidedCapability; +import org.eclipse.equinox.p2.metadata.IRequirement; +import org.eclipse.equinox.p2.metadata.KeyWithLocale; +import org.eclipse.equinox.p2.metadata.Version; +import org.eclipse.equinox.p2.metadata.VersionRange; +import org.eclipse.equinox.p2.metadata.expression.IFilterExpression; +import org.eclipse.equinox.p2.metadata.expression.IMatchExpression; +import org.eclipse.equinox.p2.metadata.index.IIndex; +import org.eclipse.equinox.p2.query.IQuery; +import org.eclipse.equinox.p2.query.IQueryResult; +import org.eclipse.equinox.p2.query.IQueryable; +import org.eclipse.equinox.p2.query.QueryUtil; + +public class AnalyzeHandler extends BaseHandler { + + public static final URI ANALYSIS_RESULT = URI.createURI("readonly://result.aggran"); + + public static final URI DUPLICATE_ANALYSIS_RESULT = URI.createURI("readonly://duplicate.result.aggran"); + + public static final URI STRICT_REQUIREMENT_ANALYSIS_RESULT = URI + .createURI("readonly://strict.requirement.result.aggran"); + + public static String AGGREGATE_REPOSITORY_LOCATION = "readonly://aggregation.result.p2"; + + public static final URI AGGREGATE_REPOSITORY = (URI.createURI("p2aggr:p2:" + AGGREGATE_REPOSITORY_LOCATION)); + + public static String STRUCTURED_AGGREGATE_REPOSITORY_LOCATION = "readonly://aggregation.structured.result.p2"; + + public static final URI STRUCTURED_AGGREGATE_REPOSITORY = (URI + .createURI("p2aggr:p2:" + STRUCTURED_AGGREGATE_REPOSITORY_LOCATION)); + + public static final Comparator INSTALLABLE_UNIT_ANALYIS_COMPARATOR = new Comparator() { + public int compare(InstallableUnitAnalysis o1, InstallableUnitAnalysis o2) { + return o1.getInstallableUnit().compareTo(o2.getInstallableUnit()); + } + }; + + @Override + protected Activity createActivity(Analysis analysis) { + return new Analyzer(analysis); + } + + public static class Analyzer extends Activity { + private Analysis originalAnalysis; + private Analysis result; + private ExecutorService executor; + private Resource aggregateMetadataRepositoryResource; + private Resource structuredAggregateMetadataRepositoryResource; + private Builder builder; + private List duplicates; + private List strictRequirements; + + public Analyzer(Analysis analysis) { + this.originalAnalysis = analysis; + } + + @Override + public boolean isEnabled() { + return getBuildModelLocation() != null; + } + + public Analysis getOriginalAnalysis() { + return originalAnalysis; + } + + public URI getBuildModelLocation() { + Aggregation aggregation = originalAnalysis.getAggregation(); + URI uri = EcoreUtil.getURI((EObject) aggregation).trimFragment(); + URI resolvedURI = CommonPlugin.resolve(uri); + if (resolvedURI.isFile()) { + return resolvedURI; + } + return null; + } + + private Builder getBuilder(IProgressMonitor monitor) throws Exception { + if (builder == null) { + URI resolvedURI = getBuildModelLocation(); + if (resolvedURI != null) { + builder = new Builder(); + builder.setAction(ActionType.VALIDATE); + builder.setBuildModelLocation(new File(resolvedURI.toFileString())); + builder.setProvisioningAgent(P2Utils.getDefaultProvisioningAgent()); + builder.run(false, monitor); + } + } + return builder; + } + + @Override + protected void perform(IProgressMonitor monitor) throws Exception { + result = analyze(monitor); + duplicates = analyzeDuplicates(result); + strictRequirements = analyzeStrictRequirements(result); + } + + @Override + protected void asyncExec() { + Resource resource = ((EObject) getOriginalAnalysis()).eResource(); + if (resource != null) { + ResourceSet resourceSet = resource.getResourceSet(); + EList resources = resourceSet.getResources(); + + XMLResource resultResource = (XMLResource) resourceSet.getResourceFactoryRegistry() + .getFactory(ANALYSIS_RESULT).createResource(ANALYSIS_RESULT); + resultResource.getContents().add(result); + resources.add(resultResource); + + resources.add(aggregateMetadataRepositoryResource); + resources.add(structuredAggregateMetadataRepositoryResource); + + Resource duplicateResultResource = resourceSet.getResourceFactoryRegistry() + .getFactory(DUPLICATE_ANALYSIS_RESULT).createResource(DUPLICATE_ANALYSIS_RESULT); + duplicateResultResource.getContents().addAll(duplicates); + resources.add(duplicateResultResource); + + Resource strictRequirementsResultResource = resourceSet.getResourceFactoryRegistry() + .getFactory(STRICT_REQUIREMENT_ANALYSIS_RESULT) + .createResource(STRICT_REQUIREMENT_ANALYSIS_RESULT); + strictRequirementsResultResource.getContents().addAll(strictRequirements); + resources.add(strictRequirementsResultResource); + } + } + + private List analyzeDuplicates(Analysis analysis) { + Map> ius = new TreeMap<>(); + analysis.getContributions().stream().flatMap(c -> c.getInstallableUnits().stream()).forEach(iu -> { + IInstallableUnit installableUnit = iu.getInstallableUnit(); + String id = installableUnit.getId(); + installableUnit.getVersion(); + ius.computeIfAbsent(id, i -> new ArrayList<>()).add(iu); + }); + + ius.entrySet().removeIf(e -> e.getValue().size() == 1); + + Comparator compareVersion = new Comparator() { + @Override + public int compare(InstallableUnitAnalysis o1, InstallableUnitAnalysis o2) { + return o1.getInstallableUnit().getVersion().compareTo(o2.getInstallableUnit().getVersion()); + } + }; + ius.values().forEach(l -> l.sort(compareVersion)); + + return ius.values().stream().flatMap(list -> list.stream()).map(i -> computeStrictlyRequiredBy(i)) + .collect(Collectors.toList()); + } + + private List analyzeStrictRequirements(Analysis analysis) { + List result = analysis.getContributions().stream() + .flatMap(c -> c.getInstallableUnits().stream()).map(i -> computeStrictlyRequiredBy(i)) + .collect(Collectors.toList()); + result.sort(INSTALLABLE_UNIT_ANALYIS_COMPARATOR); + return result; + } + + public static InstallableUnitAnalysis computeStrictlyRequiredBy(InstallableUnitAnalysis element) { + InstallableUnitAnalysis copy = EcoreUtil.copy(element); + copy.getRequirements().clear(); + for (CapabilityAnalysis capabilityAnalysis : copy.getCapabilities()) { + EList resolutions = capabilityAnalysis.getResolutions(); + List toRemove = new ArrayList<>(); + for (CapabilityResolution capabilityResolution : resolutions) { + RequirementAnalysis requirement = capabilityResolution.getRequirement(); + EList resolutions2 = requirement.getResolutions(); + for (RequirementResolution requirementResolution : resolutions2) { + if (requirementResolution.getInstallableUnit() != element) { + toRemove.add(capabilityResolution); + break; + } + } + } + + resolutions.removeAll(toRemove); + } + + copy.getCapabilities().removeIf(c -> c.getResolutions().isEmpty()); + return copy; + } + + public Analysis analyze(IProgressMonitor monitor) throws Exception { + SubMonitor subMonitor = SubMonitor.convert(monitor, 100); + Builder builder = getBuilder(subMonitor.newChild(90)); + try { + if (builder != null) { + subMonitor.setTaskName("Analyzing Aggregation"); + Aggregation builderAggregation = builder.getAggregation(); + + subMonitor.subTask("Collecting contributions"); + subMonitor.worked(1); + + Set allUnitsToAggregate = new TreeSet<>(); + for (ValidationSet validationSet : builderAggregation.getValidationSets(true)) { + allUnitsToAggregate.addAll(builder.getUnitsToAggregate(validationSet).stream() + .map(iu -> iu instanceof ResolvedInstallableUnit + ? ((ResolvedInstallableUnit) iu).getOriginal() + : iu) + .collect(Collectors.toSet())); + } + + MetadataRepositoryImpl aggregateMetadataRepository = (MetadataRepositoryImpl) P2Factory.eINSTANCE + .createMetadataRepository(); + aggregateMetadataRepository.setLocation(new java.net.URI(AGGREGATE_REPOSITORY_LOCATION)); + + Map modeledIUs = allUnitsToAggregate.stream() + .collect(Collectors.toMap(Function.identity(), iu -> P2Bridge.importToModel(iu))); + aggregateMetadataRepository.getInstallableUnits().addAll(new TreeSet<>(modeledIUs.values())); + + IQueryable queriable = new QueryableArray(modeledIUs.values()); + + Set contributionsWithDuplicateRepositories = new HashSet<>(); + Map owningContributions = new HashMap<>(); + EList allContributions = builderAggregation.getAllContributions(true); + + Map> allContributionIUs = new HashMap<>(); + Map> allIncludedIUs = new HashMap<>(); + + ExecutorService executor = getExecutor(); + + subMonitor.worked(1); + subMonitor.subTask("Analyzing contributions"); + + for (Contribution contribution : allContributions) { + Set contributionIUs = new TreeSet<>(); + Set includedIUs = new TreeSet<>(); + URI contributionURI = EcoreUtil.getURI((EObject) contribution); + allContributionIUs.put(contributionURI, contributionIUs); + allIncludedIUs.put(contributionURI, includedIUs); + + EList repositories = contribution.getRepositories(true); + for (MappedRepository mappedRepository : repositories) { + MetadataRepository metadataRepository = mappedRepository.getMetadataRepository(); + EList installableUnits = metadataRepository.getInstallableUnits(); + contributionIUs.addAll(installableUnits.stream().map(iu -> modeledIUs.get(iu)) + .filter(Objects::nonNull).collect(Collectors.toSet())); + + java.net.URI location = metadataRepository.getLocation(); + URI otherContribution = owningContributions.put(location, contributionURI); + if (otherContribution != null) { + contributionsWithDuplicateRepositories.add(contributionURI); + contributionsWithDuplicateRepositories.add(otherContribution); + } + + EList units = mappedRepository.getUnits(true); + for (MappedUnit mappedUnit : units) { + Set ius = query(queriable, + QueryUtil.createIUQuery(mappedUnit.getName(), mappedUnit.getVersionRange())); + if (!ius.isEmpty()) { + for (IInstallableUnit iu : ius) { + collectChildren(queriable, includedIUs, iu); + } + } + } + } + } + + Set remainingIUs = modeledIUs.keySet(); + + Map usedIUs = new LinkedHashMap<>(); + + Analysis analysis = EcoreUtil.copy(originalAnalysis); + + Pattern exclusion = analysis.getExclusion(); + + subMonitor.worked(1); + subMonitor.subTask("Partitioning contributions"); + + Map>> dependencies = new LinkedHashMap<>(); + EList contributions = analysis.getContributions(); + for (boolean all : new boolean[] { false, true }) { + for (ContributionAnalysis contributionAnalysis : contributions) { + Contribution contribution = contributionAnalysis.getContribution(); + URI contributionURI = contribution == null ? null + : CommonPlugin.asLocalURI(EcoreUtil.getURI((EObject) contribution)); + boolean duplicated = contributionsWithDuplicateRepositories.contains(contributionURI); + Pattern match = contributionAnalysis.getMatch(); + Set ius = (duplicated || match != null + ? all ? allContributionIUs : allIncludedIUs + : allContributionIUs).get(contributionURI); + if (ius == null && match != null) { + ius = new LinkedHashSet<>(modeledIUs.values()); + } + if (ius != null) { + EList installableUnits = contributionAnalysis + .getInstallableUnits(); + for (IInstallableUnit iu : ius) { + String id = iu.getId(); + if ((match == null || match.matcher(id).matches()) && remainingIUs.remove(iu) + && (exclusion == null || !exclusion.matcher(id).matches())) { + InstallableUnitAnalysis installableUnitAnalysis = AnalyzerFactory.eINSTANCE + .createInstallableUnitAnalysis(); + installableUnitAnalysis.setInstallableUnit(iu); + usedIUs.put(iu, installableUnitAnalysis); + installableUnits.add(installableUnitAnalysis); + + EList requirements = installableUnitAnalysis + .getRequirements(); + + for (IRequirement requirement : iu.getRequirements()) { + RequirementAnalysis requirementAnalysis = AnalyzerFactory.eINSTANCE + .createRequirementAnalysis(); + requirementAnalysis.setRequirement(requirement); + requirements.add(requirementAnalysis); + + IMatchExpression matches = requirement.getMatches(); + dependencies.put(requirementAnalysis, executor.submit( + () -> query(queriable, QueryUtil.createMatchQuery(matches)))); + } + + ECollections.sort(requirements, + RequirementAnalysis.REQUIREMENT_ANALYSIS_COMPARATOR); + } + } + + ECollections.sort(installableUnits, + + InstallableUnitAnalysis.INSTALLABLE_UNIT_ANALYIS_COMPARATOR); + } + } + } + + subMonitor.worked(1); + subMonitor.subTask("Analyzing dependencies"); + + Map> dependants = new LinkedHashMap<>(); + for (Map.Entry>> entry : dependencies + .entrySet()) { + RequirementAnalysis requirementAnalysis = entry.getKey(); + Set ius = entry.getValue().get(); + Set resolutions = ius.stream() // + .map(iu -> usedIUs.get(iu)).filter(Objects::nonNull) // + .map(iu -> { + RequirementResolution requirementResolution = AnalyzerFactory.eINSTANCE + .createRequirementResolution(); + requirementResolution.setInstallableUnit(iu); + dependants.computeIfAbsent(iu, i -> new LinkedHashSet<>()) + .add(requirementResolution); + + return requirementResolution; + }).collect(Collectors.toSet()); + requirementAnalysis.getResolutions().addAll(resolutions); + } + + subMonitor.worked(1); + subMonitor.subTask("Building dependency results"); + + for (Map.Entry> entry : dependants.entrySet()) { + InstallableUnitAnalysis installableUnitAnalysis = entry.getKey(); + EList capabilities = installableUnitAnalysis.getCapabilities(); + Set requirementResolutions = entry.getValue(); + + IInstallableUnit iu = installableUnitAnalysis.getInstallableUnit(); + for (IProvidedCapability capability : iu.getProvidedCapabilities()) { + CapabilityAnalysis capabilityAnalysis = AnalyzerFactory.eINSTANCE + .createCapabilityAnalysis(); + capabilityAnalysis.setCapability(capability); + capabilities.add(capabilityAnalysis); + EList resolutions = capabilityAnalysis.getResolutions(); + + String namespace = capability.getNamespace(); + String name = capability.getName(); + for (Iterator it = requirementResolutions.iterator(); it + .hasNext();) { + RequirementResolution requirementResolution = it.next(); + RequirementAnalysis requirementAnalysis = requirementResolution.getRequirement(); + IRequirement requirement = requirementAnalysis.getRequirement(); + if (requirement instanceof IRequiredCapability) { + IRequiredCapability requiredCapability = (IRequiredCapability) requirement; + String requiredNamespace = requiredCapability.getNamespace(); + String requiredName = requiredCapability.getName(); + if (requiredNamespace.equals(namespace) && requiredName.equals(name)) { + CapabilityResolution capabilityResolution = AnalyzerFactory.eINSTANCE + .createCapabilityResolution(); + capabilityResolution.setRequirement(requirementAnalysis); + resolutions.add(capabilityResolution); + requirementResolution.setCapability(capabilityAnalysis); + it.remove(); + } + } else { + IMatchExpression match = requirement.getMatches(); + if (RequiredPropertiesMatch.isPropertiesMatchRequirement(match)) { + String requiredNamespace = RequiredPropertiesMatch.extractNamespace(match); + if (namespace.equals(requiredNamespace)) { + IFilterExpression propertiesMatch = RequiredPropertiesMatch + .extractPropertiesMatch(match); + if (propertiesMatch.match(capability.getProperties())) { + CapabilityResolution capabilityResolution = AnalyzerFactory.eINSTANCE + .createCapabilityResolution(); + capabilityResolution.setRequirement(requirementAnalysis); + resolutions.add(capabilityResolution); + requirementResolution.setCapability(capabilityAnalysis); + it.remove(); + } + } + } + } + } + + ECollections.sort(resolutions, CapabilityResolution.CAPABILITY_RESOLUTION_COMPARATOR); + } + + if (!requirementResolutions.isEmpty()) { + System.err.println("###" + requirementResolutions); + } + } + + aggregateMetadataRepository.getInstallableUnits().retainAll(usedIUs.keySet()); + + aggregateMetadataRepositoryResource = new P2ResourceFactoryImpl() + .createResource(AGGREGATE_REPOSITORY); + aggregateMetadataRepositoryResource.getContents().add(aggregateMetadataRepository); + + structuredAggregateMetadataRepositoryResource = new MetadataRepositoryResourceFactoryImpl() + .createResource(STRUCTURED_AGGREGATE_REPOSITORY); + structuredAggregateMetadataRepositoryResource.getContents() + .add((EObject) MetadataRepositoryStructuredViewBuilder.create(aggregateMetadataRepository)); + + Comparator comparator = CommonPlugin.INSTANCE.getComparator(); + ECollections.sort(analysis.getContributions(), (c1, c2) -> { + String label1 = c1.getLabel(); + String label2 = c2.getLabel(); + return comparator.compare(label1, label2); + }); + + subMonitor.worked(1); + subMonitor.subTask("Background tasks completed"); + + return analysis; + } + + return null; + } finally { + shutDownExecutor(); + } + } + + private ExecutorService getExecutor() { + if (executor == null) { + executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); + } + + return executor; + } + + private void shutDownExecutor() throws InterruptedException { + if (executor != null) { + executor.shutdown(); + executor.awaitTermination(10, TimeUnit.MINUTES); + executor = null; + } + } + + private Set query(IQueryable queriable, IQuery query) { + IQueryResult queryResult = queriable.query(query, new NullProgressMonitor()); + Set result = new TreeSet(); + for (IInstallableUnit iu : queryResult) { + result.add(iu); + } + + return result; + } + + private void collectChildren(IQueryable queriable, Set allIUs, + IInstallableUnit iu) { + if (allIUs.add(iu)) { + for (IRequirement requirement : iu.getRequirements()) { + if (requirement instanceof IRequiredCapability) { + IRequiredCapability requiredCapability = (IRequiredCapability) requirement; + if (IInstallableUnit.NAMESPACE_IU_ID.equals(requiredCapability.getNamespace())) { + VersionRange range = requiredCapability.getRange(); + Version minimum = range.getMinimum(); + if (minimum.equals(range.getMaximum())) { + Set result = query(queriable, + QueryUtil.createIUQuery(requiredCapability.getName(), minimum)); + if (result.isEmpty()) { + System.err.println("### not found " + requirement + " in " + queriable); + } else { + IInstallableUnit requiredIU = result.iterator().next(); + collectChildren(queriable, allIUs, requiredIU); + } + } + } + } + } + } + } + } + + public static class QueryableArray extends IndexProvider { + private final List dataSet; + private final IIndex capabilityIndex; + private final IIndex idIndex; + private final TranslationSupport translationSupport; + + public QueryableArray(IInstallableUnit[] ius) { + this(Arrays.asList(ius)); + } + + public QueryableArray(Collection ius) { + dataSet = new ArrayList<>(ius); + capabilityIndex = new CapabilityIndex(dataSet.iterator()); + idIndex = new IdIndex(dataSet.iterator()); + translationSupport = new TranslationSupport(this); + } + + @Override + public Iterator everything() { + return dataSet.iterator(); + } + + @Override + public IIndex getIndex(String memberName) { + if (org.eclipse.equinox.internal.p2.metadata.InstallableUnit.MEMBER_PROVIDED_CAPABILITIES + .equals(memberName)) { + return capabilityIndex; + } + if (org.eclipse.equinox.internal.p2.metadata.InstallableUnit.MEMBER_ID.equals(memberName)) { + return idIndex; + } + return null; + } + + @Override + public Object getManagedProperty(Object client, String memberName, Object key) { + if (client instanceof IInstallableUnit + && org.eclipse.equinox.internal.p2.metadata.InstallableUnit.MEMBER_TRANSLATED_PROPERTIES + .equals(memberName)) { + IInstallableUnit iu = (IInstallableUnit) client; + return key instanceof KeyWithLocale ? translationSupport.getIUProperty(iu, (KeyWithLocale) key) + : translationSupport.getIUProperty(iu, key.toString()); + } + return null; + } + } +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/BaseHandler.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/BaseHandler.java new file mode 100644 index 000000000..abe67db57 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/BaseHandler.java @@ -0,0 +1,163 @@ +/** + * Copyright (c) 2022 Eclipse contributors and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.handlers; + +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.InvocationTargetException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.AggregationAnalyzerEditorPlugin; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.expressions.IEvaluationContext; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.URIConverter; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.ISources; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.handlers.HandlerUtil; + +public abstract class BaseHandler extends AbstractHandler { + + /** + * https://github.com/merks/org.eclipse.simrel.build.git + * git@github.com:merks/org.eclipse.simrel.build.git + */ + protected static final Pattern ECLIPSE_GIT_URL_PATTERN = Pattern + .compile("(?:https?://git.eclipse.org/r/|ssh://[^@]+@git.eclipse.org:29418/)(.*)"); + + protected static final Pattern ECLIPSE_COMMIT_TIME_PATTERN = Pattern.compile("]+?title='([^']*)'"); + + /** + * https://git.eclipse.org/r/simrel/org.eclipse.simrel.build.git + * ssh://user_id@git.eclipse.org:29418/simrel/org.eclipse.simrel.build.git + */ + protected static final Pattern GITHUB_URL_PATTERN = Pattern.compile("(?:https?://github.com/|git@github.com:)(.*)"); + + protected static final Pattern GITHUB_TIME_PATTERN = Pattern.compile(" { + try { + perform(monitor); + shell.getDisplay().asyncExec(() -> { + asyncExec(); + }); + } catch (Exception e) { + throw new InvocationTargetException(e); + } + }); + } catch (InvocationTargetException | InterruptedException e) { + handleFailure("Failure", e); + } + } + + protected void handleFailure(String message, Throwable e) { + AggregationAnalyzerEditorPlugin.INSTANCE.showError(message, e); + AggregationAnalyzerEditorPlugin.INSTANCE.log(e); + } + + protected abstract void perform(IProgressMonitor monitor) throws Exception; + + protected void asyncExec() { + } + } +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/ClearCacheHandler.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/ClearCacheHandler.java new file mode 100644 index 000000000..f34daadcb --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/ClearCacheHandler.java @@ -0,0 +1,52 @@ +/** + * Copyright (c) 2022 Eclipse contributors and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.handlers; + +import java.io.IOException; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; + +public class ClearCacheHandler extends BaseHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + try { + Files.walkFileTree(CACHE, new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attributes) throws IOException { + Files.delete(file); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult postVisitDirectory(Path directory, IOException exception) throws IOException { + if (exception == null) { + Files.delete(directory); + } + return super.postVisitDirectory(directory, exception); + } + }); + } catch (IOException e) { + throw new ExecutionException(e.getLocalizedMessage(), e); + } + return null; + } + + @Override + public void setEnabled(Object evaluationContext) { + } +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/LastModifiedHandler.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/LastModifiedHandler.java new file mode 100644 index 000000000..79d79dbb2 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/LastModifiedHandler.java @@ -0,0 +1,199 @@ +/** + * Copyright (c) 2022 Eclipse contributors and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.handlers; + +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.cbi.p2repo.aggregator.Contribution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.util.TreeIterator; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.util.EcoreUtil; + +public class LastModifiedHandler extends BaseHandler { + + protected Activity createActivity(Analysis analysis) { + return new LastModifiedUpdater(analysis); + } + + public static class LastModifiedUpdater extends Activity { + + private static final String GIT_ECLIPSE = "https://git.eclipse.org/"; + + private static final String ECLIPSE_GIT_DATE_FORMAT = "yyyy-MM-dd HH:mm:ss Z"; + + private static final String GITHUB = "https://github.com/"; + + private static final String GITLAB_ECLIPSE = "https://gitlab.eclipse.org"; + + private static final String GIT_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; + + private static final Pattern ECLIPSE_GITLAB_TIME_PATTERN = Pattern.compile("]+datetime=\"([^\"]+)\""); + + private static final Pattern GIT_CONFIG_URL_PATTERN = Pattern.compile("\n[ \t]*url[ \t]*=[ \t]*([^\n\r \t]+)"); + + private static final Pattern GIT_CONFIG_BRANCH_PATTERN = Pattern + .compile("\n\\[[ \t]*branch[ \t]+\"([^\"]+)\"[ \t]*\\]"); + + private Analysis analysis; + + private ExecutorService executor; + + public LastModifiedUpdater(Analysis analysis) { + this.analysis = analysis; + } + + private ExecutorService getExecutor() { + if (executor == null) { + executor = Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()); + } + + return executor; + } + + private void shutDownExecutor() throws InterruptedException { + if (executor != null) { + executor.shutdown(); + executor.awaitTermination(10, TimeUnit.MINUTES); + executor = null; + } + } + + @Override + protected void perform(IProgressMonitor monitor) throws Exception { + SubMonitor subMonitor = SubMonitor.convert(monitor); + subMonitor.setTaskName("Analyzing Git History"); + List> callables = new ArrayList<>(); + for (ContributionAnalysis contributionAnalysis : analysis.getContributions()) { + Contribution contribution = contributionAnalysis.getContribution(); + if (contribution != null) { + Resource resource = ((EObject) contribution).eResource(); + if (resource != null + && EcoreUtil.getRootContainer((EObject) contribution).eResource() != resource) { + callables.add(() -> { + URI uri = resource.getURI(); + subMonitor.subTask(uri.toString()); + Long lastModified = getLastModified(CommonPlugin.resolve(uri)); + if (lastModified != null) { + contributionAnalysis.setLastModified(lastModified); + } + subMonitor.worked(1); + return null; + }); + } + } + + for (TreeIterator eAllContents = contributionAnalysis.eAllContents(); eAllContents + .hasNext();) { + EObject eObject = eAllContents.next(); + if (eObject instanceof GitRepository) { + GitRepository gitRepository = (GitRepository) eObject; + URI uri = gitRepository.getURI(); + if (uri != null) { + callables.add(() -> { + subMonitor.subTask(uri.toString()); + Long lastModified = getLastModified(uri.toString()); + if (lastModified != null) { + gitRepository.setLastModified(lastModified); + } + subMonitor.worked(1); + return null; + }); + } + } + } + } + + subMonitor.setWorkRemaining(callables.size()); + + ExecutorService executor = getExecutor(); + for (Callable callable : callables) { + executor.submit(callable); + } + + shutDownExecutor(); + } + + public Long getLastModified(String repo) throws Exception { + if (repo.startsWith(GITLAB_ECLIPSE)) { + URI historyURI = URI.createURI(repo + "/-/commits"); + return BaseHandler.getLastModified(historyURI, ECLIPSE_GITLAB_TIME_PATTERN, GIT_DATE_FORMAT); + } else if (repo.startsWith(GITHUB)) { + URI historyURI = URI.createURI(repo + "/commits"); + return BaseHandler.getLastModified(historyURI, GITHUB_TIME_PATTERN, GIT_DATE_FORMAT); + } else if (repo.startsWith(GIT_ECLIPSE)) { + URI historyURI = URI.createURI(repo.replace("/r/", "/c/") + ".git/log/"); + return BaseHandler.getLastModified(historyURI, ECLIPSE_COMMIT_TIME_PATTERN, ECLIPSE_GIT_DATE_FORMAT); + } + // https://gitlab.eclipse.org/eclipse/mpc/org.eclipse.epp.mpc + return null; + } + + private Long getLastModified(URI contributionURI) throws Exception { + if (contributionURI.isFile()) { + Path contributionPath = Path.of(contributionURI.toFileString()); + for (Path path = contributionPath.getParent(); path != null + && Files.isReadable(path); path = path.getParent()) { + // Look for a git repository configuration. + Path configPath = path.resolve(".git/config"); + if (Files.isRegularFile(configPath)) { + String config = Files.readString(configPath); + // Determine branch and repo URL. + Matcher branchMatcher = GIT_CONFIG_BRANCH_PATTERN.matcher(config); + Matcher urlMatcher = GIT_CONFIG_URL_PATTERN.matcher(config); + if (urlMatcher.find() && branchMatcher.find()) { + URI repoRelativeURI = URI.createFileURI(path.relativize(contributionPath).toString()); + return getLastModified(urlMatcher.group(1), repoRelativeURI, branchMatcher.group(1)); + } + + break; + } + } + } + + return null; + } + + private Long getLastModified(String url, URI repoRelativeURI, String branch) throws Exception { + Matcher eclipseGitMatcher = ECLIPSE_GIT_URL_PATTERN.matcher(url); + if (eclipseGitMatcher.matches()) { + URI logURI = URI.createURI(GIT_ECLIPSE + "c/" + eclipseGitMatcher.group(1) + ".git/log/" + + repoRelativeURI + "?h=" + branch); + return BaseHandler.getLastModified(logURI, ECLIPSE_COMMIT_TIME_PATTERN, ECLIPSE_GIT_DATE_FORMAT); + } + + Matcher githubGitMatcher = GITHUB_URL_PATTERN.matcher(url); + if (githubGitMatcher.matches()) { + URI logURI = URI.createURI(GITHUB + githubGitMatcher.group(1).replaceAll("\\.git$", "") + + "/commits/" + branch + "/" + repoRelativeURI); + return BaseHandler.getLastModified(logURI, GITHUB_TIME_PATTERN, GIT_DATE_FORMAT); + } + + return null; + } + } +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/ProjectReconcilerHandler.java b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/ProjectReconcilerHandler.java new file mode 100644 index 000000000..d9eedb847 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer.editor/src/org/eclipse/cbi/p2repo/aggregator/analyzer/presentation/handlers/ProjectReconcilerHandler.java @@ -0,0 +1,451 @@ +/** + * Copyright (c) 2022 Eclipse contributors and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.presentation.handlers; + +import java.io.IOException; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeMap; +import java.util.TreeSet; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.eclipse.cbi.p2repo.aggregator.Contribution; +import org.eclipse.cbi.p2repo.aggregator.MappedRepository; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.util.ECollections; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.impl.URIMappingRegistryImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; +import org.eclipse.emf.edit.command.ChangeCommand; +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; + +public class ProjectReconcilerHandler extends BaseHandler { + + @Override + protected Activity createActivity(Analysis analysis) { + return new Reconciler(analysis); + } + + private static class Reconciler extends Activity { + + private final Analysis analysis; + + ProjectMapper projectMapper; + + private Map> projects; + + public Reconciler(Analysis analysis) { + this.analysis = analysis; + } + + @Override + protected void perform(IProgressMonitor monitor) throws Exception { + projectMapper = new ProjectMapper(analysis.getReleaseDate()); + projects = reconcile(monitor); + } + + @Override + protected void asyncExec() { + EditingDomain editingDomain = AdapterFactoryEditingDomain.getEditingDomainFor(analysis); + CommandStack commandStack = editingDomain.getCommandStack(); + class ProjectReconcileCommand extends ChangeCommand { + private ProjectReconcileCommand(Collection notifiers) { + super(notifiers); + } + + @Override + protected void doExecute() { + for (Map.Entry> entry : projects.entrySet()) { + if (!EcoreUtil.equals(entry.getKey().getProjects(), entry.getValue())) { + ECollections.setEList(entry.getKey().getProjects(), entry.getValue()); + } + } + } + + public String getLabel() { + return "Reconcile Projects"; + } + + public boolean hasChanges() { + return changeDescription != null && !changeDescription.getObjectChanges().isEmpty(); + } + } + + ProjectReconcileCommand reconcileCommand = new ProjectReconcileCommand(List.of(analysis)); + commandStack.execute(reconcileCommand); + + // If the reconcile operation produced no changes, the command is a no-op so we can remove it from the command stack. + // This way the resource is only dirty if it's actually been reconciled in a way that changes the structure. + if (!reconcileCommand.hasChanges()) { + commandStack.undo(); + } + } + + public Map> reconcile(IProgressMonitor monitor) throws Exception { + Map> projectLinks = computeProjectLinks(monitor, analysis); + compareWithOfficialList(projectLinks); + return projectLinks; + } + + private void compareWithOfficialList(Map> projectLinks) { + Set projectIDs = new TreeSet<>(CommonPlugin.INSTANCE.getComparator()); + + Map projectVersions = new TreeMap<>(CommonPlugin.INSTANCE.getComparator()); + for (Map.Entry> entry : projectLinks.entrySet()) { + Contribution contribution = entry.getKey().getContribution(); + if (contribution == null || contribution.isEnabled()) { + for (Project project : entry.getValue()) { + URI version = project.getVersion(); + projectIDs.add(project.getSite().lastSegment()); + projectVersions.put(project.getName(), version == null ? null : version.lastSegment()); + } + } + } + + System.out.println("-----------------------------"); + for (Map.Entry entry : projectVersions.entrySet()) { + System.out.println(entry.getKey() + " -> " + entry.getValue()); + } + + if (Boolean.FALSE) { + // If Wayne asks for a list of IDs, this can be enabled. + System.out.println("-----------------------------"); + for (String project : projectIDs) { + System.out.println(project); + } + } + + Map projectsWayne = new TreeMap<>(); + try { + String content = getContent( + URI.createURI(ProjectMapper.ECLIPSE_PROJECT_PORTAL_HOST + "releases/2022-06")); + Pattern projectPattern = Pattern + .compile("([^<]+)[^<]+"); + for (Matcher matcher = projectPattern.matcher(content); matcher.find();) { + String group2 = matcher.group(2).trim().replace("\u2122", ""); + String group3 = matcher.group(3); + projectsWayne.put(group2, URI.createURI(group3).lastSegment()); + } + } catch (IOException e) { + e.printStackTrace(); + } + + System.out.println("-----------------------------"); + + for (Map.Entry project : projectVersions.entrySet()) { + if (!projectsWayne.containsKey(project.getKey())) { + System.out.println("++ " + project); + } else { + String value1 = project.getValue(); + String value2 = projectsWayne.get(project.getKey()); + if (!Objects.equals(value1, value2)) { + System.out.println("?? " + project.getKey() + " " + value1 + " != " + value2); + } + } + } + + for (String project : projectsWayne.keySet()) { + if (!projectVersions.containsKey(project)) { + System.out.println("-- " + project); + } + } + } + + private Map> computeProjectLinks(IProgressMonitor monitor, + Analysis analysis) throws Exception { + Map> result = new LinkedHashMap<>(); + EList contributions = analysis.getContributions(); + SubMonitor subMonitor = SubMonitor.convert(monitor, "Analyzing", contributions.size()); + for (ContributionAnalysis contributionAnalysis : contributions) { + List projects = new ArrayList<>(); + result.put(contributionAnalysis, projects); + + SubMonitor projectSubMonitor = subMonitor.newChild(1); + projectSubMonitor.subTask(contributionAnalysis.getLabel()); + + Set projectIDs = getProjectIDs(contributionAnalysis); + for (String projectID : projectIDs) { + projects.add(createProject(projectID)); + } + } + + return result; + } + + private Project createProject(String projectID) throws IOException { + + Project project = AnalyzerFactory.eINSTANCE.createProject(); + project.setSite(URI.createURI(ProjectMapper.ECLIPSE_PROJECT_PORTAL + projectID)); + project.setName(projectMapper.getProjectName(projectID)); + + String latestReleaseURL = projectMapper.getLatestReleaseInfo(String.class, projectID); + if (latestReleaseURL != null) { + project.setVersion(URI.createURI(latestReleaseURL)); + Date date = projectMapper.getLatestReleaseInfo(Date.class, projectID); + if (date != null) { + project.setReleaseDate(date); + } + } + + EList repositories = project.getRepositories(); + Set repositoryURIs = projectMapper.getRepositories(projectID); + for (String repositoryURI : repositoryURIs) { + GitRepository gitRepository = AnalyzerFactory.eINSTANCE.createGitRepository(); + gitRepository.setURI(URI.createURI(repositoryURI)); + repositories.add(gitRepository); + } + + if (!projectID.contains(".")) { + EList subprojects = project.getSubprojects(); + Set subprojectIDs = projectMapper.getSubprojects(projectID); + for (String subprojectID : subprojectIDs) { + subprojects.add(createProject(subprojectID)); + } + } + + return project; + } + + private Set getProjectIDs(ContributionAnalysis contributionAnalysis) { + Set projects = new TreeSet<>(); + Contribution contribution = contributionAnalysis.getContribution(); + if (contribution != null) { + for (MappedRepository mappedRepository : contribution.getRepositories(false)) { + String resolvedLocation = mappedRepository.getResolvedLocation(); + String projectID = projectMapper.getProjectID(URI.createURI(resolvedLocation)); + if (projectID == null) { + System.out.println("Not found: " + resolvedLocation); + } else { + projects.add(projectID); + } + } + } + + for (Project project : contributionAnalysis.getProjects()) { + URI site = project.getSite(); + if (site.toString().startsWith(ProjectMapper.ECLIPSE_PROJECT_PORTAL)) { + String projectID = site.lastSegment(); + if (projectMapper.getProjectName(projectID) != null) { + projects.add(projectID); + } + } + } + + return projects; + } + } + + private static final class ProjectMapper { + public static final String ECLIPSE_PROJECT_PORTAL_HOST = "https://projects.eclipse.org/"; + + public static final String ECLIPSE_PROJECT_PORTAL = ECLIPSE_PROJECT_PORTAL_HOST + "projects/"; + + private static final URI PROJECTS = URI + .createURI("https://download.eclipse.org/oomph/archive/projects/projects.txt"); + + private static final URI MAPPINGS = URI + .createURI("https://download.eclipse.org/oomph/archive/projects/mappings.txt"); + + private final URIMappingRegistryImpl registry = new URIMappingRegistryImpl(); + + private final Map pmiContent = new TreeMap<>(); + + private final Map projects = new TreeMap<>(); + + private long versionCutoffTime; + + public ProjectMapper(Date releaseDate) throws IOException { + + if (releaseDate == null) { + long now = System.currentTimeMillis(); + // Three months from now. + versionCutoffTime = now + 1000L * 60L * 60L * 24L * 30L * 3L; + } else { + // Plus one day for time zone differences. + versionCutoffTime = releaseDate.getTime() + 1000L * 60L * 60L * 24L; + } + + String mappings = getContent(MAPPINGS); + for (String line : mappings.split("\r?\n")) { + int tab = line.indexOf('\t'); + String path = line.substring(0, tab); + String project = line.substring(tab + 1); + + if ("webtools.releng".equals(project)) { + project = "webtools"; + } else if ("eclipse.platform".equals(project)) { + project = "eclipse"; + } + + URI projectURI = URI.createURI("project://" + project + "/"); + for (String host : new String[] { "https://download.eclipse.org", "https://archive.eclipse.org", + "http://download.eclipse.org", "http://archive.eclipse.org" }) { + registry.put(createURI(host, path), projectURI); + } + } + + String projects = getContent(PROJECTS); + for (String line : projects.split("\r?\n")) { + int tab = line.indexOf('\t'); + String id = line.substring(0, tab); + if (!id.endsWith(".incubator")) { + String name = line.substring(tab + 1); + this.projects.put(id, name); + } + } + } + + public String getProjectID(URI uri) { + URI projectURI = registry.getURI(uri); + if (projectURI != null && "project".equals(projectURI.scheme())) { + return projectURI.authority(); + } + + return null; + } + + public String getProjectName(String projectID) { + return projects.get(projectID); + } + + public Set getRepositories(String projectID) throws IOException { + Set result = new TreeSet<>(); + String content = getPMIContent(projectID); + String githubRepos = getSection("github_repos", content); + if (githubRepos != null) { + result.addAll(getValues("url", githubRepos)); + } + + String gitlabRepos = getSection("gitlab_repos", content); + if (githubRepos != null) { + result.addAll(getValues("url", gitlabRepos)); + } + + String gerritRepos = getSection("gerrit_repos", content); + if (gerritRepos != null) { + result.addAll(getValues("url", gerritRepos)); + } + + result.removeIf( + it -> it.endsWith("/.github") || it.contains("www.eclipse.org") || it.endsWith(".incubator")); + return result; + } + + public T getLatestReleaseInfo(Class type, String projectID) throws IOException { + String content = getPMIContent(projectID); + String releases = getSection("releases", content); + if (releases != null) { + Set values = getValues("url", releases); + Pattern releasePattern = Pattern.compile( + "]+property=\"dc:date\"[^>]+datatype=\"xsd:dateTime\"[^>]+content=\"([^\"]+)\">"); + for (String releaseURI : values) { + String releaseRecord = getContent(URI.createURI(releaseURI)); + Matcher matcher = releasePattern.matcher(releaseRecord); + if (matcher.find()) { + String date = matcher.group(1); + try { + SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssX"); + Date dateValue = simpleDateFormat.parse(date); + + long delta = versionCutoffTime - dateValue.getTime(); + if (delta > 0) { + if (type.isInstance(releaseURI)) { + return type.cast(releaseURI); + } + if (type.isInstance(dateValue)) { + return type.cast(dateValue); + } + + throw new IllegalArgumentException("Type " + type.getName() + " not expected"); + } else { + // Release is after the cutoff date + System.out.println("-- " + projectID + " -> " + releaseURI + " -> " + date + " > " + + simpleDateFormat.format(new Date(versionCutoffTime))); + } + } catch (ParseException e) { + throw new IOException(e); + } + } + } + } + return null; + } + + private String getSection(String key, String content) { + Pattern pattern = Pattern.compile('"' + key + "\":\\[([^]]*)\\]"); + Matcher matcher = pattern.matcher(content); + if (matcher.find()) { + return matcher.group(1); + } + return null; + } + + private Set getValues(String key, String content) { + Set result = new LinkedHashSet<>(); + Matcher matcher = Pattern.compile('"' + key + "\":\"([^\"]+)\"").matcher(content); + while (matcher.find()) { + result.add(matcher.group(1)); + } + return result; + } + + public Set getSubprojects(String projectID) { + Set result = new LinkedHashSet<>(); + String prefix = projectID + '.'; + for (String otherProjectID : projects.keySet()) { + if (otherProjectID.startsWith(prefix) && !otherProjectID.equals("eclipse.e4")) { + result.add(otherProjectID); + } + } + return result; + } + + public String getPMIContent(String projectID) throws IOException { + String result = pmiContent.get(projectID); + if (result == null) { + String pmiID = projectID.replace('.', '_'); + URI pmiURI = URI.createURI(ECLIPSE_PROJECT_PORTAL_HOST + "api/projects/" + pmiID); + result = getContent(pmiURI); + pmiContent.put(projectID, result); + } + return result; + } + + private URI createURI(String baseURI, String path) { + if (!path.endsWith("/")) { + path += "/"; + } + + return URI.createURI(baseURI + "/" + path); + } + } +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/.classpath b/org.eclipse.cbi.p2repo.aggregator.analyzer/.classpath new file mode 100644 index 000000000..c8bcf7501 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/.classpath @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/.gitignore b/org.eclipse.cbi.p2repo.aggregator.analyzer/.gitignore new file mode 100644 index 000000000..fb29b6044 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/.gitignore @@ -0,0 +1,6 @@ +/aggrCodetemplates.xml +/aggrOrganize.importorder +/b3Cleanup.xml +/b3Format.xml +/b3Organize.importorder +/codetemplates_b3_master.xml diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/.project b/org.eclipse.cbi.p2repo.aggregator.analyzer/.project new file mode 100644 index 000000000..659b565d5 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/.project @@ -0,0 +1,39 @@ + + + org.eclipse.cbi.p2repo.aggregator.analyzer + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + + + 1637246388601 + + 10 + + org.eclipse.ui.ide.multiFilter + 1.0-name-matches-false-false-target + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.core.resources.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.core.runtime.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.core.runtime.prefs new file mode 100644 index 000000000..b3c7fded6 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.core.runtime.prefs @@ -0,0 +1 @@ +eclipse.preferences.version=1 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..1fbb982d8 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,418 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.codeComplete.argumentPrefixes= +org.eclipse.jdt.core.codeComplete.argumentSuffixes= +org.eclipse.jdt.core.codeComplete.fieldPrefixes= +org.eclipse.jdt.core.codeComplete.fieldSuffixes= +org.eclipse.jdt.core.codeComplete.localPrefixes= +org.eclipse.jdt.core.codeComplete.localSuffixes= +org.eclipse.jdt.core.codeComplete.staticFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFieldSuffixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldPrefixes= +org.eclipse.jdt.core.codeComplete.staticFinalFieldSuffixes= +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false +org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.align_variable_declarations_on_columns=false +org.eclipse.jdt.core.formatter.align_with_spaces=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_enum_constant=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_field=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_local_variable=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_method=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_package=49 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_parameter=0 +org.eclipse.jdt.core.formatter.alignment_for_annotations_on_type=49 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assertion_message=0 +org.eclipse.jdt.core.formatter.alignment_for_assignment=0 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_loops=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression_chain=0 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_module_statements=16 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_record_components=16 +org.eclipse.jdt.core.formatter.alignment_for_relational_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_shift_operator=0 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_record_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_type_annotations=0 +org.eclipse.jdt.core.formatter.alignment_for_type_arguments=0 +org.eclipse.jdt.core.formatter.alignment_for_type_parameters=0 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_last_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_abstract_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_statement_group_in_switch=0 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_constructor=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_record_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.align_tags_descriptions_grouped=false +org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.count_line_length_from_starting_position=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=false +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.indent_tag_description=false +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_between_different_tags=do not insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=132 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_record_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_record_components=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_switch_case_expressions=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_not_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_case=insert +org.eclipse.jdt.core.formatter.insert_space_before_arrow_in_switch_default=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_record_components=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_switch_case_expressions=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_constructor=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_record_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_record_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_annotation_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_anonymous_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_code_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_enum_constant_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_enum_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_if_then_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_lambda_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_loop_body_block_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_method_body_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_constructor_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_record_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.keep_simple_do_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_for_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_simple_getter_setter_on_one_line=false +org.eclipse.jdt.core.formatter.keep_simple_while_body_on_same_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_type_declaration_on_one_line=one_line_never +org.eclipse.jdt.core.formatter.lineSplit=120 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_after_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_code_block=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_end_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_blank_lines_before_code_block=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.parentheses_positions_in_annotation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_catch_clause=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_enum_constant_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_if_while_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_lambda_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_delcaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_method_invocation=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_record_declaration=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_switch_statement=common_lines +org.eclipse.jdt.core.formatter.parentheses_positions_in_try_clause=common_lines +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=tab +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.text_block_indentation=0 +org.eclipse.jdt.core.formatter.use_on_off_tags=false +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assertion_message_operator=true +org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_relational_operator=true +org.eclipse.jdt.core.formatter.wrap_before_shift_operator=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 000000000..8d15ba4a9 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,129 @@ +cleanup.add_default_serial_version_id=true +cleanup.add_generated_serial_version_id=false +cleanup.add_missing_annotations=true +cleanup.add_missing_deprecated_annotations=true +cleanup.add_missing_methods=true +cleanup.add_missing_nls_tags=false +cleanup.add_missing_override_annotations=true +cleanup.add_missing_override_annotations_interface_methods=true +cleanup.add_serial_version_id=false +cleanup.always_use_blocks=true +cleanup.always_use_parentheses_in_expressions=false +cleanup.always_use_this_for_non_static_field_access=false +cleanup.always_use_this_for_non_static_method_access=false +cleanup.convert_functional_interfaces=false +cleanup.convert_to_enhanced_for_loop=false +cleanup.correct_indentation=false +cleanup.format_source_code=false +cleanup.format_source_code_changes_only=false +cleanup.insert_inferred_type_arguments=false +cleanup.make_local_variable_final=true +cleanup.make_parameters_final=false +cleanup.make_private_fields_final=true +cleanup.make_type_abstract_if_missing_method=false +cleanup.make_variable_declarations_final=false +cleanup.never_use_blocks=false +cleanup.never_use_parentheses_in_expressions=true +cleanup.organize_imports=true +cleanup.qualify_static_field_accesses_with_declaring_class=false +cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +cleanup.qualify_static_member_accesses_with_declaring_class=false +cleanup.qualify_static_method_accesses_with_declaring_class=false +cleanup.remove_private_constructors=true +cleanup.remove_redundant_type_arguments=true +cleanup.remove_trailing_whitespaces=true +cleanup.remove_trailing_whitespaces_all=true +cleanup.remove_trailing_whitespaces_ignore_empty=false +cleanup.remove_unnecessary_casts=true +cleanup.remove_unnecessary_nls_tags=true +cleanup.remove_unused_imports=true +cleanup.remove_unused_local_variables=false +cleanup.remove_unused_private_fields=true +cleanup.remove_unused_private_members=false +cleanup.remove_unused_private_methods=true +cleanup.remove_unused_private_types=true +cleanup.sort_members=false +cleanup.sort_members_all=false +cleanup.use_anonymous_class_creation=false +cleanup.use_blocks=false +cleanup.use_blocks_only_for_return_and_throw=false +cleanup.use_lambda=true +cleanup.use_parentheses_in_expressions=false +cleanup.use_this_for_non_static_field_access=false +cleanup.use_this_for_non_static_field_access_only_if_necessary=true +cleanup.use_this_for_non_static_method_access=false +cleanup.use_this_for_non_static_method_access_only_if_necessary=true +cleanup_profile=_aggrCleanup +cleanup_settings_version=2 +eclipse.preferences.version=1 +editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true +formatter_profile=_aggrFormatEMF +formatter_settings_version=21 +org.eclipse.jdt.ui.exception.name=e +org.eclipse.jdt.ui.gettersetter.use.is=true +org.eclipse.jdt.ui.ignorelowercasenames=true +org.eclipse.jdt.ui.importorder=java;javax;org;com; +org.eclipse.jdt.ui.javadoc=true +org.eclipse.jdt.ui.keywordthis=false +org.eclipse.jdt.ui.ondemandthreshold=99 +org.eclipse.jdt.ui.overrideannotation=true +org.eclipse.jdt.ui.staticondemandthreshold=99 +org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.add_default_serial_version_id=true +sp_cleanup.add_generated_serial_version_id=false +sp_cleanup.add_missing_annotations=true +sp_cleanup.add_missing_deprecated_annotations=true +sp_cleanup.add_missing_methods=false +sp_cleanup.add_missing_nls_tags=false +sp_cleanup.add_missing_override_annotations=true +sp_cleanup.add_missing_override_annotations_interface_methods=true +sp_cleanup.add_serial_version_id=false +sp_cleanup.always_use_blocks=true +sp_cleanup.always_use_parentheses_in_expressions=false +sp_cleanup.always_use_this_for_non_static_field_access=false +sp_cleanup.always_use_this_for_non_static_method_access=false +sp_cleanup.convert_functional_interfaces=false +sp_cleanup.convert_to_enhanced_for_loop=false +sp_cleanup.correct_indentation=false +sp_cleanup.format_source_code=true +sp_cleanup.format_source_code_changes_only=true +sp_cleanup.insert_inferred_type_arguments=false +sp_cleanup.make_local_variable_final=false +sp_cleanup.make_parameters_final=false +sp_cleanup.make_private_fields_final=true +sp_cleanup.make_type_abstract_if_missing_method=false +sp_cleanup.make_variable_declarations_final=false +sp_cleanup.never_use_blocks=false +sp_cleanup.never_use_parentheses_in_expressions=true +sp_cleanup.on_save_use_additional_actions=false +sp_cleanup.organize_imports=true +sp_cleanup.qualify_static_field_accesses_with_declaring_class=false +sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true +sp_cleanup.qualify_static_member_accesses_with_declaring_class=false +sp_cleanup.qualify_static_method_accesses_with_declaring_class=false +sp_cleanup.remove_private_constructors=true +sp_cleanup.remove_redundant_type_arguments=true +sp_cleanup.remove_trailing_whitespaces=true +sp_cleanup.remove_trailing_whitespaces_all=true +sp_cleanup.remove_trailing_whitespaces_ignore_empty=false +sp_cleanup.remove_unnecessary_casts=true +sp_cleanup.remove_unnecessary_nls_tags=true +sp_cleanup.remove_unused_imports=true +sp_cleanup.remove_unused_local_variables=false +sp_cleanup.remove_unused_private_fields=true +sp_cleanup.remove_unused_private_members=false +sp_cleanup.remove_unused_private_methods=true +sp_cleanup.remove_unused_private_types=true +sp_cleanup.sort_members=true +sp_cleanup.sort_members_all=false +sp_cleanup.use_anonymous_class_creation=false +sp_cleanup.use_blocks=false +sp_cleanup.use_blocks_only_for_return_and_throw=false +sp_cleanup.use_lambda=false +sp_cleanup.use_parentheses_in_expressions=false +sp_cleanup.use_this_for_non_static_field_access=false +sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true +sp_cleanup.use_this_for_non_static_method_access=false +sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.ltk.core.refactoring.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 000000000..39b36fe8e --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,3 @@ +#Tue Jun 23 16:34:13 CEST 2009 +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.pde.prefs b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.pde.prefs new file mode 100644 index 000000000..d857b126b --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/.settings/org.eclipse.pde.prefs @@ -0,0 +1,33 @@ +#Wed Apr 27 17:32:32 CEST 2011 +compilers.f.unresolved-features=1 +compilers.f.unresolved-plugins=1 +compilers.incompatible-environment=1 +compilers.p.build=1 +compilers.p.build.bin.includes=1 +compilers.p.build.encodings=2 +compilers.p.build.java.compiler=2 +compilers.p.build.java.compliance=1 +compilers.p.build.missing.output=2 +compilers.p.build.output.library=1 +compilers.p.build.source.library=1 +compilers.p.build.src.includes=2 +compilers.p.deprecated=1 +compilers.p.discouraged-class=1 +compilers.p.internal=1 +compilers.p.missing-packages=2 +compilers.p.missing-version-export-package=2 +compilers.p.missing-version-import-package=2 +compilers.p.missing-version-require-bundle=2 +compilers.p.no-required-att=0 +compilers.p.not-externalized-att=2 +compilers.p.unknown-attribute=1 +compilers.p.unknown-class=1 +compilers.p.unknown-element=1 +compilers.p.unknown-identifier=1 +compilers.p.unknown-resource=1 +compilers.p.unresolved-ex-points=0 +compilers.p.unresolved-import=0 +compilers.s.create-docs=false +compilers.s.doc-folder=doc +compilers.s.open-tags=1 +eclipse.preferences.version=1 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/COPYRIGHT b/org.eclipse.cbi.p2repo.aggregator.analyzer/COPYRIGHT new file mode 100644 index 000000000..f934ce0f5 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/COPYRIGHT @@ -0,0 +1,8 @@ +Copyright (c) 2021 Eclipse Foundation and others. + +This program and the accompanying materials +are made available under the terms of the Eclipse Public License 2.0 +which accompanies this distribution, and is available at +https://www.eclipse.org/legal/epl-2.0/ + +SPDX-License-Identifier: EPL-2.0 diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator.analyzer/META-INF/MANIFEST.MF new file mode 100644 index 000000000..7c6169827 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/META-INF/MANIFEST.MF @@ -0,0 +1,30 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator.analyzer;singleton:=true +Bundle-Version: 1.1.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: org.eclipse.cbi.p2repo.aggregator.analyzer.AggregationAnalyzerPlugin$Implementation +Bundle-Localization: plugin +Export-Package: org.eclipse.cbi.p2repo.aggregator.analyzer, + org.eclipse.cbi.p2repo.aggregator.analyzer.impl, + org.eclipse.cbi.p2repo.aggregator.analyzer.util +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.emf.ecore;visibility:=reexport, + org.eclipse.cbi.p2repo.aggregator;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.eclipse.cbi.p2repo.util, + org.eclipse.ecf, + org.eclipse.equinox.p2.artifact.repository;visibility:=reexport, + org.eclipse.equinox.p2.core;visibility:=reexport, + org.eclipse.equinox.p2.metadata;bundle-version="[2.4.0,3.0.0)";visibility:=reexport, + org.eclipse.equinox.p2.metadata.repository;visibility:=reexport, + org.eclipse.equinox.p2.repository;visibility:=reexport, + org.eclipse.equinox.p2.engine;visibility:=reexport, + org.eclipse.equinox.p2.director;visibility:=reexport, + org.eclipse.cbi.p2repo.cli, + org.eclipse.cbi.p2repo.p2;visibility:=reexport +Bundle-ActivationPolicy: lazy +Bundle-Vendor: %providerName +Automatic-Module-Name: org.eclipse.cbi.p2repo.aggregator.analyzer diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/about.html b/org.eclipse.cbi.p2repo.aggregator.analyzer/about.html new file mode 100644 index 000000000..16e7373a1 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/about.html @@ -0,0 +1,28 @@ + + + + +About + + +

About This Content

+ +

November 22, 2017

+

License

+ +

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available +at http://www.eclipse.org/legal/epl-v20.html. +For purposes of the EPL, "Program" will mean the Content.

+ +

If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at http://www.eclipse.org.

+ + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/build.properties b/org.eclipse.cbi.p2repo.aggregator.analyzer/build.properties new file mode 100644 index 000000000..ecf45c109 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/build.properties @@ -0,0 +1,13 @@ +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties,\ + about.html +jars.compile.order = . +source.. = src/ +output.. = bin/ + +src.includes = about.html,\ + model/,\ + COPYRIGHT diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/model/AggregationAnalyzer.ecore b/org.eclipse.cbi.p2repo.aggregator.analyzer/model/AggregationAnalyzer.ecore new file mode 100644 index 000000000..0ee4abcd4 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/model/AggregationAnalyzer.ecore @@ -0,0 +1,199 @@ + + + + +
+ + + + +
+
+
+ + + + +
+ + + + + +
+ + + + +
+
+ + +
+ + + + + +
+ + + +
+ + + + + +
+ + + + +
+ + + + +
+ + + + +
+
+ + + + +
+
+ + + + + +
+ + + + + +
+
+ + + + +
+
+ + + + + +
+ + + + + +
+
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+
+
+ + + + + + +
+
+ + + + +
+
+ + + + + + +
+ + + + +
+ + + + + + + +
+
+ + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/model/AggregationAnalyzer.genmodel b/org.eclipse.cbi.p2repo.aggregator.analyzer/model/AggregationAnalyzer.genmodel new file mode 100644 index 000000000..2e7e92fec --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/model/AggregationAnalyzer.genmodel @@ -0,0 +1,88 @@ + + + AggregationAnalyzer.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SwitchMissingDefaultCase + UnnecessaryDeprecatedMethod + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/plugin.properties b/org.eclipse.cbi.p2repo.aggregator.analyzer/plugin.properties new file mode 100644 index 000000000..164ee3eb9 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/plugin.properties @@ -0,0 +1,11 @@ +# Copyright (c) 2021 Eclipse Foundation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 + +pluginName = CBI Aggregator Analysis Model +providerName = Eclipse CBI diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/plugin.xml b/org.eclipse.cbi.p2repo.aggregator.analyzer/plugin.xml new file mode 100644 index 000000000..62e380e6f --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/plugin.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/pom.xml b/org.eclipse.cbi.p2repo.aggregator.analyzer/pom.xml new file mode 100644 index 000000000..7c7548cca --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/pom.xml @@ -0,0 +1,13 @@ + + 4.0.0 + org.eclipse.cbi.p2repo.aggregator.analyzer + 1.1.0-SNAPSHOT + eclipse-plugin + + org.eclipse.cbi + org.eclipse.cbi.p2repo.releng.parent + ../org.eclipse.cbi.p2repo.releng.parent + 1.1.0-SNAPSHOT + + \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AggregationAnalyzer.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AggregationAnalyzer.java new file mode 100644 index 000000000..478f833a7 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AggregationAnalyzer.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import org.eclipse.equinox.app.IApplication; +import org.eclipse.equinox.app.IApplicationContext; + +/** + */ +public class AggregationAnalyzer implements IApplication { + + @Override + public Object start(IApplicationContext context) throws Exception { + return null; + } + + @Override + public void stop() { + } +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AggregationAnalyzerPlugin.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AggregationAnalyzerPlugin.java new file mode 100644 index 000000000..ac679d250 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AggregationAnalyzerPlugin.java @@ -0,0 +1,94 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the AggregationAnalyzer model plugin. + * + * + * @generated + */ +public final class AggregationAnalyzerPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final AggregationAnalyzerPlugin INSTANCE = new AggregationAnalyzerPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public AggregationAnalyzerPlugin() { + super(new ResourceLocator[] {}); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/Analysis.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/Analysis.java new file mode 100644 index 000000000..7fcfe747d --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/Analysis.java @@ -0,0 +1,153 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import java.util.Date; +import java.util.regex.Pattern; + +import org.eclipse.cbi.p2repo.aggregator.Aggregation; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Analysis'. + * + * + * + * The root analysis instance that references the aggregaton being analyzed. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getReleaseDate Release Date}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getExclusion Exclusion}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getLevels Levels}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getAggregation Aggregation}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getContributions Contributions}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getAnalysis() + * @model + * @generated + */ +public interface Analysis extends EObject { + /** + * Returns the value of the 'Release Date' attribute. + * + * + * + * The date of the next scheduled release + * + * @return the value of the 'Release Date' attribute. + * @see #setReleaseDate(Date) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getAnalysis_ReleaseDate() + * @model dataType="org.eclipse.cbi.p2repo.aggregator.analyzer.Date" + * @generated + */ + Date getReleaseDate(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getReleaseDate Release Date}' attribute. + * + * + * @param value the new value of the 'Release Date' attribute. + * @see #getReleaseDate() + * @generated + */ + void setReleaseDate(Date value); + + /** + * Returns the value of the 'Exclusion' attribute. + * + * + * @return the value of the 'Exclusion' attribute. + * @see #setExclusion(Pattern) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getAnalysis_Exclusion() + * @model dataType="org.eclipse.cbi.p2repo.aggregator.analyzer.Pattern" + * @generated + */ + Pattern getExclusion(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getExclusion Exclusion}' attribute. + * + * + * @param value the new value of the 'Exclusion' attribute. + * @see #getExclusion() + * @generated + */ + void setExclusion(Pattern value); + + /** + * Returns the value of the 'Levels' attribute list. + * The list contents are of type {@link java.lang.Integer}. + * + * + * @return the value of the 'Levels' attribute list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getAnalysis_Levels() + * @model + * @generated + */ + EList getLevels(); + + /** + * Returns the value of the 'Aggregation' reference. + * + * + * + * The aggregation being analyzed. + * + * @return the value of the 'Aggregation' reference. + * @see #setAggregation(Aggregation) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getAnalysis_Aggregation() + * @model required="true" + * @generated + */ + Aggregation getAggregation(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getAggregation Aggregation}' reference. + * + * + * @param value the new value of the 'Aggregation' reference. + * @see #getAggregation() + * @generated + */ + void setAggregation(Aggregation value); + + /** + * Returns the value of the 'Contributions' containment reference list. + * The list contents are of type {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis}. + * + * + * + * The analyzed contributions. + * + * @return the value of the 'Contributions' containment reference list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getAnalysis_Contributions() + * @model containment="true" + * extendedMetaData="name='contribution' kind='element'" + * @generated + */ + EList getContributions(); + + /** + * + * + * @model + * @generated + */ + void reconcile(); + +} // Analysis diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AnalyzerFactory.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AnalyzerFactory.java new file mode 100644 index 000000000..61125c0e3 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AnalyzerFactory.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage + * @generated + */ +public interface AnalyzerFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + AnalyzerFactory eINSTANCE = org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerFactoryImpl.init(); + + /** + * Returns a new object of class 'Analysis'. + * + * + * @return a new object of class 'Analysis'. + * @generated + */ + Analysis createAnalysis(); + + /** + * Returns a new object of class 'Contribution Analysis'. + * + * + * @return a new object of class 'Contribution Analysis'. + * @generated + */ + ContributionAnalysis createContributionAnalysis(); + + /** + * Returns a new object of class 'Installable Unit Analysis'. + * + * + * @return a new object of class 'Installable Unit Analysis'. + * @generated + */ + InstallableUnitAnalysis createInstallableUnitAnalysis(); + + /** + * Returns a new object of class 'Requirement Analysis'. + * + * + * @return a new object of class 'Requirement Analysis'. + * @generated + */ + RequirementAnalysis createRequirementAnalysis(); + + /** + * Returns a new object of class 'Requirement Resolution'. + * + * + * @return a new object of class 'Requirement Resolution'. + * @generated + */ + RequirementResolution createRequirementResolution(); + + /** + * Returns a new object of class 'Capability Analysis'. + * + * + * @return a new object of class 'Capability Analysis'. + * @generated + */ + CapabilityAnalysis createCapabilityAnalysis(); + + /** + * Returns a new object of class 'Capability Resolution'. + * + * + * @return a new object of class 'Capability Resolution'. + * @generated + */ + CapabilityResolution createCapabilityResolution(); + + /** + * Returns a new object of class 'Project'. + * + * + * @return a new object of class 'Project'. + * @generated + */ + Project createProject(); + + /** + * Returns a new object of class 'Git Repository'. + * + * + * @return a new object of class 'Git Repository'. + * @generated + */ + GitRepository createGitRepository(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + AnalyzerPackage getAnalyzerPackage(); + +} //AnalyzerFactory diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AnalyzerPackage.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AnalyzerPackage.java new file mode 100644 index 000000000..2ab09787c --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/AnalyzerPackage.java @@ -0,0 +1,1599 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory + * @model kind="package" + * @generated + */ +public interface AnalyzerPackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "analyzer"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "https://www.eclipse.org/cbi/p2repo/2021/aggregator/analyzer"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "analyzer"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + AnalyzerPackage eINSTANCE = org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalysisImpl Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getAnalysis() + * @generated + */ + int ANALYSIS = 0; + + /** + * The feature id for the 'Release Date' attribute. + * + * + * @generated + * @ordered + */ + int ANALYSIS__RELEASE_DATE = 0; + + /** + * The feature id for the 'Exclusion' attribute. + * + * + * @generated + * @ordered + */ + int ANALYSIS__EXCLUSION = 1; + + /** + * The feature id for the 'Levels' attribute list. + * + * + * @generated + * @ordered + */ + int ANALYSIS__LEVELS = 2; + + /** + * The feature id for the 'Aggregation' reference. + * + * + * @generated + * @ordered + */ + int ANALYSIS__AGGREGATION = 3; + + /** + * The feature id for the 'Contributions' containment reference list. + * + * + * @generated + * @ordered + */ + int ANALYSIS__CONTRIBUTIONS = 4; + + /** + * The number of structural features of the 'Analysis' class. + * + * + * @generated + * @ordered + */ + int ANALYSIS_FEATURE_COUNT = 5; + + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl Contribution Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getContributionAnalysis() + * @generated + */ + int CONTRIBUTION_ANALYSIS = 1; + + /** + * The feature id for the 'Label' attribute. + * + * + * @generated + * @ordered + */ + int CONTRIBUTION_ANALYSIS__LABEL = 0; + + /** + * The feature id for the 'Dominant' attribute. + * + * + * @generated + * @ordered + */ + int CONTRIBUTION_ANALYSIS__DOMINANT = 1; + + /** + * The feature id for the 'Match' attribute. + * + * + * @generated + * @ordered + */ + int CONTRIBUTION_ANALYSIS__MATCH = 2; + + /** + * The feature id for the 'Last Modified' attribute. + * + * + * @generated + * @ordered + */ + int CONTRIBUTION_ANALYSIS__LAST_MODIFIED = 3; + + /** + * The feature id for the 'Contribution' reference. + * + * + * @generated + * @ordered + */ + int CONTRIBUTION_ANALYSIS__CONTRIBUTION = 4; + + /** + * The feature id for the 'Installable Units' containment reference list. + * + * + * @generated + * @ordered + */ + int CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS = 5; + + /** + * The feature id for the 'Projects' containment reference list. + * + * + * @generated + * @ordered + */ + int CONTRIBUTION_ANALYSIS__PROJECTS = 6; + + /** + * The number of structural features of the 'Contribution Analysis' class. + * + * + * @generated + * @ordered + */ + int CONTRIBUTION_ANALYSIS_FEATURE_COUNT = 7; + + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.InstallableUnitAnalysisImpl Installable Unit Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.InstallableUnitAnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getInstallableUnitAnalysis() + * @generated + */ + int INSTALLABLE_UNIT_ANALYSIS = 2; + + /** + * The feature id for the 'Contribution' container reference. + * + * + * @generated + * @ordered + */ + int INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION = 0; + + /** + * The feature id for the 'Installable Unit' reference. + * + * + * @generated + * @ordered + */ + int INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT = 1; + + /** + * The feature id for the 'Requirements' containment reference list. + * + * + * @generated + * @ordered + */ + int INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS = 2; + + /** + * The feature id for the 'Capabilities' containment reference list. + * + * + * @generated + * @ordered + */ + int INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES = 3; + + /** + * The number of structural features of the 'Installable Unit Analysis' class. + * + * + * @generated + * @ordered + */ + int INSTALLABLE_UNIT_ANALYSIS_FEATURE_COUNT = 4; + + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementAnalysisImpl Requirement Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementAnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getRequirementAnalysis() + * @generated + */ + int REQUIREMENT_ANALYSIS = 3; + + /** + * The feature id for the 'Installable Unit' container reference. + * + * + * @generated + * @ordered + */ + int REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT = 0; + + /** + * The feature id for the 'Requirement' reference. + * + * + * @generated + * @ordered + */ + int REQUIREMENT_ANALYSIS__REQUIREMENT = 1; + + /** + * The feature id for the 'Resolutions' containment reference list. + * + * + * @generated + * @ordered + */ + int REQUIREMENT_ANALYSIS__RESOLUTIONS = 2; + + /** + * The number of structural features of the 'Requirement Analysis' class. + * + * + * @generated + * @ordered + */ + int REQUIREMENT_ANALYSIS_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementResolutionImpl Requirement Resolution}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementResolutionImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getRequirementResolution() + * @generated + */ + int REQUIREMENT_RESOLUTION = 4; + + /** + * The feature id for the 'Requirement' container reference. + * + * + * @generated + * @ordered + */ + int REQUIREMENT_RESOLUTION__REQUIREMENT = 0; + + /** + * The feature id for the 'Installable Unit' reference. + * + * + * @generated + * @ordered + */ + int REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT = 1; + + /** + * The feature id for the 'Capability' reference. + * + * + * @generated + * @ordered + */ + int REQUIREMENT_RESOLUTION__CAPABILITY = 2; + + /** + * The number of structural features of the 'Requirement Resolution' class. + * + * + * @generated + * @ordered + */ + int REQUIREMENT_RESOLUTION_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityAnalysisImpl Capability Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityAnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getCapabilityAnalysis() + * @generated + */ + int CAPABILITY_ANALYSIS = 5; + + /** + * The feature id for the 'Installable Unit' container reference. + * + * + * @generated + * @ordered + */ + int CAPABILITY_ANALYSIS__INSTALLABLE_UNIT = 0; + + /** + * The feature id for the 'Capability' reference. + * + * + * @generated + * @ordered + */ + int CAPABILITY_ANALYSIS__CAPABILITY = 1; + + /** + * The feature id for the 'Resolutions' containment reference list. + * + * + * @generated + * @ordered + */ + int CAPABILITY_ANALYSIS__RESOLUTIONS = 2; + + /** + * The number of structural features of the 'Capability Analysis' class. + * + * + * @generated + * @ordered + */ + int CAPABILITY_ANALYSIS_FEATURE_COUNT = 3; + + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityResolutionImpl Capability Resolution}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityResolutionImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getCapabilityResolution() + * @generated + */ + int CAPABILITY_RESOLUTION = 6; + + /** + * The feature id for the 'Capability' container reference. + * + * + * @generated + * @ordered + */ + int CAPABILITY_RESOLUTION__CAPABILITY = 0; + + /** + * The feature id for the 'Requirement' reference. + * + * + * @generated + * @ordered + */ + int CAPABILITY_RESOLUTION__REQUIREMENT = 1; + + /** + * The number of structural features of the 'Capability Resolution' class. + * + * + * @generated + * @ordered + */ + int CAPABILITY_RESOLUTION_FEATURE_COUNT = 2; + + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl Project}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getProject() + * @generated + */ + int PROJECT = 7; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int PROJECT__NAME = 0; + + /** + * The feature id for the 'Site' attribute. + * + * + * @generated + * @ordered + */ + int PROJECT__SITE = 1; + + /** + * The feature id for the 'Version' attribute. + * + * + * @generated + * @ordered + */ + int PROJECT__VERSION = 2; + + /** + * The feature id for the 'Release Date' attribute. + * + * + * @generated + * @ordered + */ + int PROJECT__RELEASE_DATE = 3; + + /** + * The feature id for the 'Contribution' reference. + * + * + * @generated + * @ordered + */ + int PROJECT__CONTRIBUTION = 4; + + /** + * The feature id for the 'Parent' container reference. + * + * + * @generated + * @ordered + */ + int PROJECT__PARENT = 5; + + /** + * The feature id for the 'Repositories' containment reference list. + * + * + * @generated + * @ordered + */ + int PROJECT__REPOSITORIES = 6; + + /** + * The feature id for the 'Subprojects' containment reference list. + * + * + * @generated + * @ordered + */ + int PROJECT__SUBPROJECTS = 7; + + /** + * The number of structural features of the 'Project' class. + * + * + * @generated + * @ordered + */ + int PROJECT_FEATURE_COUNT = 8; + + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.GitRepositoryImpl Git Repository}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.GitRepositoryImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getGitRepository() + * @generated + */ + int GIT_REPOSITORY = 8; + + /** + * The feature id for the 'URI' attribute. + * + * + * @generated + * @ordered + */ + int GIT_REPOSITORY__URI = 0; + + /** + * The feature id for the 'Last Modified' attribute. + * + * + * @generated + * @ordered + */ + int GIT_REPOSITORY__LAST_MODIFIED = 1; + + /** + * The feature id for the 'Project' container reference. + * + * + * @generated + * @ordered + */ + int GIT_REPOSITORY__PROJECT = 2; + + /** + * The number of structural features of the 'Git Repository' class. + * + * + * @generated + * @ordered + */ + int GIT_REPOSITORY_FEATURE_COUNT = 3; + + /** + * The meta object id for the 'Pattern' data type. + * + * + * @see java.util.regex.Pattern + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getPattern() + * @generated + */ + int PATTERN = 9; + + /** + * The meta object id for the 'URI' data type. + * + * + * @see org.eclipse.emf.common.util.URI + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getURI() + * @generated + */ + int URI = 10; + + /** + * The meta object id for the 'Date' data type. + * + * + * @see java.util.Date + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getDate() + * @generated + */ + int DATE = 11; + + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis Analysis}'. + * + * + * @return the meta object for class 'Analysis'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis + * @generated + */ + EClass getAnalysis(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getReleaseDate Release Date}'. + * + * + * @return the meta object for the attribute 'Release Date'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getReleaseDate() + * @see #getAnalysis() + * @generated + */ + EAttribute getAnalysis_ReleaseDate(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getExclusion Exclusion}'. + * + * + * @return the meta object for the attribute 'Exclusion'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getExclusion() + * @see #getAnalysis() + * @generated + */ + EAttribute getAnalysis_Exclusion(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getLevels Levels}'. + * + * + * @return the meta object for the attribute list 'Levels'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getLevels() + * @see #getAnalysis() + * @generated + */ + EAttribute getAnalysis_Levels(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getAggregation Aggregation}'. + * + * + * @return the meta object for the reference 'Aggregation'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getAggregation() + * @see #getAnalysis() + * @generated + */ + EReference getAnalysis_Aggregation(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getContributions Contributions}'. + * + * + * @return the meta object for the containment reference list 'Contributions'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis#getContributions() + * @see #getAnalysis() + * @generated + */ + EReference getAnalysis_Contributions(); + + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis Contribution Analysis}'. + * + * + * @return the meta object for class 'Contribution Analysis'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis + * @generated + */ + EClass getContributionAnalysis(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getLabel Label}'. + * + * + * @return the meta object for the attribute 'Label'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getLabel() + * @see #getContributionAnalysis() + * @generated + */ + EAttribute getContributionAnalysis_Label(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#isDominant Dominant}'. + * + * + * @return the meta object for the attribute 'Dominant'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#isDominant() + * @see #getContributionAnalysis() + * @generated + */ + EAttribute getContributionAnalysis_Dominant(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getMatch Match}'. + * + * + * @return the meta object for the attribute 'Match'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getMatch() + * @see #getContributionAnalysis() + * @generated + */ + EAttribute getContributionAnalysis_Match(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getLastModified Last Modified}'. + * + * + * @return the meta object for the attribute 'Last Modified'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getLastModified() + * @see #getContributionAnalysis() + * @generated + */ + EAttribute getContributionAnalysis_LastModified(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getContribution Contribution}'. + * + * + * @return the meta object for the reference 'Contribution'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getContribution() + * @see #getContributionAnalysis() + * @generated + */ + EReference getContributionAnalysis_Contribution(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getInstallableUnits Installable Units}'. + * + * + * @return the meta object for the containment reference list 'Installable Units'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getInstallableUnits() + * @see #getContributionAnalysis() + * @generated + */ + EReference getContributionAnalysis_InstallableUnits(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getProjects Projects}'. + * + * + * @return the meta object for the containment reference list 'Projects'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getProjects() + * @see #getContributionAnalysis() + * @generated + */ + EReference getContributionAnalysis_Projects(); + + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis Installable Unit Analysis}'. + * + * + * @return the meta object for class 'Installable Unit Analysis'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis + * @generated + */ + EClass getInstallableUnitAnalysis(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getContribution Contribution}'. + * + * + * @return the meta object for the container reference 'Contribution'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getContribution() + * @see #getInstallableUnitAnalysis() + * @generated + */ + EReference getInstallableUnitAnalysis_Contribution(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getInstallableUnit Installable Unit}'. + * + * + * @return the meta object for the reference 'Installable Unit'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getInstallableUnit() + * @see #getInstallableUnitAnalysis() + * @generated + */ + EReference getInstallableUnitAnalysis_InstallableUnit(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getRequirements Requirements}'. + * + * + * @return the meta object for the containment reference list 'Requirements'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getRequirements() + * @see #getInstallableUnitAnalysis() + * @generated + */ + EReference getInstallableUnitAnalysis_Requirements(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getCapabilities Capabilities}'. + * + * + * @return the meta object for the containment reference list 'Capabilities'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getCapabilities() + * @see #getInstallableUnitAnalysis() + * @generated + */ + EReference getInstallableUnitAnalysis_Capabilities(); + + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis Requirement Analysis}'. + * + * + * @return the meta object for class 'Requirement Analysis'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis + * @generated + */ + EClass getRequirementAnalysis(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getRequirement Requirement}'. + * + * + * @return the meta object for the reference 'Requirement'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getRequirement() + * @see #getRequirementAnalysis() + * @generated + */ + EReference getRequirementAnalysis_Requirement(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getInstallableUnit Installable Unit}'. + * + * + * @return the meta object for the container reference 'Installable Unit'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getInstallableUnit() + * @see #getRequirementAnalysis() + * @generated + */ + EReference getRequirementAnalysis_InstallableUnit(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getResolutions Resolutions}'. + * + * + * @return the meta object for the containment reference list 'Resolutions'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getResolutions() + * @see #getRequirementAnalysis() + * @generated + */ + EReference getRequirementAnalysis_Resolutions(); + + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution Requirement Resolution}'. + * + * + * @return the meta object for class 'Requirement Resolution'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution + * @generated + */ + EClass getRequirementResolution(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getRequirement Requirement}'. + * + * + * @return the meta object for the container reference 'Requirement'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getRequirement() + * @see #getRequirementResolution() + * @generated + */ + EReference getRequirementResolution_Requirement(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getInstallableUnit Installable Unit}'. + * + * + * @return the meta object for the reference 'Installable Unit'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getInstallableUnit() + * @see #getRequirementResolution() + * @generated + */ + EReference getRequirementResolution_InstallableUnit(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getCapability Capability}'. + * + * + * @return the meta object for the reference 'Capability'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getCapability() + * @see #getRequirementResolution() + * @generated + */ + EReference getRequirementResolution_Capability(); + + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis Capability Analysis}'. + * + * + * @return the meta object for class 'Capability Analysis'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis + * @generated + */ + EClass getCapabilityAnalysis(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getInstallableUnit Installable Unit}'. + * + * + * @return the meta object for the container reference 'Installable Unit'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getInstallableUnit() + * @see #getCapabilityAnalysis() + * @generated + */ + EReference getCapabilityAnalysis_InstallableUnit(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getCapability Capability}'. + * + * + * @return the meta object for the reference 'Capability'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getCapability() + * @see #getCapabilityAnalysis() + * @generated + */ + EReference getCapabilityAnalysis_Capability(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getResolutions Resolutions}'. + * + * + * @return the meta object for the containment reference list 'Resolutions'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getResolutions() + * @see #getCapabilityAnalysis() + * @generated + */ + EReference getCapabilityAnalysis_Resolutions(); + + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution Capability Resolution}'. + * + * + * @return the meta object for class 'Capability Resolution'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution + * @generated + */ + EClass getCapabilityResolution(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getCapability Capability}'. + * + * + * @return the meta object for the container reference 'Capability'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getCapability() + * @see #getCapabilityResolution() + * @generated + */ + EReference getCapabilityResolution_Capability(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getRequirement Requirement}'. + * + * + * @return the meta object for the reference 'Requirement'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getRequirement() + * @see #getCapabilityResolution() + * @generated + */ + EReference getCapabilityResolution_Requirement(); + + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project Project}'. + * + * + * @return the meta object for class 'Project'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project + * @generated + */ + EClass getProject(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getName() + * @see #getProject() + * @generated + */ + EAttribute getProject_Name(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getSite Site}'. + * + * + * @return the meta object for the attribute 'Site'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getSite() + * @see #getProject() + * @generated + */ + EAttribute getProject_Site(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getVersion Version}'. + * + * + * @return the meta object for the attribute 'Version'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getVersion() + * @see #getProject() + * @generated + */ + EAttribute getProject_Version(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getReleaseDate Release Date}'. + * + * + * @return the meta object for the attribute 'Release Date'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getReleaseDate() + * @see #getProject() + * @generated + */ + EAttribute getProject_ReleaseDate(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getContribution Contribution}'. + * + * + * @return the meta object for the reference 'Contribution'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getContribution() + * @see #getProject() + * @generated + */ + EReference getProject_Contribution(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getParent Parent}'. + * + * + * @return the meta object for the container reference 'Parent'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getParent() + * @see #getProject() + * @generated + */ + EReference getProject_Parent(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getRepositories Repositories}'. + * + * + * @return the meta object for the containment reference list 'Repositories'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getRepositories() + * @see #getProject() + * @generated + */ + EReference getProject_Repositories(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getSubprojects Subprojects}'. + * + * + * @return the meta object for the containment reference list 'Subprojects'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getSubprojects() + * @see #getProject() + * @generated + */ + EReference getProject_Subprojects(); + + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository Git Repository}'. + * + * + * @return the meta object for class 'Git Repository'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository + * @generated + */ + EClass getGitRepository(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getURI URI}'. + * + * + * @return the meta object for the attribute 'URI'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getURI() + * @see #getGitRepository() + * @generated + */ + EAttribute getGitRepository_URI(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getLastModified Last Modified}'. + * + * + * @return the meta object for the attribute 'Last Modified'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getLastModified() + * @see #getGitRepository() + * @generated + */ + EAttribute getGitRepository_LastModified(); + + /** + * Returns the meta object for the container reference '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getProject Project}'. + * + * + * @return the meta object for the container reference 'Project'. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getProject() + * @see #getGitRepository() + * @generated + */ + EReference getGitRepository_Project(); + + /** + * Returns the meta object for data type '{@link java.util.regex.Pattern Pattern}'. + * + * + * @return the meta object for data type 'Pattern'. + * @see java.util.regex.Pattern + * @model instanceClass="java.util.regex.Pattern" + * @generated + */ + EDataType getPattern(); + + /** + * Returns the meta object for data type '{@link org.eclipse.emf.common.util.URI URI}'. + * + * + * @return the meta object for data type 'URI'. + * @see org.eclipse.emf.common.util.URI + * @model instanceClass="org.eclipse.emf.common.util.URI" + * @generated + */ + EDataType getURI(); + + /** + * Returns the meta object for data type '{@link java.util.Date Date}'. + * + * + * @return the meta object for data type 'Date'. + * @see java.util.Date + * @model instanceClass="java.util.Date" + * @generated + */ + EDataType getDate(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + AnalyzerFactory getAnalyzerFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalysisImpl Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getAnalysis() + * @generated + */ + EClass ANALYSIS = eINSTANCE.getAnalysis(); + + /** + * The meta object literal for the 'Release Date' attribute feature. + * + * + * @generated + */ + EAttribute ANALYSIS__RELEASE_DATE = eINSTANCE.getAnalysis_ReleaseDate(); + + /** + * The meta object literal for the 'Exclusion' attribute feature. + * + * + * @generated + */ + EAttribute ANALYSIS__EXCLUSION = eINSTANCE.getAnalysis_Exclusion(); + + /** + * The meta object literal for the 'Levels' attribute list feature. + * + * + * @generated + */ + EAttribute ANALYSIS__LEVELS = eINSTANCE.getAnalysis_Levels(); + + /** + * The meta object literal for the 'Aggregation' reference feature. + * + * + * @generated + */ + EReference ANALYSIS__AGGREGATION = eINSTANCE.getAnalysis_Aggregation(); + + /** + * The meta object literal for the 'Contributions' containment reference list feature. + * + * + * @generated + */ + EReference ANALYSIS__CONTRIBUTIONS = eINSTANCE.getAnalysis_Contributions(); + + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl Contribution Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getContributionAnalysis() + * @generated + */ + EClass CONTRIBUTION_ANALYSIS = eINSTANCE.getContributionAnalysis(); + + /** + * The meta object literal for the 'Label' attribute feature. + * + * + * @generated + */ + EAttribute CONTRIBUTION_ANALYSIS__LABEL = eINSTANCE.getContributionAnalysis_Label(); + + /** + * The meta object literal for the 'Dominant' attribute feature. + * + * + * @generated + */ + EAttribute CONTRIBUTION_ANALYSIS__DOMINANT = eINSTANCE.getContributionAnalysis_Dominant(); + + /** + * The meta object literal for the 'Match' attribute feature. + * + * + * @generated + */ + EAttribute CONTRIBUTION_ANALYSIS__MATCH = eINSTANCE.getContributionAnalysis_Match(); + + /** + * The meta object literal for the 'Last Modified' attribute feature. + * + * + * @generated + */ + EAttribute CONTRIBUTION_ANALYSIS__LAST_MODIFIED = eINSTANCE.getContributionAnalysis_LastModified(); + + /** + * The meta object literal for the 'Contribution' reference feature. + * + * + * @generated + */ + EReference CONTRIBUTION_ANALYSIS__CONTRIBUTION = eINSTANCE.getContributionAnalysis_Contribution(); + + /** + * The meta object literal for the 'Installable Units' containment reference list feature. + * + * + * @generated + */ + EReference CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS = eINSTANCE.getContributionAnalysis_InstallableUnits(); + + /** + * The meta object literal for the 'Projects' containment reference list feature. + * + * + * @generated + */ + EReference CONTRIBUTION_ANALYSIS__PROJECTS = eINSTANCE.getContributionAnalysis_Projects(); + + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.InstallableUnitAnalysisImpl Installable Unit Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.InstallableUnitAnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getInstallableUnitAnalysis() + * @generated + */ + EClass INSTALLABLE_UNIT_ANALYSIS = eINSTANCE.getInstallableUnitAnalysis(); + + /** + * The meta object literal for the 'Contribution' container reference feature. + * + * + * @generated + */ + EReference INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION = eINSTANCE.getInstallableUnitAnalysis_Contribution(); + + /** + * The meta object literal for the 'Installable Unit' reference feature. + * + * + * @generated + */ + EReference INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT = eINSTANCE.getInstallableUnitAnalysis_InstallableUnit(); + + /** + * The meta object literal for the 'Requirements' containment reference list feature. + * + * + * @generated + */ + EReference INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS = eINSTANCE.getInstallableUnitAnalysis_Requirements(); + + /** + * The meta object literal for the 'Capabilities' containment reference list feature. + * + * + * @generated + */ + EReference INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES = eINSTANCE.getInstallableUnitAnalysis_Capabilities(); + + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementAnalysisImpl Requirement Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementAnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getRequirementAnalysis() + * @generated + */ + EClass REQUIREMENT_ANALYSIS = eINSTANCE.getRequirementAnalysis(); + + /** + * The meta object literal for the 'Requirement' reference feature. + * + * + * @generated + */ + EReference REQUIREMENT_ANALYSIS__REQUIREMENT = eINSTANCE.getRequirementAnalysis_Requirement(); + + /** + * The meta object literal for the 'Installable Unit' container reference feature. + * + * + * @generated + */ + EReference REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT = eINSTANCE.getRequirementAnalysis_InstallableUnit(); + + /** + * The meta object literal for the 'Resolutions' containment reference list feature. + * + * + * @generated + */ + EReference REQUIREMENT_ANALYSIS__RESOLUTIONS = eINSTANCE.getRequirementAnalysis_Resolutions(); + + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementResolutionImpl Requirement Resolution}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementResolutionImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getRequirementResolution() + * @generated + */ + EClass REQUIREMENT_RESOLUTION = eINSTANCE.getRequirementResolution(); + + /** + * The meta object literal for the 'Requirement' container reference feature. + * + * + * @generated + */ + EReference REQUIREMENT_RESOLUTION__REQUIREMENT = eINSTANCE.getRequirementResolution_Requirement(); + + /** + * The meta object literal for the 'Installable Unit' reference feature. + * + * + * @generated + */ + EReference REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT = eINSTANCE.getRequirementResolution_InstallableUnit(); + + /** + * The meta object literal for the 'Capability' reference feature. + * + * + * @generated + */ + EReference REQUIREMENT_RESOLUTION__CAPABILITY = eINSTANCE.getRequirementResolution_Capability(); + + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityAnalysisImpl Capability Analysis}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityAnalysisImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getCapabilityAnalysis() + * @generated + */ + EClass CAPABILITY_ANALYSIS = eINSTANCE.getCapabilityAnalysis(); + + /** + * The meta object literal for the 'Installable Unit' container reference feature. + * + * + * @generated + */ + EReference CAPABILITY_ANALYSIS__INSTALLABLE_UNIT = eINSTANCE.getCapabilityAnalysis_InstallableUnit(); + + /** + * The meta object literal for the 'Capability' reference feature. + * + * + * @generated + */ + EReference CAPABILITY_ANALYSIS__CAPABILITY = eINSTANCE.getCapabilityAnalysis_Capability(); + + /** + * The meta object literal for the 'Resolutions' containment reference list feature. + * + * + * @generated + */ + EReference CAPABILITY_ANALYSIS__RESOLUTIONS = eINSTANCE.getCapabilityAnalysis_Resolutions(); + + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityResolutionImpl Capability Resolution}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityResolutionImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getCapabilityResolution() + * @generated + */ + EClass CAPABILITY_RESOLUTION = eINSTANCE.getCapabilityResolution(); + + /** + * The meta object literal for the 'Capability' container reference feature. + * + * + * @generated + */ + EReference CAPABILITY_RESOLUTION__CAPABILITY = eINSTANCE.getCapabilityResolution_Capability(); + + /** + * The meta object literal for the 'Requirement' reference feature. + * + * + * @generated + */ + EReference CAPABILITY_RESOLUTION__REQUIREMENT = eINSTANCE.getCapabilityResolution_Requirement(); + + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl Project}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getProject() + * @generated + */ + EClass PROJECT = eINSTANCE.getProject(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute PROJECT__NAME = eINSTANCE.getProject_Name(); + + /** + * The meta object literal for the 'Site' attribute feature. + * + * + * @generated + */ + EAttribute PROJECT__SITE = eINSTANCE.getProject_Site(); + + /** + * The meta object literal for the 'Version' attribute feature. + * + * + * @generated + */ + EAttribute PROJECT__VERSION = eINSTANCE.getProject_Version(); + + /** + * The meta object literal for the 'Release Date' attribute feature. + * + * + * @generated + */ + EAttribute PROJECT__RELEASE_DATE = eINSTANCE.getProject_ReleaseDate(); + + /** + * The meta object literal for the 'Contribution' reference feature. + * + * + * @generated + */ + EReference PROJECT__CONTRIBUTION = eINSTANCE.getProject_Contribution(); + + /** + * The meta object literal for the 'Parent' container reference feature. + * + * + * @generated + */ + EReference PROJECT__PARENT = eINSTANCE.getProject_Parent(); + + /** + * The meta object literal for the 'Repositories' containment reference list feature. + * + * + * @generated + */ + EReference PROJECT__REPOSITORIES = eINSTANCE.getProject_Repositories(); + + /** + * The meta object literal for the 'Subprojects' containment reference list feature. + * + * + * @generated + */ + EReference PROJECT__SUBPROJECTS = eINSTANCE.getProject_Subprojects(); + + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.GitRepositoryImpl Git Repository}' class. + * + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.GitRepositoryImpl + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getGitRepository() + * @generated + */ + EClass GIT_REPOSITORY = eINSTANCE.getGitRepository(); + + /** + * The meta object literal for the 'URI' attribute feature. + * + * + * @generated + */ + EAttribute GIT_REPOSITORY__URI = eINSTANCE.getGitRepository_URI(); + + /** + * The meta object literal for the 'Last Modified' attribute feature. + * + * + * @generated + */ + EAttribute GIT_REPOSITORY__LAST_MODIFIED = eINSTANCE.getGitRepository_LastModified(); + + /** + * The meta object literal for the 'Project' container reference feature. + * + * + * @generated + */ + EReference GIT_REPOSITORY__PROJECT = eINSTANCE.getGitRepository_Project(); + + /** + * The meta object literal for the 'Pattern' data type. + * + * + * @see java.util.regex.Pattern + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getPattern() + * @generated + */ + EDataType PATTERN = eINSTANCE.getPattern(); + + /** + * The meta object literal for the 'URI' data type. + * + * + * @see org.eclipse.emf.common.util.URI + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getURI() + * @generated + */ + EDataType URI = eINSTANCE.getURI(); + + /** + * The meta object literal for the 'Date' data type. + * + * + * @see java.util.Date + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalyzerPackageImpl#getDate() + * @generated + */ + EDataType DATE = eINSTANCE.getDate(); + + } + +} //AnalyzerPackage diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/CapabilityAnalysis.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/CapabilityAnalysis.java new file mode 100644 index 000000000..b6e83733a --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/CapabilityAnalysis.java @@ -0,0 +1,100 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.equinox.p2.metadata.IProvidedCapability; + +/** + * + * A representation of the model object 'Capability Analysis'. + * + * + * + * A wrapper of a capability. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getInstallableUnit Installable Unit}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getCapability Capability}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getResolutions Resolutions}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getCapabilityAnalysis() + * @model + * @generated + */ +public interface CapabilityAnalysis extends EObject { + /** + * Returns the value of the 'Installable Unit' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getCapabilities Capabilities}'. + * + * + * @return the value of the 'Installable Unit' container reference. + * @see #setInstallableUnit(InstallableUnitAnalysis) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getCapabilityAnalysis_InstallableUnit() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getCapabilities + * @model opposite="capabilities" transient="false" + * @generated + */ + InstallableUnitAnalysis getInstallableUnit(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getInstallableUnit Installable Unit}' container reference. + * + * + * @param value the new value of the 'Installable Unit' container reference. + * @see #getInstallableUnit() + * @generated + */ + void setInstallableUnit(InstallableUnitAnalysis value); + + /** + * Returns the value of the 'Capability' reference. + * + * + * @return the value of the 'Capability' reference. + * @see #setCapability(IProvidedCapability) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getCapabilityAnalysis_Capability() + * @model type="org.eclipse.cbi.p2repo.p2.IProvidedCapability" required="true" + * @generated + */ + IProvidedCapability getCapability(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getCapability Capability}' reference. + * + * + * @param value the new value of the 'Capability' reference. + * @see #getCapability() + * @generated + */ + void setCapability(IProvidedCapability value); + + /** + * Returns the value of the 'Resolutions' containment reference list. + * The list contents are of type {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution}. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getCapability Capability}'. + * + * + * @return the value of the 'Resolutions' containment reference list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getCapabilityAnalysis_Resolutions() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getCapability + * @model opposite="capability" containment="true" + * @generated + */ + EList getResolutions(); + +} // CapabilityAnalysis diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/CapabilityResolution.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/CapabilityResolution.java new file mode 100644 index 000000000..1a58dd7ab --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/CapabilityResolution.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import java.util.Comparator; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.equinox.p2.metadata.IRequirement; + +/** + * + * A representation of the model object 'Capability Resolution'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getCapability Capability}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getRequirement Requirement}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getCapabilityResolution() + * @model + * @generated + */ +public interface CapabilityResolution extends EObject { + + Comparator CAPABILITY_RESOLUTION_COMPARATOR = new Comparator() { + public int compare(CapabilityResolution cr1, CapabilityResolution cr2) { + RequirementAnalysis ra1 = cr1.getRequirement(); + RequirementAnalysis ra2 = cr2.getRequirement(); + InstallableUnitAnalysis iua1 = ra1.getInstallableUnit(); + InstallableUnitAnalysis iua2 = ra2.getInstallableUnit(); + int result = InstallableUnitAnalysis.INSTALLABLE_UNIT_ANALYIS_COMPARATOR.compare(iua1, iua2); + if (result == 0) { + IRequirement r1 = ra1.getRequirement(); + IRequirement r2 = ra2.getRequirement(); + result = RequirementAnalysis.REQUIREMENT_COMPARATOR.compare(r1, r2); + } + return result; + } + }; + + /** + * Returns the value of the 'Capability' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getResolutions Resolutions}'. + * + * + * @return the value of the 'Capability' container reference. + * @see #setCapability(CapabilityAnalysis) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getCapabilityResolution_Capability() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getResolutions + * @model opposite="resolutions" transient="false" + * @generated + */ + CapabilityAnalysis getCapability(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getCapability Capability}' container reference. + * + * + * @param value the new value of the 'Capability' container reference. + * @see #getCapability() + * @generated + */ + void setCapability(CapabilityAnalysis value); + + /** + * Returns the value of the 'Requirement' reference. + * + * + * @return the value of the 'Requirement' reference. + * @see #setRequirement(RequirementAnalysis) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getCapabilityResolution_Requirement() + * @model required="true" + * @generated + */ + RequirementAnalysis getRequirement(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution#getRequirement Requirement}' reference. + * + * + * @param value the new value of the 'Requirement' reference. + * @see #getRequirement() + * @generated + */ + void setRequirement(RequirementAnalysis value); + +} // CapabilityResolution diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/ContributionAnalysis.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/ContributionAnalysis.java new file mode 100644 index 000000000..435a77fb9 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/ContributionAnalysis.java @@ -0,0 +1,194 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import java.util.regex.Pattern; + +import org.eclipse.cbi.p2repo.aggregator.Contribution; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Contribution Analysis'. + * + * + * + * A wrapper of a contribution. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getLabel Label}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#isDominant Dominant}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getMatch Match}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getLastModified Last Modified}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getContribution Contribution}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getInstallableUnits Installable Units}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getProjects Projects}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getContributionAnalysis() + * @model + * @generated + */ +public interface ContributionAnalysis extends EObject { + /** + * Returns the value of the 'Label' attribute. + * + * + * + * The contribution's label override. + * + * @return the value of the 'Label' attribute. + * @see #setLabel(String) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getContributionAnalysis_Label() + * @model + * @generated + */ + String getLabel(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getLabel Label}' attribute. + * + * + * @param value the new value of the 'Label' attribute. + * @see #getLabel() + * @generated + */ + void setLabel(String value); + + /** + * Returns the value of the 'Dominant' attribute. + * + * + * @return the value of the 'Dominant' attribute. + * @see #setDominant(boolean) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getContributionAnalysis_Dominant() + * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean" + * @generated + */ + boolean isDominant(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#isDominant Dominant}' attribute. + * + * + * @param value the new value of the 'Dominant' attribute. + * @see #isDominant() + * @generated + */ + void setDominant(boolean value); + + /** + * Returns the value of the 'Match' attribute. + * + * + * @return the value of the 'Match' attribute. + * @see #setMatch(Pattern) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getContributionAnalysis_Match() + * @model dataType="org.eclipse.cbi.p2repo.aggregator.analyzer.Pattern" + * @generated + */ + Pattern getMatch(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getMatch Match}' attribute. + * + * + * @param value the new value of the 'Match' attribute. + * @see #getMatch() + * @generated + */ + void setMatch(Pattern value); + + /** + * Returns the value of the 'Last Modified' attribute. + * The default value is "-9223372036854775808". + * + * + * + * The last time in millis that this contribution was modified + * + * @return the value of the 'Last Modified' attribute. + * @see #setLastModified(long) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getContributionAnalysis_LastModified() + * @model default="-9223372036854775808" transient="true" + * @generated + */ + long getLastModified(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getLastModified Last Modified}' attribute. + * + * + * @param value the new value of the 'Last Modified' attribute. + * @see #getLastModified() + * @generated + */ + void setLastModified(long value); + + /** + * Returns the value of the 'Contribution' reference. + * + * + * + * The analyzed contribution. + * + * @return the value of the 'Contribution' reference. + * @see #setContribution(Contribution) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getContributionAnalysis_Contribution() + * @model required="true" + * @generated + */ + Contribution getContribution(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getContribution Contribution}' reference. + * + * + * @param value the new value of the 'Contribution' reference. + * @see #getContribution() + * @generated + */ + void setContribution(Contribution value); + + /** + * Returns the value of the 'Installable Units' containment reference list. + * The list contents are of type {@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis}. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getContribution Contribution}'. + * + * + * @return the value of the 'Installable Units' containment reference list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getContributionAnalysis_InstallableUnits() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getContribution + * @model opposite="contribution" containment="true" + * extendedMetaData="kind='element' name='installableUnit'" + * @generated + */ + EList getInstallableUnits(); + + /** + * Returns the value of the 'Projects' containment reference list. + * The list contents are of type {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project}. + * + * + * @return the value of the 'Projects' containment reference list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getContributionAnalysis_Projects() + * @model containment="true" + * extendedMetaData="kind='element' name='project'" + * @generated + */ + EList getProjects(); + +} // ContributionAnalysis diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/GitRepository.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/GitRepository.java new file mode 100644 index 000000000..c00b5cb58 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/GitRepository.java @@ -0,0 +1,97 @@ +/** + * Copyright (c) 2022 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Git Repository'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getURI URI}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getLastModified Last Modified}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getProject Project}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getGitRepository() + * @model + * @generated + */ +public interface GitRepository extends EObject { + /** + * Returns the value of the 'URI' attribute. + * + * + * @return the value of the 'URI' attribute. + * @see #setURI(URI) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getGitRepository_URI() + * @model dataType="org.eclipse.cbi.p2repo.aggregator.analyzer.URI" + * extendedMetaData="name='uri'" + * @generated + */ + URI getURI(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getURI URI}' attribute. + * + * + * @param value the new value of the 'URI' attribute. + * @see #getURI() + * @generated + */ + void setURI(URI value); + + /** + * Returns the value of the 'Last Modified' attribute. + * The default value is "-9223372036854775808". + * + * + * + * The last time in millis of the most recent commit in this Git + * + * @return the value of the 'Last Modified' attribute. + * @see #setLastModified(long) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getGitRepository_LastModified() + * @model default="-9223372036854775808" transient="true" + * @generated + */ + long getLastModified(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getLastModified Last Modified}' attribute. + * + * + * @param value the new value of the 'Last Modified' attribute. + * @see #getLastModified() + * @generated + */ + void setLastModified(long value); + + /** + * Returns the value of the 'Project' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getRepositories Repositories}'. + * + * + * @return the value of the 'Project' container reference. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getGitRepository_Project() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getRepositories + * @model opposite="repositories" resolveProxies="false" changeable="false" + * @generated + */ + Project getProject(); + +} // GitRepository diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/InstallableUnitAnalysis.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/InstallableUnitAnalysis.java new file mode 100644 index 000000000..f4db2a81e --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/InstallableUnitAnalysis.java @@ -0,0 +1,137 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import java.util.Comparator; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; + +/** + * + * A representation of the model object 'Installable Unit Analysis'. + * + * + * + * A wrapper of an installable unit. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getContribution Contribution}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getInstallableUnit Installable Unit}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getRequirements Requirements}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getCapabilities Capabilities}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getInstallableUnitAnalysis() + * @model + * @generated + */ +public interface InstallableUnitAnalysis extends EObject { + + /** + * Compares two {@link InstallableUnitAnalysis} instances by {@link IInstallableUnit#compareTo(IInstallableUnit) comparing} the {@link #getInstallableUnit() underlying} {@link IInstallableUnit}. + */ + Comparator INSTALLABLE_UNIT_ANALYIS_COMPARATOR = new Comparator() { + public int compare(InstallableUnitAnalysis iua1, InstallableUnitAnalysis iua2) { + IInstallableUnit iu1 = iua1.getInstallableUnit(); + IInstallableUnit iu2 = iua2.getInstallableUnit(); + if (iu1 == iu2) { + return 0; + } + if (iu1 == null) { + return -1; + } + return iu1.compareTo(iu2); + } + }; + + /** + * Returns the value of the 'Contribution' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getInstallableUnits Installable Units}'. + * + * + * @return the value of the 'Contribution' container reference. + * @see #setContribution(ContributionAnalysis) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getInstallableUnitAnalysis_Contribution() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis#getInstallableUnits + * @model opposite="installableUnits" transient="false" + * @generated + */ + ContributionAnalysis getContribution(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getContribution Contribution}' container reference. + * + * + * @param value the new value of the 'Contribution' container reference. + * @see #getContribution() + * @generated + */ + void setContribution(ContributionAnalysis value); + + /** + * Returns the value of the 'Installable Unit' reference. + * + * + * @return the value of the 'Installable Unit' reference. + * @see #setInstallableUnit(IInstallableUnit) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getInstallableUnitAnalysis_InstallableUnit() + * @model type="org.eclipse.cbi.p2repo.p2.IInstallableUnit" required="true" + * @generated + */ + IInstallableUnit getInstallableUnit(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getInstallableUnit Installable Unit}' reference. + * + * + * @param value the new value of the 'Installable Unit' reference. + * @see #getInstallableUnit() + * @generated + */ + void setInstallableUnit(IInstallableUnit value); + + /** + * Returns the value of the 'Requirements' containment reference list. + * The list contents are of type {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis}. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getInstallableUnit Installable Unit}'. + * + * + * @return the value of the 'Requirements' containment reference list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getInstallableUnitAnalysis_Requirements() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getInstallableUnit + * @model opposite="installableUnit" containment="true" + * extendedMetaData="kind='element' name='requirement'" + * @generated + */ + EList getRequirements(); + + /** + * Returns the value of the 'Capabilities' containment reference list. + * The list contents are of type {@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis}. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getInstallableUnit Installable Unit}'. + * + * + * @return the value of the 'Capabilities' containment reference list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getInstallableUnitAnalysis_Capabilities() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis#getInstallableUnit + * @model opposite="installableUnit" containment="true" + * extendedMetaData="kind='element' name='capability'" + * @generated + */ + EList getCapabilities(); + +} // InstallableUnitAnalysis diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/Project.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/Project.java new file mode 100644 index 000000000..c81ed0486 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/Project.java @@ -0,0 +1,188 @@ +/** + * Copyright (c) 2022 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import java.util.Date; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Project'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getName Name}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getSite Site}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getVersion Version}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getReleaseDate Release Date}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getContribution Contribution}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getParent Parent}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getRepositories Repositories}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getSubprojects Subprojects}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getProject() + * @model + * @generated + */ +public interface Project extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getProject_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Site' attribute. + * + * + * @return the value of the 'Site' attribute. + * @see #setSite(URI) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getProject_Site() + * @model dataType="org.eclipse.cbi.p2repo.aggregator.analyzer.URI" + * @generated + */ + URI getSite(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getSite Site}' attribute. + * + * + * @param value the new value of the 'Site' attribute. + * @see #getSite() + * @generated + */ + void setSite(URI value); + + /** + * Returns the value of the 'Version' attribute. + * + * + * @return the value of the 'Version' attribute. + * @see #setVersion(URI) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getProject_Version() + * @model dataType="org.eclipse.cbi.p2repo.aggregator.analyzer.URI" + * @generated + */ + URI getVersion(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getVersion Version}' attribute. + * + * + * @param value the new value of the 'Version' attribute. + * @see #getVersion() + * @generated + */ + void setVersion(URI value); + + /** + * Returns the value of the 'Release Date' attribute. + * + * + * + * The date of the version release + * + * @return the value of the 'Release Date' attribute. + * @see #setReleaseDate(Date) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getProject_ReleaseDate() + * @model dataType="org.eclipse.cbi.p2repo.aggregator.analyzer.Date" + * @generated + */ + Date getReleaseDate(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getReleaseDate Release Date}' attribute. + * + * + * @param value the new value of the 'Release Date' attribute. + * @see #getReleaseDate() + * @generated + */ + void setReleaseDate(Date value); + + /** + * Returns the value of the 'Contribution' reference. + * + * + * @return the value of the 'Contribution' reference. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getProject_Contribution() + * @model resolveProxies="false" transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + ContributionAnalysis getContribution(); + + /** + * Returns the value of the 'Parent' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getSubprojects Subprojects}'. + * + * + * @return the value of the 'Parent' container reference. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getProject_Parent() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getSubprojects + * @model opposite="subprojects" resolveProxies="false" changeable="false" + * @generated + */ + Project getParent(); + + /** + * Returns the value of the 'Repositories' containment reference list. + * The list contents are of type {@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository}. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getProject Project}'. + * + * + * @return the value of the 'Repositories' containment reference list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getProject_Repositories() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository#getProject + * @model opposite="project" containment="true" + * extendedMetaData="kind='element' name='repository'" + * @generated + */ + EList getRepositories(); + + /** + * Returns the value of the 'Subprojects' containment reference list. + * The list contents are of type {@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project}. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getParent Parent}'. + * + * + * @return the value of the 'Subprojects' containment reference list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getProject_Subprojects() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.Project#getParent + * @model opposite="parent" containment="true" + * extendedMetaData="kind='element' name='subproject'" + * @generated + */ + EList getSubprojects(); + +} // Project diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/RequirementAnalysis.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/RequirementAnalysis.java new file mode 100644 index 000000000..938257e54 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/RequirementAnalysis.java @@ -0,0 +1,195 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import java.util.Comparator; + +import org.eclipse.emf.common.CommonPlugin; +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability; +import org.eclipse.equinox.internal.p2.metadata.RequiredPropertiesMatch; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.IRequirement; +import org.eclipse.equinox.p2.metadata.VersionRange; +import org.eclipse.equinox.p2.metadata.expression.IFilterExpression; +import org.eclipse.equinox.p2.metadata.expression.IMatchExpression; + +/** + * + * A representation of the model object 'Requirement Analysis'. + * + * + * + * A wrapper of a requirement. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getInstallableUnit Installable Unit}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getRequirement Requirement}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getResolutions Resolutions}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getRequirementAnalysis() + * @model + * @generated + */ +public interface RequirementAnalysis extends EObject { + Comparator REQUIREMENT_ANALYSIS_COMPARATOR = new Comparator() { + public int compare(RequirementAnalysis ra1, RequirementAnalysis ra2) { + if (ra1 == ra2) { + return 0; + } + if (ra1 == null) { + return -1; + } + return REQUIREMENT_COMPARATOR.compare(ra1.getRequirement(), ra2.getRequirement()); + } + + }; + + Comparator REQUIREMENT_COMPARATOR = new Comparator() { + private final Comparator comparator = CommonPlugin.INSTANCE.getComparator(); + + public int compare(IRequirement r1, IRequirement r2) { + if (r1 == r2) { + return 0; + } + if (r1 == null) { + return -1; + } + + int compare; + if (r1 instanceof IRequiredCapability && r2 instanceof IRequiredCapability) { + IRequiredCapability rc1 = (IRequiredCapability) r1; + IRequiredCapability rc2 = (IRequiredCapability) r2; + String namespace1 = rc1.getNamespace(); + String namespace2 = rc2.getNamespace(); + compare = comparator.compare(namespace1, namespace2); + if (compare == 0) { + String name1 = rc1.getName(); + String name2 = rc2.getName(); + compare = comparator.compare(name1, name2); + if (compare == 0) { + VersionRange vr1 = rc1.getRange(); + VersionRange vr2 = rc2.getRange(); + compare = VERSION_RANGE_COMPARAOR.compare(vr1, vr2); + } + } + } else { + IMatchExpression m1 = r1.getMatches(); + IMatchExpression m2 = r2.getMatches(); + if (RequiredPropertiesMatch.isPropertiesMatchRequirement(m1) + && RequiredPropertiesMatch.isPropertiesMatchRequirement(m2)) { + String namespace1 = RequiredPropertiesMatch.extractNamespace(m2); + String namespace2 = RequiredPropertiesMatch.extractNamespace(m2); + compare = comparator.compare(namespace1, namespace2); + if (compare == 0) { + IFilterExpression pm1 = RequiredPropertiesMatch.extractPropertiesMatch(m1); + IFilterExpression pm2 = RequiredPropertiesMatch.extractPropertiesMatch(m2); + compare = pm1.toString().compareTo(pm2.toString()); + } + } else { + compare = r1.getClass().getName().compareTo(r1.getClass().getName()); + } + } + return compare; + } + }; + + Comparator VERSION_RANGE_COMPARAOR = new Comparator() { + public int compare(VersionRange vr1, VersionRange vr2) { + if (vr1 == vr2) { + return 0; + } + if (vr1 == null) { + return -1; + } + + int result = vr1.getMinimum().compareTo(vr1.getMinimum()); + if (result == 0) { + result = Boolean.compare(vr1.getIncludeMinimum(), vr2.getIncludeMinimum()); + if (result == 0) { + result = vr1.getMaximum().compareTo(vr2.getMaximum()); + if (result == 0) { + result = Boolean.compare(vr1.getIncludeMaximum(), vr2.getIncludeMaximum()); + } + } + } + return result; + } + }; + + /** + * Returns the value of the 'Requirement' reference. + * + * + * @return the value of the 'Requirement' reference. + * @see #setRequirement(IRequirement) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getRequirementAnalysis_Requirement() + * @model type="org.eclipse.cbi.p2repo.p2.IRequirement" required="true" + * @generated + */ + IRequirement getRequirement(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getRequirement Requirement}' reference. + * + * + * @param value the new value of the 'Requirement' reference. + * @see #getRequirement() + * @generated + */ + void setRequirement(IRequirement value); + + /** + * Returns the value of the 'Installable Unit' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getRequirements Requirements}'. + * + * + * @return the value of the 'Installable Unit' container reference. + * @see #setInstallableUnit(InstallableUnitAnalysis) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getRequirementAnalysis_InstallableUnit() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis#getRequirements + * @model opposite="requirements" transient="false" + * @generated + */ + InstallableUnitAnalysis getInstallableUnit(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getInstallableUnit Installable Unit}' container reference. + * + * + * @param value the new value of the 'Installable Unit' container reference. + * @see #getInstallableUnit() + * @generated + */ + void setInstallableUnit(InstallableUnitAnalysis value); + + /** + * Returns the value of the 'Resolutions' containment reference list. + * The list contents are of type {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution}. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getRequirement Requirement}'. + * + * + * @return the value of the 'Resolutions' containment reference list. + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getRequirementAnalysis_Resolutions() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getRequirement + * @model opposite="requirement" containment="true" + * extendedMetaData="kind='element' name='resolution'" + * @generated + */ + EList getResolutions(); + +} // RequirementAnalysis diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/RequirementResolution.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/RequirementResolution.java new file mode 100644 index 000000000..0102c8faf --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/RequirementResolution.java @@ -0,0 +1,102 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Requirement Resolution'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getRequirement Requirement}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getInstallableUnit Installable Unit}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getCapability Capability}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getRequirementResolution() + * @model + * @generated + */ +public interface RequirementResolution extends EObject { + /** + * Returns the value of the 'Requirement' container reference. + * It is bidirectional and its opposite is '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getResolutions Resolutions}'. + * + * + * @return the value of the 'Requirement' container reference. + * @see #setRequirement(RequirementAnalysis) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getRequirementResolution_Requirement() + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis#getResolutions + * @model opposite="resolutions" transient="false" + * @generated + */ + RequirementAnalysis getRequirement(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getRequirement Requirement}' container reference. + * + * + * @param value the new value of the 'Requirement' container reference. + * @see #getRequirement() + * @generated + */ + void setRequirement(RequirementAnalysis value); + + /** + * Returns the value of the 'Installable Unit' reference. + * + * + * @return the value of the 'Installable Unit' reference. + * @see #setInstallableUnit(InstallableUnitAnalysis) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getRequirementResolution_InstallableUnit() + * @model required="true" + * @generated + */ + InstallableUnitAnalysis getInstallableUnit(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getInstallableUnit Installable Unit}' reference. + * + * + * @param value the new value of the 'Installable Unit' reference. + * @see #getInstallableUnit() + * @generated + */ + void setInstallableUnit(InstallableUnitAnalysis value); + + /** + * Returns the value of the 'Capability' reference. + * + * + * @return the value of the 'Capability' reference. + * @see #setCapability(CapabilityAnalysis) + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#getRequirementResolution_Capability() + * @model + * @generated + */ + CapabilityAnalysis getCapability(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution#getCapability Capability}' reference. + * + * + * @param value the new value of the 'Capability' reference. + * @see #getCapability() + * @generated + */ + void setCapability(CapabilityAnalysis value); + +} // RequirementResolution diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalysisImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalysisImpl.java new file mode 100644 index 000000000..cd77ea723 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalysisImpl.java @@ -0,0 +1,447 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.regex.Pattern; +import java.util.stream.Collectors; + +import org.eclipse.cbi.p2repo.aggregator.Aggregation; +import org.eclipse.cbi.p2repo.aggregator.Contribution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +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.EObject; +import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecore.util.EDataTypeUniqueEList; +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Analysis'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalysisImpl#getReleaseDate Release Date}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalysisImpl#getExclusion Exclusion}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalysisImpl#getLevels Levels}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalysisImpl#getAggregation Aggregation}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.AnalysisImpl#getContributions Contributions}
  • + *
+ * + * @generated + */ +public class AnalysisImpl extends MinimalEObjectImpl.Container implements Analysis { + /** + * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. + * + * + * @generated + * @ordered + */ + protected int eFlags = 0; + + /** + * The default value of the '{@link #getReleaseDate() Release Date}' attribute. + * + * + * @see #getReleaseDate() + * @generated + * @ordered + */ + protected static final Date RELEASE_DATE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getReleaseDate() Release Date}' attribute. + * + * + * @see #getReleaseDate() + * @generated + * @ordered + */ + protected Date releaseDate = RELEASE_DATE_EDEFAULT; + + /** + * The default value of the '{@link #getExclusion() Exclusion}' attribute. + * + * + * @see #getExclusion() + * @generated + * @ordered + */ + protected static final Pattern EXCLUSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getExclusion() Exclusion}' attribute. + * + * + * @see #getExclusion() + * @generated + * @ordered + */ + protected Pattern exclusion = EXCLUSION_EDEFAULT; + + /** + * The cached value of the '{@link #getLevels() Levels}' attribute list. + * + * + * @see #getLevels() + * @generated + * @ordered + */ + protected EList levels; + + /** + * The cached value of the '{@link #getAggregation() Aggregation}' reference. + * + * + * @see #getAggregation() + * @generated + * @ordered + */ + protected Aggregation aggregation; + + /** + * The cached value of the '{@link #getContributions() Contributions}' containment reference list. + * + * + * @see #getContributions() + * @generated + * @ordered + */ + protected EList contributions; + + /** + * + * + * @generated + */ + protected AnalysisImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnalyzerPackage.Literals.ANALYSIS; + } + + /** + * + * + * @generated + */ + @Override + public Date getReleaseDate() { + return releaseDate; + } + + /** + * + * + * @generated + */ + @Override + public void setReleaseDate(Date newReleaseDate) { + Date oldReleaseDate = releaseDate; + releaseDate = newReleaseDate; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.ANALYSIS__RELEASE_DATE, + oldReleaseDate, releaseDate)); + } + + /** + * + * + * @generated + */ + @Override + public Pattern getExclusion() { + return exclusion; + } + + /** + * + * + * @generated + */ + @Override + public EList getLevels() { + if (levels == null) { + levels = new EDataTypeUniqueEList<>(Integer.class, this, AnalyzerPackage.ANALYSIS__LEVELS); + } + return levels; + } + + /** + * + * + * @generated + */ + @Override + public Aggregation getAggregation() { + if (aggregation != null && ((EObject) aggregation).eIsProxy()) { + InternalEObject oldAggregation = (InternalEObject) aggregation; + aggregation = (Aggregation) eResolveProxy(oldAggregation); + if (aggregation != oldAggregation) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, AnalyzerPackage.ANALYSIS__AGGREGATION, + oldAggregation, aggregation)); + } + } + return aggregation; + } + + /** + * + * + * @generated + */ + public Aggregation basicGetAggregation() { + return aggregation; + } + + /** + * + * + * @generated + */ + @Override + public void setAggregation(Aggregation newAggregation) { + Aggregation oldAggregation = aggregation; + aggregation = newAggregation; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.ANALYSIS__AGGREGATION, oldAggregation, + aggregation)); + } + + /** + * + * + * @generated + */ + @Override + public EList getContributions() { + if (contributions == null) { + contributions = new EObjectContainmentEList<>(ContributionAnalysis.class, this, + AnalyzerPackage.ANALYSIS__CONTRIBUTIONS); + } + return contributions; + } + + /** + * + * + * @generated NOT + */ + @Override + public void reconcile() { + Aggregation aggregation = getAggregation(); + if (!isNullOrProxy(aggregation)) { + EList contributions = getContributions(); + Map contributionMapping = contributions.stream() + .filter(it -> it.getContribution() != null) + .collect(Collectors.toMap(ContributionAnalysis::getContribution, Function.identity())); + List staleContributions = contributionMapping.entrySet().stream() + .filter(it -> isNullOrProxy(it.getKey())).map(Map.Entry::getValue).collect(Collectors.toList()); + List missingContributions = aggregation.getAllContributions(false).stream() + .filter(it -> !isNullOrProxy(it) && !contributionMapping.containsKey(it)).map(it -> { + ContributionAnalysis contribution = AnalyzerFactory.eINSTANCE.createContributionAnalysis(); + contribution.setContribution(it); + return contribution; + }).collect(Collectors.toList()); + contributions.removeAll(staleContributions); + contributions.addAll(missingContributions); + } + } + + private static boolean isNullOrProxy(Object object) { + return object == null || ((EObject) object).eIsProxy(); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.ANALYSIS__CONTRIBUTIONS: + return ((InternalEList) getContributions()).basicRemove(otherEnd, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnalyzerPackage.ANALYSIS__RELEASE_DATE: + return getReleaseDate(); + case AnalyzerPackage.ANALYSIS__EXCLUSION: + return getExclusion(); + case AnalyzerPackage.ANALYSIS__LEVELS: + return getLevels(); + case AnalyzerPackage.ANALYSIS__AGGREGATION: + if (resolve) + return getAggregation(); + return basicGetAggregation(); + case AnalyzerPackage.ANALYSIS__CONTRIBUTIONS: + return getContributions(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnalyzerPackage.ANALYSIS__RELEASE_DATE: + setReleaseDate((Date) newValue); + return; + case AnalyzerPackage.ANALYSIS__EXCLUSION: + setExclusion((Pattern) newValue); + return; + case AnalyzerPackage.ANALYSIS__LEVELS: + getLevels().clear(); + getLevels().addAll((Collection) newValue); + return; + case AnalyzerPackage.ANALYSIS__AGGREGATION: + setAggregation((Aggregation) newValue); + return; + case AnalyzerPackage.ANALYSIS__CONTRIBUTIONS: + getContributions().clear(); + getContributions().addAll((Collection) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnalyzerPackage.ANALYSIS__RELEASE_DATE: + setReleaseDate(RELEASE_DATE_EDEFAULT); + return; + case AnalyzerPackage.ANALYSIS__EXCLUSION: + setExclusion(EXCLUSION_EDEFAULT); + return; + case AnalyzerPackage.ANALYSIS__LEVELS: + getLevels().clear(); + return; + case AnalyzerPackage.ANALYSIS__AGGREGATION: + setAggregation((Aggregation) null); + return; + case AnalyzerPackage.ANALYSIS__CONTRIBUTIONS: + getContributions().clear(); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnalyzerPackage.ANALYSIS__RELEASE_DATE: + return RELEASE_DATE_EDEFAULT == null ? releaseDate != null : !RELEASE_DATE_EDEFAULT.equals(releaseDate); + case AnalyzerPackage.ANALYSIS__EXCLUSION: + return EXCLUSION_EDEFAULT == null ? exclusion != null : !EXCLUSION_EDEFAULT.equals(exclusion); + case AnalyzerPackage.ANALYSIS__LEVELS: + return levels != null && !levels.isEmpty(); + case AnalyzerPackage.ANALYSIS__AGGREGATION: + return aggregation != null; + case AnalyzerPackage.ANALYSIS__CONTRIBUTIONS: + return contributions != null && !contributions.isEmpty(); + default: + return super.eIsSet(featureID); + } + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (releaseDate: "); + result.append(releaseDate); + result.append(", exclusion: "); + result.append(exclusion); + result.append(", levels: "); + result.append(levels); + result.append(')'); + return result.toString(); + } + + /** + * + * + * @generated + */ + @Override + public void setExclusion(Pattern newExclusion) { + Pattern oldExclusion = exclusion; + exclusion = newExclusion; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.ANALYSIS__EXCLUSION, oldExclusion, + exclusion)); + } + +} // AnalysisImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalyzerFactoryImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalyzerFactoryImpl.java new file mode 100644 index 000000000..08ec13f8e --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalyzerFactoryImpl.java @@ -0,0 +1,327 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import java.util.Date; +import java.util.regex.Pattern; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution; +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +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; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class AnalyzerFactoryImpl extends EFactoryImpl implements AnalyzerFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static AnalyzerFactory init() { + try { + AnalyzerFactory theAnalyzerFactory = (AnalyzerFactory) EPackage.Registry.INSTANCE + .getEFactory(AnalyzerPackage.eNS_URI); + if (theAnalyzerFactory != null) { + return theAnalyzerFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new AnalyzerFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public AnalyzerFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case AnalyzerPackage.ANALYSIS: + return createAnalysis(); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS: + return createContributionAnalysis(); + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS: + return createInstallableUnitAnalysis(); + case AnalyzerPackage.REQUIREMENT_ANALYSIS: + return createRequirementAnalysis(); + case AnalyzerPackage.REQUIREMENT_RESOLUTION: + return createRequirementResolution(); + case AnalyzerPackage.CAPABILITY_ANALYSIS: + return createCapabilityAnalysis(); + case AnalyzerPackage.CAPABILITY_RESOLUTION: + return createCapabilityResolution(); + case AnalyzerPackage.PROJECT: + return createProject(); + case AnalyzerPackage.GIT_REPOSITORY: + return createGitRepository(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case AnalyzerPackage.PATTERN: + return createPatternFromString(eDataType, initialValue); + case AnalyzerPackage.URI: + return createURIFromString(eDataType, initialValue); + case AnalyzerPackage.DATE: + return createDateFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException( + "The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case AnalyzerPackage.PATTERN: + return convertPatternToString(eDataType, instanceValue); + case AnalyzerPackage.URI: + return convertURIToString(eDataType, instanceValue); + case AnalyzerPackage.DATE: + return convertDateToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException( + "The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Analysis createAnalysis() { + AnalysisImpl analysis = new AnalysisImpl(); + return analysis; + } + + /** + * + * + * @generated + */ + @Override + public ContributionAnalysis createContributionAnalysis() { + ContributionAnalysisImpl contributionAnalysis = new ContributionAnalysisImpl(); + return contributionAnalysis; + } + + /** + * + * + * @generated + */ + @Override + public InstallableUnitAnalysis createInstallableUnitAnalysis() { + InstallableUnitAnalysisImpl installableUnitAnalysis = new InstallableUnitAnalysisImpl(); + return installableUnitAnalysis; + } + + /** + * + * + * @generated + */ + @Override + public RequirementAnalysis createRequirementAnalysis() { + RequirementAnalysisImpl requirementAnalysis = new RequirementAnalysisImpl(); + return requirementAnalysis; + } + + /** + * + * + * @generated + */ + @Override + public RequirementResolution createRequirementResolution() { + RequirementResolutionImpl requirementResolution = new RequirementResolutionImpl(); + return requirementResolution; + } + + /** + * + * + * @generated + */ + @Override + public CapabilityAnalysis createCapabilityAnalysis() { + CapabilityAnalysisImpl capabilityAnalysis = new CapabilityAnalysisImpl(); + return capabilityAnalysis; + } + + /** + * + * + * @generated + */ + @Override + public CapabilityResolution createCapabilityResolution() { + CapabilityResolutionImpl capabilityResolution = new CapabilityResolutionImpl(); + return capabilityResolution; + } + + /** + * + * + * @generated + */ + @Override + public Project createProject() { + ProjectImpl project = new ProjectImpl(); + return project; + } + + /** + * + * + * @generated + */ + @Override + public GitRepository createGitRepository() { + GitRepositoryImpl gitRepository = new GitRepositoryImpl(); + return gitRepository; + } + + /** + * + * + * @generated NOT + */ + public Pattern createPatternFromString(EDataType eDataType, String initialValue) { + return initialValue == null ? null : Pattern.compile(initialValue); + } + + /** + * + * + * @generated NOT + */ + public String convertPatternToString(EDataType eDataType, Object instanceValue) { + return instanceValue instanceof Pattern ? ((Pattern) instanceValue).pattern() : null; + } + + /** + * + * + * @generated + */ + public URI createURI(final String it) { + return it == null ? null : URI.createURI(it); + } + + /** + * + * + * @generated + */ + public URI createURIFromString(EDataType eDataType, String initialValue) { + return createURI(initialValue); + } + + /** + * + * + * @generated + */ + public String convertURI(final URI it) { + return it == null ? null : it.toString(); + } + + /** + * + * + * @generated + */ + public String convertURIToString(EDataType eDataType, Object instanceValue) { + return convertURI((URI) instanceValue); + } + + /** + * + * + * @generated + */ + public Date createDateFromString(EDataType eDataType, String initialValue) { + return (Date) super.createFromString(eDataType, initialValue); + } + + /** + * + * + * @generated NOT + */ + public String convertDateToString(EDataType eDataType, Object instanceValue) { + if (instanceValue == null) { + return null; + } + + return EDATE_FORMATS[EDATE_FORMATS.length - 1].format(instanceValue); + } + + /** + * + * + * @generated + */ + @Override + public AnalyzerPackage getAnalyzerPackage() { + return (AnalyzerPackage) getEPackage(); + } + +} //AnalyzerFactoryImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalyzerPackageImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalyzerPackageImpl.java new file mode 100644 index 000000000..6e8ae1b84 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/AnalyzerPackageImpl.java @@ -0,0 +1,1009 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import java.util.Date; +import java.util.regex.Pattern; + +import org.eclipse.cbi.p2repo.aggregator.AggregatorPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution; +import org.eclipse.cbi.p2repo.p2.P2Package; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.emf.ecore.xml.type.XMLTypePackage; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class AnalyzerPackageImpl extends EPackageImpl implements AnalyzerPackage { + /** + * + * + * @generated + */ + private EClass analysisEClass = null; + + /** + * + * + * @generated + */ + private EClass contributionAnalysisEClass = null; + + /** + * + * + * @generated + */ + private EClass installableUnitAnalysisEClass = null; + + /** + * + * + * @generated + */ + private EClass requirementAnalysisEClass = null; + + /** + * + * + * @generated + */ + private EClass requirementResolutionEClass = null; + + /** + * + * + * @generated + */ + private EClass capabilityAnalysisEClass = null; + + /** + * + * + * @generated + */ + private EClass capabilityResolutionEClass = null; + + /** + * + * + * @generated + */ + private EClass projectEClass = null; + + /** + * + * + * @generated + */ + private EClass gitRepositoryEClass = null; + + /** + * + * + * @generated + */ + private EDataType patternEDataType = null; + + /** + * + * + * @generated + */ + private EDataType uriEDataType = null; + + /** + * + * + * @generated + */ + private EDataType dateEDataType = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage#eNS_URI + * @see #init() + * @generated + */ + private AnalyzerPackageImpl() { + super(eNS_URI, AnalyzerFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link AnalyzerPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static AnalyzerPackage init() { + if (isInited) + return (AnalyzerPackage) EPackage.Registry.INSTANCE.getEPackage(AnalyzerPackage.eNS_URI); + + // Obtain or create and register package + Object registeredAnalyzerPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + AnalyzerPackageImpl theAnalyzerPackage = registeredAnalyzerPackage instanceof AnalyzerPackageImpl + ? (AnalyzerPackageImpl) registeredAnalyzerPackage + : new AnalyzerPackageImpl(); + + isInited = true; + + // Initialize simple dependencies + AggregatorPackage.eINSTANCE.eClass(); + P2Package.eINSTANCE.eClass(); + XMLTypePackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theAnalyzerPackage.createPackageContents(); + + // Initialize created meta-data + theAnalyzerPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theAnalyzerPackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(AnalyzerPackage.eNS_URI, theAnalyzerPackage); + return theAnalyzerPackage; + } + + /** + * + * + * @generated + */ + @Override + public EClass getAnalysis() { + return analysisEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAnalysis_ReleaseDate() { + return (EAttribute) analysisEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAnalysis_Exclusion() { + return (EAttribute) analysisEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getAnalysis_Levels() { + return (EAttribute) analysisEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getAnalysis_Aggregation() { + return (EReference) analysisEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getAnalysis_Contributions() { + return (EReference) analysisEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EClass getContributionAnalysis() { + return contributionAnalysisEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getContributionAnalysis_Label() { + return (EAttribute) contributionAnalysisEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getContributionAnalysis_Dominant() { + return (EAttribute) contributionAnalysisEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getContributionAnalysis_Match() { + return (EAttribute) contributionAnalysisEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getContributionAnalysis_LastModified() { + return (EAttribute) contributionAnalysisEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getContributionAnalysis_Contribution() { + return (EReference) contributionAnalysisEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getContributionAnalysis_InstallableUnits() { + return (EReference) contributionAnalysisEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getContributionAnalysis_Projects() { + return (EReference) contributionAnalysisEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EClass getInstallableUnitAnalysis() { + return installableUnitAnalysisEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getInstallableUnitAnalysis_Contribution() { + return (EReference) installableUnitAnalysisEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInstallableUnitAnalysis_InstallableUnit() { + return (EReference) installableUnitAnalysisEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInstallableUnitAnalysis_Requirements() { + return (EReference) installableUnitAnalysisEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EReference getInstallableUnitAnalysis_Capabilities() { + return (EReference) installableUnitAnalysisEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRequirementAnalysis() { + return requirementAnalysisEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequirementAnalysis_Requirement() { + return (EReference) requirementAnalysisEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequirementAnalysis_InstallableUnit() { + return (EReference) requirementAnalysisEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequirementAnalysis_Resolutions() { + return (EReference) requirementAnalysisEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getRequirementResolution() { + return requirementResolutionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequirementResolution_Requirement() { + return (EReference) requirementResolutionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequirementResolution_InstallableUnit() { + return (EReference) requirementResolutionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getRequirementResolution_Capability() { + return (EReference) requirementResolutionEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCapabilityAnalysis() { + return capabilityAnalysisEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCapabilityAnalysis_InstallableUnit() { + return (EReference) capabilityAnalysisEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCapabilityAnalysis_Capability() { + return (EReference) capabilityAnalysisEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCapabilityAnalysis_Resolutions() { + return (EReference) capabilityAnalysisEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EClass getCapabilityResolution() { + return capabilityResolutionEClass; + } + + /** + * + * + * @generated + */ + @Override + public EReference getCapabilityResolution_Capability() { + return (EReference) capabilityResolutionEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EReference getCapabilityResolution_Requirement() { + return (EReference) capabilityResolutionEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EClass getProject() { + return projectEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getProject_Name() { + return (EAttribute) projectEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getProject_Site() { + return (EAttribute) projectEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getProject_Version() { + return (EAttribute) projectEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getProject_ReleaseDate() { + return (EAttribute) projectEClass.getEStructuralFeatures().get(3); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProject_Contribution() { + return (EReference) projectEClass.getEStructuralFeatures().get(4); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProject_Parent() { + return (EReference) projectEClass.getEStructuralFeatures().get(5); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProject_Repositories() { + return (EReference) projectEClass.getEStructuralFeatures().get(6); + } + + /** + * + * + * @generated + */ + @Override + public EReference getProject_Subprojects() { + return (EReference) projectEClass.getEStructuralFeatures().get(7); + } + + /** + * + * + * @generated + */ + @Override + public EClass getGitRepository() { + return gitRepositoryEClass; + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGitRepository_URI() { + return (EAttribute) gitRepositoryEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getGitRepository_LastModified() { + return (EAttribute) gitRepositoryEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EReference getGitRepository_Project() { + return (EReference) gitRepositoryEClass.getEStructuralFeatures().get(2); + } + + /** + * + * + * @generated + */ + @Override + public EDataType getPattern() { + return patternEDataType; + } + + /** + * + * + * @generated + */ + @Override + public EDataType getURI() { + return uriEDataType; + } + + /** + * + * + * @generated + */ + @Override + public EDataType getDate() { + return dateEDataType; + } + + /** + * + * + * @generated + */ + @Override + public AnalyzerFactory getAnalyzerFactory() { + return (AnalyzerFactory) getEFactoryInstance(); + } + + /** + * + * + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + analysisEClass = createEClass(ANALYSIS); + createEAttribute(analysisEClass, ANALYSIS__RELEASE_DATE); + createEAttribute(analysisEClass, ANALYSIS__EXCLUSION); + createEAttribute(analysisEClass, ANALYSIS__LEVELS); + createEReference(analysisEClass, ANALYSIS__AGGREGATION); + createEReference(analysisEClass, ANALYSIS__CONTRIBUTIONS); + + contributionAnalysisEClass = createEClass(CONTRIBUTION_ANALYSIS); + createEAttribute(contributionAnalysisEClass, CONTRIBUTION_ANALYSIS__LABEL); + createEAttribute(contributionAnalysisEClass, CONTRIBUTION_ANALYSIS__DOMINANT); + createEAttribute(contributionAnalysisEClass, CONTRIBUTION_ANALYSIS__MATCH); + createEAttribute(contributionAnalysisEClass, CONTRIBUTION_ANALYSIS__LAST_MODIFIED); + createEReference(contributionAnalysisEClass, CONTRIBUTION_ANALYSIS__CONTRIBUTION); + createEReference(contributionAnalysisEClass, CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS); + createEReference(contributionAnalysisEClass, CONTRIBUTION_ANALYSIS__PROJECTS); + + installableUnitAnalysisEClass = createEClass(INSTALLABLE_UNIT_ANALYSIS); + createEReference(installableUnitAnalysisEClass, INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION); + createEReference(installableUnitAnalysisEClass, INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT); + createEReference(installableUnitAnalysisEClass, INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS); + createEReference(installableUnitAnalysisEClass, INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES); + + requirementAnalysisEClass = createEClass(REQUIREMENT_ANALYSIS); + createEReference(requirementAnalysisEClass, REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT); + createEReference(requirementAnalysisEClass, REQUIREMENT_ANALYSIS__REQUIREMENT); + createEReference(requirementAnalysisEClass, REQUIREMENT_ANALYSIS__RESOLUTIONS); + + requirementResolutionEClass = createEClass(REQUIREMENT_RESOLUTION); + createEReference(requirementResolutionEClass, REQUIREMENT_RESOLUTION__REQUIREMENT); + createEReference(requirementResolutionEClass, REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT); + createEReference(requirementResolutionEClass, REQUIREMENT_RESOLUTION__CAPABILITY); + + capabilityAnalysisEClass = createEClass(CAPABILITY_ANALYSIS); + createEReference(capabilityAnalysisEClass, CAPABILITY_ANALYSIS__INSTALLABLE_UNIT); + createEReference(capabilityAnalysisEClass, CAPABILITY_ANALYSIS__CAPABILITY); + createEReference(capabilityAnalysisEClass, CAPABILITY_ANALYSIS__RESOLUTIONS); + + capabilityResolutionEClass = createEClass(CAPABILITY_RESOLUTION); + createEReference(capabilityResolutionEClass, CAPABILITY_RESOLUTION__CAPABILITY); + createEReference(capabilityResolutionEClass, CAPABILITY_RESOLUTION__REQUIREMENT); + + projectEClass = createEClass(PROJECT); + createEAttribute(projectEClass, PROJECT__NAME); + createEAttribute(projectEClass, PROJECT__SITE); + createEAttribute(projectEClass, PROJECT__VERSION); + createEAttribute(projectEClass, PROJECT__RELEASE_DATE); + createEReference(projectEClass, PROJECT__CONTRIBUTION); + createEReference(projectEClass, PROJECT__PARENT); + createEReference(projectEClass, PROJECT__REPOSITORIES); + createEReference(projectEClass, PROJECT__SUBPROJECTS); + + gitRepositoryEClass = createEClass(GIT_REPOSITORY); + createEAttribute(gitRepositoryEClass, GIT_REPOSITORY__URI); + createEAttribute(gitRepositoryEClass, GIT_REPOSITORY__LAST_MODIFIED); + createEReference(gitRepositoryEClass, GIT_REPOSITORY__PROJECT); + + // Create data types + patternEDataType = createEDataType(PATTERN); + uriEDataType = createEDataType(URI); + dateEDataType = createEDataType(DATE); + } + + /** + * + * + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * + * + * @generated + */ + public void initializePackageContents() { + if (isInitialized) + return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + AggregatorPackage theAggregatorPackage = (AggregatorPackage) EPackage.Registry.INSTANCE + .getEPackage(AggregatorPackage.eNS_URI); + XMLTypePackage theXMLTypePackage = (XMLTypePackage) EPackage.Registry.INSTANCE + .getEPackage(XMLTypePackage.eNS_URI); + P2Package theP2Package = (P2Package) EPackage.Registry.INSTANCE.getEPackage(P2Package.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + + // Initialize classes and features; add operations and parameters + initEClass(analysisEClass, Analysis.class, "Analysis", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getAnalysis_ReleaseDate(), this.getDate(), "releaseDate", null, 0, 1, Analysis.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAnalysis_Exclusion(), this.getPattern(), "exclusion", null, 0, 1, Analysis.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getAnalysis_Levels(), ecorePackage.getEInt(), "levels", null, 0, -1, Analysis.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getAnalysis_Aggregation(), theAggregatorPackage.getAggregation(), null, "aggregation", null, 1, + 1, Analysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getAnalysis_Contributions(), this.getContributionAnalysis(), null, "contributions", null, 0, -1, + Analysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + addEOperation(analysisEClass, null, "reconcile", 0, 1, IS_UNIQUE, IS_ORDERED); + + initEClass(contributionAnalysisEClass, ContributionAnalysis.class, "ContributionAnalysis", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getContributionAnalysis_Label(), ecorePackage.getEString(), "label", null, 0, 1, + ContributionAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getContributionAnalysis_Dominant(), theXMLTypePackage.getBoolean(), "dominant", null, 0, 1, + ContributionAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getContributionAnalysis_Match(), this.getPattern(), "match", null, 0, 1, + ContributionAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getContributionAnalysis_LastModified(), ecorePackage.getELong(), "lastModified", + "-9223372036854775808", 0, 1, ContributionAnalysis.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getContributionAnalysis_Contribution(), theAggregatorPackage.getContribution(), null, + "contribution", null, 1, 1, ContributionAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getContributionAnalysis_InstallableUnits(), this.getInstallableUnitAnalysis(), + this.getInstallableUnitAnalysis_Contribution(), "installableUnits", null, 0, -1, + ContributionAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getContributionAnalysis_Projects(), this.getProject(), null, "projects", null, 0, -1, + ContributionAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(installableUnitAnalysisEClass, InstallableUnitAnalysis.class, "InstallableUnitAnalysis", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getInstallableUnitAnalysis_Contribution(), this.getContributionAnalysis(), + this.getContributionAnalysis_InstallableUnits(), "contribution", null, 0, 1, + InstallableUnitAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getInstallableUnitAnalysis_InstallableUnit(), theP2Package.getIInstallableUnit(), null, + "installableUnit", null, 1, 1, InstallableUnitAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getInstallableUnitAnalysis_Requirements(), this.getRequirementAnalysis(), + this.getRequirementAnalysis_InstallableUnit(), "requirements", null, 0, -1, + InstallableUnitAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getInstallableUnitAnalysis_Capabilities(), this.getCapabilityAnalysis(), + this.getCapabilityAnalysis_InstallableUnit(), "capabilities", null, 0, -1, + InstallableUnitAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(requirementAnalysisEClass, RequirementAnalysis.class, "RequirementAnalysis", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getRequirementAnalysis_InstallableUnit(), this.getInstallableUnitAnalysis(), + this.getInstallableUnitAnalysis_Requirements(), "installableUnit", null, 0, 1, + RequirementAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRequirementAnalysis_Requirement(), theP2Package.getIRequirement(), null, "requirement", null, + 1, 1, RequirementAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRequirementAnalysis_Resolutions(), this.getRequirementResolution(), + this.getRequirementResolution_Requirement(), "resolutions", null, 0, -1, RequirementAnalysis.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(requirementResolutionEClass, RequirementResolution.class, "RequirementResolution", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getRequirementResolution_Requirement(), this.getRequirementAnalysis(), + this.getRequirementAnalysis_Resolutions(), "requirement", null, 0, 1, RequirementResolution.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRequirementResolution_InstallableUnit(), this.getInstallableUnitAnalysis(), null, + "installableUnit", null, 1, 1, RequirementResolution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, + !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getRequirementResolution_Capability(), this.getCapabilityAnalysis(), null, "capability", null, 0, + 1, RequirementResolution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(capabilityAnalysisEClass, CapabilityAnalysis.class, "CapabilityAnalysis", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCapabilityAnalysis_InstallableUnit(), this.getInstallableUnitAnalysis(), + this.getInstallableUnitAnalysis_Capabilities(), "installableUnit", null, 0, 1, CapabilityAnalysis.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCapabilityAnalysis_Capability(), theP2Package.getIProvidedCapability(), null, "capability", + null, 1, 1, CapabilityAnalysis.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCapabilityAnalysis_Resolutions(), this.getCapabilityResolution(), + this.getCapabilityResolution_Capability(), "resolutions", null, 0, -1, CapabilityAnalysis.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(capabilityResolutionEClass, CapabilityResolution.class, "CapabilityResolution", !IS_ABSTRACT, + !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getCapabilityResolution_Capability(), this.getCapabilityAnalysis(), + this.getCapabilityAnalysis_Resolutions(), "capability", null, 0, 1, CapabilityResolution.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getCapabilityResolution_Requirement(), this.getRequirementAnalysis(), null, "requirement", null, + 1, 1, CapabilityResolution.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, + IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(projectEClass, Project.class, "Project", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getProject_Name(), ecorePackage.getEString(), "name", null, 0, 1, Project.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getProject_Site(), this.getURI(), "site", null, 0, 1, Project.class, !IS_TRANSIENT, !IS_VOLATILE, + IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getProject_Version(), this.getURI(), "version", null, 0, 1, Project.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getProject_ReleaseDate(), this.getDate(), "releaseDate", null, 0, 1, Project.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getProject_Contribution(), this.getContributionAnalysis(), null, "contribution", null, 0, 1, + Project.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEReference(getProject_Parent(), this.getProject(), this.getProject_Subprojects(), "parent", null, 0, 1, + Project.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getProject_Repositories(), this.getGitRepository(), this.getGitRepository_Project(), + "repositories", null, 0, -1, Project.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getProject_Subprojects(), this.getProject(), this.getProject_Parent(), "subprojects", null, 0, + -1, Project.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, + !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(gitRepositoryEClass, GitRepository.class, "GitRepository", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getGitRepository_URI(), this.getURI(), "uRI", null, 0, 1, GitRepository.class, !IS_TRANSIENT, + !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getGitRepository_LastModified(), ecorePackage.getELong(), "lastModified", "-9223372036854775808", + 0, 1, GitRepository.class, IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEReference(getGitRepository_Project(), this.getProject(), this.getProject_Repositories(), "project", null, + 0, 1, GitRepository.class, IS_TRANSIENT, !IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize data types + initEDataType(patternEDataType, Pattern.class, "Pattern", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(uriEDataType, org.eclipse.emf.common.util.URI.class, "URI", IS_SERIALIZABLE, + !IS_GENERATED_INSTANCE_CLASS); + initEDataType(dateEDataType, Date.class, "Date", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + + // Create resource + createResource(eNS_URI); + + // Create annotations + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); + } + + /** + * Initializes the annotations for http:///org/eclipse/emf/ecore/util/ExtendedMetaData. + * + * + * @generated + */ + protected void createExtendedMetaDataAnnotations() { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; + addAnnotation(getAnalysis_Contributions(), source, new String[] { "name", "contribution", "kind", "element" }); + addAnnotation(getContributionAnalysis_InstallableUnits(), source, + new String[] { "kind", "element", "name", "installableUnit" }); + addAnnotation(getContributionAnalysis_Projects(), source, + new String[] { "kind", "element", "name", "project" }); + addAnnotation(getInstallableUnitAnalysis_Requirements(), source, + new String[] { "kind", "element", "name", "requirement" }); + addAnnotation(getInstallableUnitAnalysis_Capabilities(), source, + new String[] { "kind", "element", "name", "capability" }); + addAnnotation(getRequirementAnalysis_Resolutions(), source, + new String[] { "kind", "element", "name", "resolution" }); + addAnnotation(getProject_Repositories(), source, new String[] { "kind", "element", "name", "repository" }); + addAnnotation(getProject_Subprojects(), source, new String[] { "kind", "element", "name", "subproject" }); + addAnnotation(getGitRepository_URI(), source, new String[] { "name", "uri" }); + } + +} //AnalyzerPackageImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/CapabilityAnalysisImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/CapabilityAnalysisImpl.java new file mode 100644 index 000000000..79afeef48 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/CapabilityAnalysisImpl.java @@ -0,0 +1,356 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import java.util.Collection; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +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.EObject; +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.equinox.p2.metadata.IProvidedCapability; + +/** + * + * An implementation of the model object 'Capability Analysis'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityAnalysisImpl#getInstallableUnit Installable Unit}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityAnalysisImpl#getCapability Capability}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityAnalysisImpl#getResolutions Resolutions}
  • + *
+ * + * @generated + */ +public class CapabilityAnalysisImpl extends MinimalEObjectImpl.Container implements CapabilityAnalysis { + /** + * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. + * + * + * @generated + * @ordered + */ + protected int eFlags = 0; + + /** + * The cached value of the '{@link #getCapability() Capability}' reference. + * + * + * @see #getCapability() + * @generated + * @ordered + */ + protected IProvidedCapability capability; + + /** + * The cached value of the '{@link #getResolutions() Resolutions}' containment reference list. + * + * + * @see #getResolutions() + * @generated + * @ordered + */ + protected EList resolutions; + + /** + * + * + * @generated + */ + protected CapabilityAnalysisImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnalyzerPackage.Literals.CAPABILITY_ANALYSIS; + } + + /** + * + * + * @generated + */ + @Override + public InstallableUnitAnalysis getInstallableUnit() { + if (eContainerFeatureID() != AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT) + return null; + return (InstallableUnitAnalysis) eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetInstallableUnit(InstallableUnitAnalysis newInstallableUnit, + NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newInstallableUnit, + AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setInstallableUnit(InstallableUnitAnalysis newInstallableUnit) { + if (newInstallableUnit != eInternalContainer() + || (eContainerFeatureID() != AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT + && newInstallableUnit != null)) { + if (EcoreUtil.isAncestor(this, newInstallableUnit)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newInstallableUnit != null) + msgs = ((InternalEObject) newInstallableUnit).eInverseAdd(this, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES, InstallableUnitAnalysis.class, msgs); + msgs = basicSetInstallableUnit(newInstallableUnit, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT, + newInstallableUnit, newInstallableUnit)); + } + + /** + * + * + * @generated + */ + @Override + public IProvidedCapability getCapability() { + if (capability != null && ((EObject) capability).eIsProxy()) { + InternalEObject oldCapability = (InternalEObject) capability; + capability = (IProvidedCapability) eResolveProxy(oldCapability); + if (capability != oldCapability) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + AnalyzerPackage.CAPABILITY_ANALYSIS__CAPABILITY, oldCapability, capability)); + } + } + return capability; + } + + /** + * + * + * @generated + */ + public IProvidedCapability basicGetCapability() { + return capability; + } + + /** + * + * + * @generated + */ + @Override + public void setCapability(IProvidedCapability newCapability) { + IProvidedCapability oldCapability = capability; + capability = newCapability; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.CAPABILITY_ANALYSIS__CAPABILITY, + oldCapability, capability)); + } + + /** + * + * + * @generated + */ + @Override + public EList getResolutions() { + if (resolutions == null) { + resolutions = new EObjectContainmentWithInverseEList<>(CapabilityResolution.class, this, + AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS, + AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY); + } + return resolutions; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetInstallableUnit((InstallableUnitAnalysis) otherEnd, msgs); + case AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS: + return ((InternalEList) (InternalEList) getResolutions()).basicAdd(otherEnd, msgs); + default: + return super.eInverseAdd(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT: + return basicSetInstallableUnit(null, msgs); + case AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS: + return ((InternalEList) getResolutions()).basicRemove(otherEnd, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT: + return eInternalContainer().eInverseRemove(this, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES, InstallableUnitAnalysis.class, msgs); + default: + return super.eBasicRemoveFromContainerFeature(msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT: + return getInstallableUnit(); + case AnalyzerPackage.CAPABILITY_ANALYSIS__CAPABILITY: + if (resolve) + return getCapability(); + return basicGetCapability(); + case AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS: + return getResolutions(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT: + setInstallableUnit((InstallableUnitAnalysis) newValue); + return; + case AnalyzerPackage.CAPABILITY_ANALYSIS__CAPABILITY: + setCapability((IProvidedCapability) newValue); + return; + case AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS: + getResolutions().clear(); + getResolutions().addAll((Collection) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT: + setInstallableUnit((InstallableUnitAnalysis) null); + return; + case AnalyzerPackage.CAPABILITY_ANALYSIS__CAPABILITY: + setCapability((IProvidedCapability) null); + return; + case AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS: + getResolutions().clear(); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT: + return getInstallableUnit() != null; + case AnalyzerPackage.CAPABILITY_ANALYSIS__CAPABILITY: + return capability != null; + case AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS: + return resolutions != null && !resolutions.isEmpty(); + default: + return super.eIsSet(featureID); + } + } + + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append("( capability: "); + result.append(capability); + result.append(')'); + return result.toString(); + } + +} // CapabilityAnalysisImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/CapabilityResolutionImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/CapabilityResolutionImpl.java new file mode 100644 index 000000000..182a6af13 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/CapabilityResolutionImpl.java @@ -0,0 +1,305 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +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.EcoreUtil; + +/** + * + * An implementation of the model object 'Capability Resolution'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityResolutionImpl#getCapability Capability}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.CapabilityResolutionImpl#getRequirement Requirement}
  • + *
+ * + * @generated + */ +public class CapabilityResolutionImpl extends MinimalEObjectImpl.Container implements CapabilityResolution { + /** + * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. + * + * + * @generated + * @ordered + */ + protected int eFlags = 0; + + /** + * The cached value of the '{@link #getRequirement() Requirement}' reference. + * + * + * @see #getRequirement() + * @generated + * @ordered + */ + protected RequirementAnalysis requirement; + + /** + * + * + * @generated + */ + protected CapabilityResolutionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnalyzerPackage.Literals.CAPABILITY_RESOLUTION; + } + + /** + * + * + * @generated + */ + @Override + public CapabilityAnalysis getCapability() { + if (eContainerFeatureID() != AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY) + return null; + return (CapabilityAnalysis) eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetCapability(CapabilityAnalysis newCapability, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newCapability, AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY, + msgs); + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setCapability(CapabilityAnalysis newCapability) { + if (newCapability != eInternalContainer() + || (eContainerFeatureID() != AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY + && newCapability != null)) { + if (EcoreUtil.isAncestor(this, newCapability)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newCapability != null) + msgs = ((InternalEObject) newCapability).eInverseAdd(this, + AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS, CapabilityAnalysis.class, msgs); + msgs = basicSetCapability(newCapability, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY, + newCapability, newCapability)); + } + + /** + * + * + * @generated + */ + @Override + public RequirementAnalysis getRequirement() { + if (requirement != null && requirement.eIsProxy()) { + InternalEObject oldRequirement = (InternalEObject) requirement; + requirement = (RequirementAnalysis) eResolveProxy(oldRequirement); + if (requirement != oldRequirement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + AnalyzerPackage.CAPABILITY_RESOLUTION__REQUIREMENT, oldRequirement, requirement)); + } + } + return requirement; + } + + /** + * + * + * @generated + */ + public RequirementAnalysis basicGetRequirement() { + return requirement; + } + + /** + * + * + * @generated + */ + @Override + public void setRequirement(RequirementAnalysis newRequirement) { + RequirementAnalysis oldRequirement = requirement; + requirement = newRequirement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.CAPABILITY_RESOLUTION__REQUIREMENT, + oldRequirement, requirement)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetCapability((CapabilityAnalysis) otherEnd, msgs); + default: + return super.eInverseAdd(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY: + return basicSetCapability(null, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY: + return eInternalContainer().eInverseRemove(this, AnalyzerPackage.CAPABILITY_ANALYSIS__RESOLUTIONS, + CapabilityAnalysis.class, msgs); + default: + return super.eBasicRemoveFromContainerFeature(msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY: + return getCapability(); + case AnalyzerPackage.CAPABILITY_RESOLUTION__REQUIREMENT: + if (resolve) + return getRequirement(); + return basicGetRequirement(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY: + setCapability((CapabilityAnalysis) newValue); + return; + case AnalyzerPackage.CAPABILITY_RESOLUTION__REQUIREMENT: + setRequirement((RequirementAnalysis) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY: + setCapability((CapabilityAnalysis) null); + return; + case AnalyzerPackage.CAPABILITY_RESOLUTION__REQUIREMENT: + setRequirement((RequirementAnalysis) null); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnalyzerPackage.CAPABILITY_RESOLUTION__CAPABILITY: + return getCapability() != null; + case AnalyzerPackage.CAPABILITY_RESOLUTION__REQUIREMENT: + return requirement != null; + default: + return super.eIsSet(featureID); + } + } + + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append("( requirement: "); + result.append(requirement); + result.append(')'); + return result.toString(); + } + +} // CapabilityResolutionImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/ContributionAnalysisImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/ContributionAnalysisImpl.java new file mode 100644 index 000000000..f3017fdd8 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/ContributionAnalysisImpl.java @@ -0,0 +1,558 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import java.util.Collection; +import java.util.regex.Pattern; + +import org.eclipse.cbi.p2repo.aggregator.Contribution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +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.EObject; +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.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Contribution Analysis'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl#getLabel Label}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl#isDominant Dominant}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl#getMatch Match}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl#getLastModified Last Modified}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl#getContribution Contribution}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl#getInstallableUnits Installable Units}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ContributionAnalysisImpl#getProjects Projects}
  • + *
+ * + * @generated + */ +public class ContributionAnalysisImpl extends MinimalEObjectImpl.Container implements ContributionAnalysis { + /** + * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. + * + * + * @generated + * @ordered + */ + protected int eFlags = 0; + + /** + * The default value of the '{@link #getLabel() Label}' attribute. + * + * + * @see #getLabel() + * @generated + * @ordered + */ + protected static final String LABEL_EDEFAULT = null; + + /** + * The cached value of the '{@link #getLabel() Label}' attribute. + * + * + * @see #getLabel() + * @generated + * @ordered + */ + protected String label = LABEL_EDEFAULT; + + /** + * The default value of the '{@link #isDominant() Dominant}' attribute. + * + * + * @see #isDominant() + * @generated + * @ordered + */ + protected static final boolean DOMINANT_EDEFAULT = false; + + /** + * The flag representing the value of the '{@link #isDominant() Dominant}' attribute. + * + * + * @see #isDominant() + * @generated + * @ordered + */ + protected static final int DOMINANT_EFLAG = 1 << 0; + + /** + * The default value of the '{@link #getMatch() Match}' attribute. + * + * + * @see #getMatch() + * @generated + * @ordered + */ + protected static final Pattern MATCH_EDEFAULT = null; + + /** + * The cached value of the '{@link #getMatch() Match}' attribute. + * + * + * @see #getMatch() + * @generated + * @ordered + */ + protected Pattern match = MATCH_EDEFAULT; + + /** + * The default value of the '{@link #getLastModified() Last Modified}' attribute. + * + * + * @see #getLastModified() + * @generated + * @ordered + */ + protected static final long LAST_MODIFIED_EDEFAULT = -9223372036854775808L; + + /** + * The cached value of the '{@link #getLastModified() Last Modified}' attribute. + * + * + * @see #getLastModified() + * @generated + * @ordered + */ + protected long lastModified = LAST_MODIFIED_EDEFAULT; + + /** + * The cached value of the '{@link #getContribution() Contribution}' reference. + * + * + * @see #getContribution() + * @generated + * @ordered + */ + protected Contribution contribution; + + /** + * The cached value of the '{@link #getInstallableUnits() Installable Units}' containment reference list. + * + * + * @see #getInstallableUnits() + * @generated + * @ordered + */ + protected EList installableUnits; + + /** + * The cached value of the '{@link #getProjects() Projects}' containment reference list. + * + * + * @see #getProjects() + * @generated + * @ordered + */ + protected EList projects; + + /** + * + * + * @generated + */ + protected ContributionAnalysisImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnalyzerPackage.Literals.CONTRIBUTION_ANALYSIS; + } + + @Override + public String getLabel() { + String label = getLabelGen(); + if (label == null) { + Contribution contribution = getContribution(); + if (contribution != null) { + label = contribution.getLabel(); + } + } + return label; + } + + /** + * + * + * @generated + */ + public String getLabelGen() { + return label; + } + + /** + * + * + * @generated + */ + @Override + public void setLabel(String newLabel) { + String oldLabel = label; + label = newLabel; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.CONTRIBUTION_ANALYSIS__LABEL, + oldLabel, label)); + } + + /** + * + * + * @generated + */ + @Override + public boolean isDominant() { + return (eFlags & DOMINANT_EFLAG) != 0; + } + + /** + * + * + * @generated + */ + @Override + public void setDominant(boolean newDominant) { + boolean oldDominant = (eFlags & DOMINANT_EFLAG) != 0; + if (newDominant) + eFlags |= DOMINANT_EFLAG; + else + eFlags &= ~DOMINANT_EFLAG; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.CONTRIBUTION_ANALYSIS__DOMINANT, + oldDominant, newDominant)); + } + + /** + * + * + * @generated + */ + @Override + public Pattern getMatch() { + return match; + } + + /** + * + * + * @generated + */ + @Override + public void setMatch(Pattern newMatch) { + Pattern oldMatch = match; + match = newMatch; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.CONTRIBUTION_ANALYSIS__MATCH, + oldMatch, match)); + } + + /** + * + * + * @generated + */ + @Override + public long getLastModified() { + return lastModified; + } + + /** + * + * + * @generated + */ + @Override + public void setLastModified(long newLastModified) { + long oldLastModified = lastModified; + lastModified = newLastModified; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.CONTRIBUTION_ANALYSIS__LAST_MODIFIED, + oldLastModified, lastModified)); + } + + /** + * + * + * @generated + */ + @Override + public Contribution getContribution() { + if (contribution != null && ((EObject) contribution).eIsProxy()) { + InternalEObject oldContribution = (InternalEObject) contribution; + contribution = (Contribution) eResolveProxy(oldContribution); + if (contribution != oldContribution) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + AnalyzerPackage.CONTRIBUTION_ANALYSIS__CONTRIBUTION, oldContribution, contribution)); + } + } + return contribution; + } + + /** + * + * + * @generated + */ + public Contribution basicGetContribution() { + return contribution; + } + + /** + * + * + * @generated + */ + @Override + public void setContribution(Contribution newContribution) { + Contribution oldContribution = contribution; + contribution = newContribution; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.CONTRIBUTION_ANALYSIS__CONTRIBUTION, + oldContribution, contribution)); + } + + /** + * + * + * @generated + */ + @Override + public EList getInstallableUnits() { + if (installableUnits == null) { + installableUnits = new EObjectContainmentWithInverseEList<>( + InstallableUnitAnalysis.class, this, AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION); + } + return installableUnits; + } + + /** + * + * + * @generated + */ + @Override + public EList getProjects() { + if (projects == null) { + projects = new EObjectContainmentEList<>(Project.class, this, + AnalyzerPackage.CONTRIBUTION_ANALYSIS__PROJECTS); + } + return projects; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS: + return ((InternalEList) (InternalEList) getInstallableUnits()).basicAdd(otherEnd, + msgs); + default: + return super.eInverseAdd(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS: + return ((InternalEList) getInstallableUnits()).basicRemove(otherEnd, msgs); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__PROJECTS: + return ((InternalEList) getProjects()).basicRemove(otherEnd, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LABEL: + return getLabel(); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__DOMINANT: + return isDominant(); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__MATCH: + return getMatch(); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LAST_MODIFIED: + return getLastModified(); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__CONTRIBUTION: + if (resolve) + return getContribution(); + return basicGetContribution(); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS: + return getInstallableUnits(); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__PROJECTS: + return getProjects(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LABEL: + setLabel((String) newValue); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__DOMINANT: + setDominant((Boolean) newValue); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__MATCH: + setMatch((Pattern) newValue); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LAST_MODIFIED: + setLastModified((Long) newValue); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__CONTRIBUTION: + setContribution((Contribution) newValue); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS: + getInstallableUnits().clear(); + getInstallableUnits().addAll((Collection) newValue); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__PROJECTS: + getProjects().clear(); + getProjects().addAll((Collection) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LABEL: + setLabel(LABEL_EDEFAULT); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__DOMINANT: + setDominant(DOMINANT_EDEFAULT); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__MATCH: + setMatch(MATCH_EDEFAULT); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LAST_MODIFIED: + setLastModified(LAST_MODIFIED_EDEFAULT); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__CONTRIBUTION: + setContribution((Contribution) null); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS: + getInstallableUnits().clear(); + return; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__PROJECTS: + getProjects().clear(); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LABEL: + return LABEL_EDEFAULT == null ? label != null : !LABEL_EDEFAULT.equals(label); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__DOMINANT: + return ((eFlags & DOMINANT_EFLAG) != 0) != DOMINANT_EDEFAULT; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__MATCH: + return MATCH_EDEFAULT == null ? match != null : !MATCH_EDEFAULT.equals(match); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__LAST_MODIFIED: + return lastModified != LAST_MODIFIED_EDEFAULT; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__CONTRIBUTION: + return contribution != null; + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS: + return installableUnits != null && !installableUnits.isEmpty(); + case AnalyzerPackage.CONTRIBUTION_ANALYSIS__PROJECTS: + return projects != null && !projects.isEmpty(); + default: + return super.eIsSet(featureID); + } + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (label: "); + result.append(label); + result.append(", dominant: "); + result.append((eFlags & DOMINANT_EFLAG) != 0); + result.append(", match: "); + result.append(match); + result.append(", lastModified: "); + result.append(lastModified); + result.append(')'); + return result.toString(); + } + +} // ContributionAnalysisImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/GitRepositoryImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/GitRepositoryImpl.java new file mode 100644 index 000000000..996bc7ad3 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/GitRepositoryImpl.java @@ -0,0 +1,312 @@ +/** + * Copyright (c) 2022 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +import org.eclipse.emf.common.util.URI; +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; + +/** + * + * An implementation of the model object 'Git Repository'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.GitRepositoryImpl#getURI URI}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.GitRepositoryImpl#getLastModified Last Modified}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.GitRepositoryImpl#getProject Project}
  • + *
+ * + * @generated + */ +public class GitRepositoryImpl extends MinimalEObjectImpl.Container implements GitRepository { + /** + * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. + * + * + * @generated + * @ordered + */ + protected int eFlags = 0; + + /** + * The default value of the '{@link #getURI() URI}' attribute. + * + * + * @see #getURI() + * @generated + * @ordered + */ + protected static final URI URI_EDEFAULT = null; + + /** + * The cached value of the '{@link #getURI() URI}' attribute. + * + * + * @see #getURI() + * @generated + * @ordered + */ + protected URI uRI = URI_EDEFAULT; + + /** + * The default value of the '{@link #getLastModified() Last Modified}' attribute. + * + * + * @see #getLastModified() + * @generated + * @ordered + */ + protected static final long LAST_MODIFIED_EDEFAULT = -9223372036854775808L; + + /** + * The cached value of the '{@link #getLastModified() Last Modified}' attribute. + * + * + * @see #getLastModified() + * @generated + * @ordered + */ + protected long lastModified = LAST_MODIFIED_EDEFAULT; + + /** + * + * + * @generated + */ + protected GitRepositoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnalyzerPackage.Literals.GIT_REPOSITORY; + } + + /** + * + * + * @generated + */ + @Override + public URI getURI() { + return uRI; + } + + /** + * + * + * @generated + */ + @Override + public void setURI(URI newURI) { + URI oldURI = uRI; + uRI = newURI; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.GIT_REPOSITORY__URI, oldURI, uRI)); + } + + /** + * + * + * @generated + */ + @Override + public long getLastModified() { + return lastModified; + } + + /** + * + * + * @generated + */ + @Override + public void setLastModified(long newLastModified) { + long oldLastModified = lastModified; + lastModified = newLastModified; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.GIT_REPOSITORY__LAST_MODIFIED, + oldLastModified, lastModified)); + } + + /** + * + * + * @generated + */ + @Override + public Project getProject() { + if (eContainerFeatureID() != AnalyzerPackage.GIT_REPOSITORY__PROJECT) + return null; + return (Project) eInternalContainer(); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.GIT_REPOSITORY__PROJECT: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return eBasicSetContainer(otherEnd, AnalyzerPackage.GIT_REPOSITORY__PROJECT, msgs); + default: + return super.eInverseAdd(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.GIT_REPOSITORY__PROJECT: + return eBasicSetContainer(null, AnalyzerPackage.GIT_REPOSITORY__PROJECT, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case AnalyzerPackage.GIT_REPOSITORY__PROJECT: + return eInternalContainer().eInverseRemove(this, AnalyzerPackage.PROJECT__REPOSITORIES, Project.class, + msgs); + default: + return super.eBasicRemoveFromContainerFeature(msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnalyzerPackage.GIT_REPOSITORY__URI: + return getURI(); + case AnalyzerPackage.GIT_REPOSITORY__LAST_MODIFIED: + return getLastModified(); + case AnalyzerPackage.GIT_REPOSITORY__PROJECT: + return getProject(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnalyzerPackage.GIT_REPOSITORY__URI: + setURI((URI) newValue); + return; + case AnalyzerPackage.GIT_REPOSITORY__LAST_MODIFIED: + setLastModified((Long) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnalyzerPackage.GIT_REPOSITORY__URI: + setURI(URI_EDEFAULT); + return; + case AnalyzerPackage.GIT_REPOSITORY__LAST_MODIFIED: + setLastModified(LAST_MODIFIED_EDEFAULT); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnalyzerPackage.GIT_REPOSITORY__URI: + return URI_EDEFAULT == null ? uRI != null : !URI_EDEFAULT.equals(uRI); + case AnalyzerPackage.GIT_REPOSITORY__LAST_MODIFIED: + return lastModified != LAST_MODIFIED_EDEFAULT; + case AnalyzerPackage.GIT_REPOSITORY__PROJECT: + return getProject() != null; + default: + return super.eIsSet(featureID); + } + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (uRI: "); + result.append(uRI); + result.append(", lastModified: "); + result.append(lastModified); + result.append(')'); + return result.toString(); + } + +} //GitRepositoryImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/InstallableUnitAnalysisImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/InstallableUnitAnalysisImpl.java new file mode 100644 index 000000000..5bd288a8c --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/InstallableUnitAnalysisImpl.java @@ -0,0 +1,403 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import java.util.Collection; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +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.EObject; +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.equinox.p2.metadata.IInstallableUnit; + +/** + * + * An implementation of the model object 'Installable Unit Analysis'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.InstallableUnitAnalysisImpl#getContribution Contribution}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.InstallableUnitAnalysisImpl#getInstallableUnit Installable Unit}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.InstallableUnitAnalysisImpl#getRequirements Requirements}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.InstallableUnitAnalysisImpl#getCapabilities Capabilities}
  • + *
+ * + * @generated + */ +public class InstallableUnitAnalysisImpl extends MinimalEObjectImpl.Container implements InstallableUnitAnalysis { + /** + * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. + * + * + * @generated + * @ordered + */ + protected int eFlags = 0; + + /** + * The cached value of the '{@link #getInstallableUnit() Installable Unit}' reference. + * + * + * @see #getInstallableUnit() + * @generated + * @ordered + */ + protected IInstallableUnit installableUnit; + + /** + * The cached value of the '{@link #getRequirements() Requirements}' containment reference list. + * + * + * @see #getRequirements() + * @generated + * @ordered + */ + protected EList requirements; + + /** + * The cached value of the '{@link #getCapabilities() Capabilities}' containment reference list. + * + * + * @see #getCapabilities() + * @generated + * @ordered + */ + protected EList capabilities; + + /** + * + * + * @generated + */ + protected InstallableUnitAnalysisImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnalyzerPackage.Literals.INSTALLABLE_UNIT_ANALYSIS; + } + + /** + * + * + * @generated + */ + @Override + public ContributionAnalysis getContribution() { + if (eContainerFeatureID() != AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION) + return null; + return (ContributionAnalysis) eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetContribution(ContributionAnalysis newContribution, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newContribution, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setContribution(ContributionAnalysis newContribution) { + if (newContribution != eInternalContainer() + || (eContainerFeatureID() != AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION + && newContribution != null)) { + if (EcoreUtil.isAncestor(this, newContribution)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newContribution != null) + msgs = ((InternalEObject) newContribution).eInverseAdd(this, + AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS, ContributionAnalysis.class, msgs); + msgs = basicSetContribution(newContribution, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION, newContribution, newContribution)); + } + + /** + * + * + * @generated + */ + @Override + public IInstallableUnit getInstallableUnit() { + if (installableUnit != null && ((EObject) installableUnit).eIsProxy()) { + InternalEObject oldInstallableUnit = (InternalEObject) installableUnit; + installableUnit = (IInstallableUnit) eResolveProxy(oldInstallableUnit); + if (installableUnit != oldInstallableUnit) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT, oldInstallableUnit, + installableUnit)); + } + } + return installableUnit; + } + + /** + * + * + * @generated + */ + public IInstallableUnit basicGetInstallableUnit() { + return installableUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setInstallableUnit(IInstallableUnit newInstallableUnit) { + IInstallableUnit oldInstallableUnit = installableUnit; + installableUnit = newInstallableUnit; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT, oldInstallableUnit, installableUnit)); + } + + /** + * + * + * @generated + */ + @Override + public EList getRequirements() { + if (requirements == null) { + requirements = new EObjectContainmentWithInverseEList<>(RequirementAnalysis.class, this, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS, + AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT); + } + return requirements; + } + + /** + * + * + * @generated + */ + @Override + public EList getCapabilities() { + if (capabilities == null) { + capabilities = new EObjectContainmentWithInverseEList<>(CapabilityAnalysis.class, this, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES, + AnalyzerPackage.CAPABILITY_ANALYSIS__INSTALLABLE_UNIT); + } + return capabilities; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetContribution((ContributionAnalysis) otherEnd, msgs); + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS: + return ((InternalEList) (InternalEList) getRequirements()).basicAdd(otherEnd, msgs); + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES: + return ((InternalEList) (InternalEList) getCapabilities()).basicAdd(otherEnd, msgs); + default: + return super.eInverseAdd(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION: + return basicSetContribution(null, msgs); + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS: + return ((InternalEList) getRequirements()).basicRemove(otherEnd, msgs); + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES: + return ((InternalEList) getCapabilities()).basicRemove(otherEnd, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION: + return eInternalContainer().eInverseRemove(this, + AnalyzerPackage.CONTRIBUTION_ANALYSIS__INSTALLABLE_UNITS, ContributionAnalysis.class, msgs); + default: + return super.eBasicRemoveFromContainerFeature(msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION: + return getContribution(); + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT: + if (resolve) + return getInstallableUnit(); + return basicGetInstallableUnit(); + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS: + return getRequirements(); + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES: + return getCapabilities(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION: + setContribution((ContributionAnalysis) newValue); + return; + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT: + setInstallableUnit((IInstallableUnit) newValue); + return; + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS: + getRequirements().clear(); + getRequirements().addAll((Collection) newValue); + return; + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES: + getCapabilities().clear(); + getCapabilities().addAll((Collection) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION: + setContribution((ContributionAnalysis) null); + return; + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT: + setInstallableUnit((IInstallableUnit) null); + return; + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS: + getRequirements().clear(); + return; + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES: + getCapabilities().clear(); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CONTRIBUTION: + return getContribution() != null; + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__INSTALLABLE_UNIT: + return installableUnit != null; + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS: + return requirements != null && !requirements.isEmpty(); + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__CAPABILITIES: + return capabilities != null && !capabilities.isEmpty(); + default: + return super.eIsSet(featureID); + } + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.emf.ecore.impl.BasicEObjectImpl#toString() + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append("( installableUnit: "); + result.append(installableUnit); + result.append(')'); + return result.toString(); + } + +} // InstallableUnitAnalysisImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/ProjectImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/ProjectImpl.java new file mode 100644 index 000000000..505aa0b6d --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/ProjectImpl.java @@ -0,0 +1,536 @@ +/** + * Copyright (c) 2022 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import java.util.Collection; +import java.util.Date; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +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.common.util.URI; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +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; + +/** + * + * An implementation of the model object 'Project'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl#getName Name}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl#getSite Site}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl#getVersion Version}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl#getReleaseDate Release Date}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl#getContribution Contribution}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl#getParent Parent}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl#getRepositories Repositories}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.ProjectImpl#getSubprojects Subprojects}
  • + *
+ * + * @generated + */ +public class ProjectImpl extends MinimalEObjectImpl.Container implements Project { + /** + * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. + * + * + * @generated + * @ordered + */ + protected int eFlags = 0; + + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getSite() Site}' attribute. + * + * + * @see #getSite() + * @generated + * @ordered + */ + protected static final URI SITE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSite() Site}' attribute. + * + * + * @see #getSite() + * @generated + * @ordered + */ + protected URI site = SITE_EDEFAULT; + + /** + * The default value of the '{@link #getVersion() Version}' attribute. + * + * + * @see #getVersion() + * @generated + * @ordered + */ + protected static final URI VERSION_EDEFAULT = null; + + /** + * The cached value of the '{@link #getVersion() Version}' attribute. + * + * + * @see #getVersion() + * @generated + * @ordered + */ + protected URI version = VERSION_EDEFAULT; + + /** + * The default value of the '{@link #getReleaseDate() Release Date}' attribute. + * + * + * @see #getReleaseDate() + * @generated + * @ordered + */ + protected static final Date RELEASE_DATE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getReleaseDate() Release Date}' attribute. + * + * + * @see #getReleaseDate() + * @generated + * @ordered + */ + protected Date releaseDate = RELEASE_DATE_EDEFAULT; + + /** + * The cached value of the '{@link #getRepositories() Repositories}' containment reference list. + * + * + * @see #getRepositories() + * @generated + * @ordered + */ + protected EList repositories; + + /** + * The cached value of the '{@link #getSubprojects() Subprojects}' containment reference list. + * + * + * @see #getSubprojects() + * @generated + * @ordered + */ + protected EList subprojects; + + /** + * + * + * @generated + */ + protected ProjectImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnalyzerPackage.Literals.PROJECT; + } + + /** + * + * + * @generated + */ + @Override + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + @Override + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.PROJECT__NAME, oldName, name)); + } + + /** + * + * + * @generated + */ + @Override + public URI getSite() { + return site; + } + + /** + * + * + * @generated + */ + @Override + public void setSite(URI newSite) { + URI oldSite = site; + site = newSite; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.PROJECT__SITE, oldSite, site)); + } + + /** + * + * + * @generated + */ + @Override + public URI getVersion() { + return version; + } + + /** + * + * + * @generated + */ + @Override + public void setVersion(URI newVersion) { + URI oldVersion = version; + version = newVersion; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.PROJECT__VERSION, oldVersion, + version)); + } + + /** + * + * + * @generated + */ + @Override + public Date getReleaseDate() { + return releaseDate; + } + + /** + * + * + * @generated + */ + @Override + public void setReleaseDate(Date newReleaseDate) { + Date oldReleaseDate = releaseDate; + releaseDate = newReleaseDate; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.PROJECT__RELEASE_DATE, oldReleaseDate, + releaseDate)); + } + + /** + * + * + * @generated NOT + */ + @Override + public ContributionAnalysis getContribution() { + for (EObject eContainer = eContainer(); eContainer != null; eContainer = eContainer.eContainer()) { + if (eContainer instanceof ContributionAnalysis) { + return (ContributionAnalysis) eContainer; + } + + } + return null; + } + + /** + * + * + * @generated + */ + @Override + public Project getParent() { + if (eContainerFeatureID() != AnalyzerPackage.PROJECT__PARENT) + return null; + return (Project) eInternalContainer(); + } + + /** + * + * + * @generated + */ + @Override + public EList getRepositories() { + if (repositories == null) { + repositories = new EObjectContainmentWithInverseEList<>(GitRepository.class, this, + AnalyzerPackage.PROJECT__REPOSITORIES, AnalyzerPackage.GIT_REPOSITORY__PROJECT); + } + return repositories; + } + + /** + * + * + * @generated + */ + @Override + public EList getSubprojects() { + if (subprojects == null) { + subprojects = new EObjectContainmentWithInverseEList<>(Project.class, this, + AnalyzerPackage.PROJECT__SUBPROJECTS, AnalyzerPackage.PROJECT__PARENT); + } + return subprojects; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.PROJECT__PARENT: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return eBasicSetContainer(otherEnd, AnalyzerPackage.PROJECT__PARENT, msgs); + case AnalyzerPackage.PROJECT__REPOSITORIES: + return ((InternalEList) (InternalEList) getRepositories()).basicAdd(otherEnd, msgs); + case AnalyzerPackage.PROJECT__SUBPROJECTS: + return ((InternalEList) (InternalEList) getSubprojects()).basicAdd(otherEnd, msgs); + default: + return super.eInverseAdd(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.PROJECT__PARENT: + return eBasicSetContainer(null, AnalyzerPackage.PROJECT__PARENT, msgs); + case AnalyzerPackage.PROJECT__REPOSITORIES: + return ((InternalEList) getRepositories()).basicRemove(otherEnd, msgs); + case AnalyzerPackage.PROJECT__SUBPROJECTS: + return ((InternalEList) getSubprojects()).basicRemove(otherEnd, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case AnalyzerPackage.PROJECT__PARENT: + return eInternalContainer().eInverseRemove(this, AnalyzerPackage.PROJECT__SUBPROJECTS, Project.class, + msgs); + default: + return super.eBasicRemoveFromContainerFeature(msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnalyzerPackage.PROJECT__NAME: + return getName(); + case AnalyzerPackage.PROJECT__SITE: + return getSite(); + case AnalyzerPackage.PROJECT__VERSION: + return getVersion(); + case AnalyzerPackage.PROJECT__RELEASE_DATE: + return getReleaseDate(); + case AnalyzerPackage.PROJECT__CONTRIBUTION: + return getContribution(); + case AnalyzerPackage.PROJECT__PARENT: + return getParent(); + case AnalyzerPackage.PROJECT__REPOSITORIES: + return getRepositories(); + case AnalyzerPackage.PROJECT__SUBPROJECTS: + return getSubprojects(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnalyzerPackage.PROJECT__NAME: + setName((String) newValue); + return; + case AnalyzerPackage.PROJECT__SITE: + setSite((URI) newValue); + return; + case AnalyzerPackage.PROJECT__VERSION: + setVersion((URI) newValue); + return; + case AnalyzerPackage.PROJECT__RELEASE_DATE: + setReleaseDate((Date) newValue); + return; + case AnalyzerPackage.PROJECT__REPOSITORIES: + getRepositories().clear(); + getRepositories().addAll((Collection) newValue); + return; + case AnalyzerPackage.PROJECT__SUBPROJECTS: + getSubprojects().clear(); + getSubprojects().addAll((Collection) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnalyzerPackage.PROJECT__NAME: + setName(NAME_EDEFAULT); + return; + case AnalyzerPackage.PROJECT__SITE: + setSite(SITE_EDEFAULT); + return; + case AnalyzerPackage.PROJECT__VERSION: + setVersion(VERSION_EDEFAULT); + return; + case AnalyzerPackage.PROJECT__RELEASE_DATE: + setReleaseDate(RELEASE_DATE_EDEFAULT); + return; + case AnalyzerPackage.PROJECT__REPOSITORIES: + getRepositories().clear(); + return; + case AnalyzerPackage.PROJECT__SUBPROJECTS: + getSubprojects().clear(); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnalyzerPackage.PROJECT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case AnalyzerPackage.PROJECT__SITE: + return SITE_EDEFAULT == null ? site != null : !SITE_EDEFAULT.equals(site); + case AnalyzerPackage.PROJECT__VERSION: + return VERSION_EDEFAULT == null ? version != null : !VERSION_EDEFAULT.equals(version); + case AnalyzerPackage.PROJECT__RELEASE_DATE: + return RELEASE_DATE_EDEFAULT == null ? releaseDate != null : !RELEASE_DATE_EDEFAULT.equals(releaseDate); + case AnalyzerPackage.PROJECT__CONTRIBUTION: + return getContribution() != null; + case AnalyzerPackage.PROJECT__PARENT: + return getParent() != null; + case AnalyzerPackage.PROJECT__REPOSITORIES: + return repositories != null && !repositories.isEmpty(); + case AnalyzerPackage.PROJECT__SUBPROJECTS: + return subprojects != null && !subprojects.isEmpty(); + default: + return super.eIsSet(featureID); + } + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", site: "); + result.append(site); + result.append(", version: "); + result.append(version); + result.append(", releaseDate: "); + result.append(releaseDate); + result.append(')'); + return result.toString(); + } + +} // ProjectImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/RequirementAnalysisImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/RequirementAnalysisImpl.java new file mode 100644 index 000000000..85fa8e812 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/RequirementAnalysisImpl.java @@ -0,0 +1,361 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import java.util.Collection; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution; +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.EObject; +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.equinox.p2.metadata.IRequirement; + +/** + * + * An implementation of the model object 'Requirement Analysis'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementAnalysisImpl#getInstallableUnit Installable Unit}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementAnalysisImpl#getRequirement Requirement}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementAnalysisImpl#getResolutions Resolutions}
  • + *
+ * + * @generated + */ +public class RequirementAnalysisImpl extends MinimalEObjectImpl.Container implements RequirementAnalysis { + /** + * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. + * + * + * @generated + * @ordered + */ + protected int eFlags = 0; + + /** + * The cached value of the '{@link #getRequirement() Requirement}' reference. + * + * + * @see #getRequirement() + * @generated + * @ordered + */ + protected IRequirement requirement; + + /** + * The cached value of the '{@link #getResolutions() Resolutions}' containment reference list. + * + * + * @see #getResolutions() + * @generated + * @ordered + */ + protected EList resolutions; + + /** + * + * + * @generated + */ + protected RequirementAnalysisImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnalyzerPackage.Literals.REQUIREMENT_ANALYSIS; + } + + /** + * + * + * @generated + */ + @Override + public IRequirement getRequirement() { + if (requirement != null && ((EObject) requirement).eIsProxy()) { + InternalEObject oldRequirement = (InternalEObject) requirement; + requirement = (IRequirement) eResolveProxy(oldRequirement); + if (requirement != oldRequirement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + AnalyzerPackage.REQUIREMENT_ANALYSIS__REQUIREMENT, oldRequirement, requirement)); + } + } + return requirement; + } + + /** + * + * + * @generated + */ + public IRequirement basicGetRequirement() { + return requirement; + } + + /** + * + * + * @generated + */ + @Override + public void setRequirement(IRequirement newRequirement) { + IRequirement oldRequirement = requirement; + requirement = newRequirement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.REQUIREMENT_ANALYSIS__REQUIREMENT, + oldRequirement, requirement)); + } + + /** + * + * + * @generated + */ + @Override + public InstallableUnitAnalysis getInstallableUnit() { + if (eContainerFeatureID() != AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT) + return null; + return (InstallableUnitAnalysis) eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetInstallableUnit(InstallableUnitAnalysis newInstallableUnit, + NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newInstallableUnit, + AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT, msgs); + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setInstallableUnit(InstallableUnitAnalysis newInstallableUnit) { + if (newInstallableUnit != eInternalContainer() + || (eContainerFeatureID() != AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT + && newInstallableUnit != null)) { + if (EcoreUtil.isAncestor(this, newInstallableUnit)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newInstallableUnit != null) + msgs = ((InternalEObject) newInstallableUnit).eInverseAdd(this, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS, InstallableUnitAnalysis.class, msgs); + msgs = basicSetInstallableUnit(newInstallableUnit, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT, newInstallableUnit, newInstallableUnit)); + } + + /** + * + * + * @generated + */ + @Override + public EList getResolutions() { + if (resolutions == null) { + resolutions = new EObjectContainmentWithInverseEList<>(RequirementResolution.class, + this, AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS, + AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT); + } + return resolutions; + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetInstallableUnit((InstallableUnitAnalysis) otherEnd, msgs); + case AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS: + return ((InternalEList) (InternalEList) getResolutions()).basicAdd(otherEnd, msgs); + default: + return super.eInverseAdd(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT: + return basicSetInstallableUnit(null, msgs); + case AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS: + return ((InternalEList) getResolutions()).basicRemove(otherEnd, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT: + return eInternalContainer().eInverseRemove(this, + AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS__REQUIREMENTS, InstallableUnitAnalysis.class, msgs); + default: + return super.eBasicRemoveFromContainerFeature(msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT: + return getInstallableUnit(); + case AnalyzerPackage.REQUIREMENT_ANALYSIS__REQUIREMENT: + if (resolve) + return getRequirement(); + return basicGetRequirement(); + case AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS: + return getResolutions(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT: + setInstallableUnit((InstallableUnitAnalysis) newValue); + return; + case AnalyzerPackage.REQUIREMENT_ANALYSIS__REQUIREMENT: + setRequirement((IRequirement) newValue); + return; + case AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS: + getResolutions().clear(); + getResolutions().addAll((Collection) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT: + setInstallableUnit((InstallableUnitAnalysis) null); + return; + case AnalyzerPackage.REQUIREMENT_ANALYSIS__REQUIREMENT: + setRequirement((IRequirement) null); + return; + case AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS: + getResolutions().clear(); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_ANALYSIS__INSTALLABLE_UNIT: + return getInstallableUnit() != null; + case AnalyzerPackage.REQUIREMENT_ANALYSIS__REQUIREMENT: + return requirement != null; + case AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS: + return resolutions != null && !resolutions.isEmpty(); + default: + return super.eIsSet(featureID); + } + } + + /* + * (non-Javadoc) + * + * @see org.eclipse.emf.ecore.impl.BasicEObjectImpl#toString() + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append("( requirement: "); + result.append(requirement); + result.append(')'); + return result.toString(); + } + +} // RequirementAnalysisImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/RequirementResolutionImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/RequirementResolutionImpl.java new file mode 100644 index 000000000..0c7db9024 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/impl/RequirementResolutionImpl.java @@ -0,0 +1,374 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.impl; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; +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.EcoreUtil; + +/** + * + * An implementation of the model object 'Requirement Resolution'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementResolutionImpl#getRequirement Requirement}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementResolutionImpl#getInstallableUnit Installable Unit}
  • + *
  • {@link org.eclipse.cbi.p2repo.aggregator.analyzer.impl.RequirementResolutionImpl#getCapability Capability}
  • + *
+ * + * @generated + */ +public class RequirementResolutionImpl extends MinimalEObjectImpl.Container implements RequirementResolution { + /** + * A set of bit flags representing the values of boolean attributes and whether unsettable features have been set. + * + * + * @generated + * @ordered + */ + protected int eFlags = 0; + + /** + * The cached value of the '{@link #getInstallableUnit() Installable Unit}' reference. + * + * + * @see #getInstallableUnit() + * @generated + * @ordered + */ + protected InstallableUnitAnalysis installableUnit; + + /** + * The cached value of the '{@link #getCapability() Capability}' reference. + * + * + * @see #getCapability() + * @generated + * @ordered + */ + protected CapabilityAnalysis capability; + + /** + * + * + * @generated + */ + protected RequirementResolutionImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return AnalyzerPackage.Literals.REQUIREMENT_RESOLUTION; + } + + /** + * + * + * @generated + */ + @Override + public RequirementAnalysis getRequirement() { + if (eContainerFeatureID() != AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT) + return null; + return (RequirementAnalysis) eInternalContainer(); + } + + /** + * + * + * @generated + */ + public NotificationChain basicSetRequirement(RequirementAnalysis newRequirement, NotificationChain msgs) { + msgs = eBasicSetContainer((InternalEObject) newRequirement, AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT, + msgs); + return msgs; + } + + /** + * + * + * @generated + */ + @Override + public void setRequirement(RequirementAnalysis newRequirement) { + if (newRequirement != eInternalContainer() + || (eContainerFeatureID() != AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT + && newRequirement != null)) { + if (EcoreUtil.isAncestor(this, newRequirement)) + throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); + NotificationChain msgs = null; + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + if (newRequirement != null) + msgs = ((InternalEObject) newRequirement).eInverseAdd(this, + AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS, RequirementAnalysis.class, msgs); + msgs = basicSetRequirement(newRequirement, msgs); + if (msgs != null) + msgs.dispatch(); + } else if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT, + newRequirement, newRequirement)); + } + + /** + * + * + * @generated + */ + @Override + public InstallableUnitAnalysis getInstallableUnit() { + if (installableUnit != null && installableUnit.eIsProxy()) { + InternalEObject oldInstallableUnit = (InternalEObject) installableUnit; + installableUnit = (InstallableUnitAnalysis) eResolveProxy(oldInstallableUnit); + if (installableUnit != oldInstallableUnit) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + AnalyzerPackage.REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT, oldInstallableUnit, + installableUnit)); + } + } + return installableUnit; + } + + /** + * + * + * @generated + */ + public InstallableUnitAnalysis basicGetInstallableUnit() { + return installableUnit; + } + + /** + * + * + * @generated + */ + @Override + public void setInstallableUnit(InstallableUnitAnalysis newInstallableUnit) { + InstallableUnitAnalysis oldInstallableUnit = installableUnit; + installableUnit = newInstallableUnit; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + AnalyzerPackage.REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT, oldInstallableUnit, installableUnit)); + } + + /** + * + * + * @generated + */ + @Override + public CapabilityAnalysis getCapability() { + if (capability != null && capability.eIsProxy()) { + InternalEObject oldCapability = (InternalEObject) capability; + capability = (CapabilityAnalysis) eResolveProxy(oldCapability); + if (capability != oldCapability) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, + AnalyzerPackage.REQUIREMENT_RESOLUTION__CAPABILITY, oldCapability, capability)); + } + } + return capability; + } + + /** + * + * + * @generated + */ + public CapabilityAnalysis basicGetCapability() { + return capability; + } + + /** + * + * + * @generated + */ + @Override + public void setCapability(CapabilityAnalysis newCapability) { + CapabilityAnalysis oldCapability = capability; + capability = newCapability; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, AnalyzerPackage.REQUIREMENT_RESOLUTION__CAPABILITY, + oldCapability, capability)); + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT: + if (eInternalContainer() != null) + msgs = eBasicRemoveFromContainer(msgs); + return basicSetRequirement((RequirementAnalysis) otherEnd, msgs); + default: + return super.eInverseAdd(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT: + return basicSetRequirement(null, msgs); + default: + return super.eInverseRemove(otherEnd, featureID, msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { + switch (eContainerFeatureID()) { + case AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT: + return eInternalContainer().eInverseRemove(this, AnalyzerPackage.REQUIREMENT_ANALYSIS__RESOLUTIONS, + RequirementAnalysis.class, msgs); + default: + return super.eBasicRemoveFromContainerFeature(msgs); + } + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT: + return getRequirement(); + case AnalyzerPackage.REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT: + if (resolve) + return getInstallableUnit(); + return basicGetInstallableUnit(); + case AnalyzerPackage.REQUIREMENT_RESOLUTION__CAPABILITY: + if (resolve) + return getCapability(); + return basicGetCapability(); + default: + return super.eGet(featureID, resolve, coreType); + } + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT: + setRequirement((RequirementAnalysis) newValue); + return; + case AnalyzerPackage.REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT: + setInstallableUnit((InstallableUnitAnalysis) newValue); + return; + case AnalyzerPackage.REQUIREMENT_RESOLUTION__CAPABILITY: + setCapability((CapabilityAnalysis) newValue); + return; + default: + super.eSet(featureID, newValue); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT: + setRequirement((RequirementAnalysis) null); + return; + case AnalyzerPackage.REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT: + setInstallableUnit((InstallableUnitAnalysis) null); + return; + case AnalyzerPackage.REQUIREMENT_RESOLUTION__CAPABILITY: + setCapability((CapabilityAnalysis) null); + return; + default: + super.eUnset(featureID); + return; + } + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case AnalyzerPackage.REQUIREMENT_RESOLUTION__REQUIREMENT: + return getRequirement() != null; + case AnalyzerPackage.REQUIREMENT_RESOLUTION__INSTALLABLE_UNIT: + return installableUnit != null; + case AnalyzerPackage.REQUIREMENT_RESOLUTION__CAPABILITY: + return capability != null; + default: + return super.eIsSet(featureID); + } + } + + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append("( capability: "); + result.append(capability); + result.append(", installableUnit: "); + result.append(installableUnit); + result.append(')'); + return result.toString(); + } + +} // RequirementResolutionImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerAdapterFactory.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerAdapterFactory.java new file mode 100644 index 000000000..e293bba50 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerAdapterFactory.java @@ -0,0 +1,285 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.util; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution; +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; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage + * @generated + */ +public class AnalyzerAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static AnalyzerPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public AnalyzerAdapterFactory() { + if (modelPackage == null) { + modelPackage = AnalyzerPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject) object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the createXXX methods. + * + * + * @generated + */ + protected AnalyzerSwitch modelSwitch = new AnalyzerSwitch<>() { + @Override + public Adapter caseAnalysis(Analysis object) { + return createAnalysisAdapter(); + } + + @Override + public Adapter caseContributionAnalysis(ContributionAnalysis object) { + return createContributionAnalysisAdapter(); + } + + @Override + public Adapter caseInstallableUnitAnalysis(InstallableUnitAnalysis object) { + return createInstallableUnitAnalysisAdapter(); + } + + @Override + public Adapter caseRequirementAnalysis(RequirementAnalysis object) { + return createRequirementAnalysisAdapter(); + } + + @Override + public Adapter caseRequirementResolution(RequirementResolution object) { + return createRequirementResolutionAdapter(); + } + + @Override + public Adapter caseCapabilityAnalysis(CapabilityAnalysis object) { + return createCapabilityAnalysisAdapter(); + } + + @Override + public Adapter caseCapabilityResolution(CapabilityResolution object) { + return createCapabilityResolutionAdapter(); + } + + @Override + public Adapter caseProject(Project object) { + return createProjectAdapter(); + } + + @Override + public Adapter caseGitRepository(GitRepository object) { + return createGitRepositoryAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis Analysis}'. + * + * 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.cbi.p2repo.aggregator.analyzer.Analysis + * @generated + */ + public Adapter createAnalysisAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis Contribution Analysis}'. + * + * 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.cbi.p2repo.aggregator.analyzer.ContributionAnalysis + * @generated + */ + public Adapter createContributionAnalysisAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis Installable Unit Analysis}'. + * + * 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.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis + * @generated + */ + public Adapter createInstallableUnitAnalysisAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis Requirement Analysis}'. + * + * 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.cbi.p2repo.aggregator.analyzer.RequirementAnalysis + * @generated + */ + public Adapter createRequirementAnalysisAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution Requirement Resolution}'. + * + * 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.cbi.p2repo.aggregator.analyzer.RequirementResolution + * @generated + */ + public Adapter createRequirementResolutionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis Capability Analysis}'. + * + * 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.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis + * @generated + */ + public Adapter createCapabilityAnalysisAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution Capability Resolution}'. + * + * 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.cbi.p2repo.aggregator.analyzer.CapabilityResolution + * @generated + */ + public Adapter createCapabilityResolutionAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.Project Project}'. + * + * 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.cbi.p2repo.aggregator.analyzer.Project + * @generated + */ + public Adapter createProjectAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository Git Repository}'. + * + * 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.cbi.p2repo.aggregator.analyzer.GitRepository + * @generated + */ + public Adapter createGitRepositoryAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //AnalyzerAdapterFactory diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerResourceFactoryImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerResourceFactoryImpl.java new file mode 100644 index 000000000..2613c5d76 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerResourceFactoryImpl.java @@ -0,0 +1,63 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.util; + +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.impl.ResourceFactoryImpl; +import org.eclipse.emf.ecore.xmi.XMLResource; +import org.eclipse.emf.ecore.xmi.impl.URIHandlerImpl; + +/** + * + * The Resource Factory associated with the package. + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.util.AnalyzerResourceImpl + * @generated + */ +public class AnalyzerResourceFactoryImpl extends ResourceFactoryImpl { + /** + * Creates an instance of the resource factory. + * + * + * @generated + */ + public AnalyzerResourceFactoryImpl() { + super(); + } + + /** + * Creates an instance of the resource. + * + * + * @generated NOT + */ + @Override + public Resource createResource(URI uri) { + AnalyzerResourceImpl result = new AnalyzerResourceImpl(uri); + + Map defaultLoadOptions = result.getDefaultLoadOptions(); + defaultLoadOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); + defaultLoadOptions.put(XMLResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE); + defaultLoadOptions.put(XMLResource.OPTION_DEFER_IDREF_RESOLUTION, Boolean.TRUE); + defaultLoadOptions.put(XMLResource.OPTION_RECORD_UNKNOWN_FEATURE, Boolean.TRUE); + + Map defaultSaveOptions = result.getDefaultSaveOptions(); + defaultSaveOptions.put(XMLResource.OPTION_EXTENDED_META_DATA, Boolean.TRUE); + defaultSaveOptions.put(XMLResource.OPTION_USE_ENCODED_ATTRIBUTE_STYLE, Boolean.TRUE); + defaultSaveOptions.put(XMLResource.OPTION_LINE_WIDTH, 10); + defaultSaveOptions.put(XMLResource.OPTION_URI_HANDLER, new URIHandlerImpl.PlatformSchemeAware()); + return result; + } + +} // AnalyzerResourceFactoryImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerResourceImpl.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerResourceImpl.java new file mode 100644 index 000000000..e469399af --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerResourceImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.util; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl; + +/** + * + * The Resource associated with the package. + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.util.AnalyzerResourceFactoryImpl + * @generated + */ +public class AnalyzerResourceImpl extends XMIResourceImpl { + /** + * Creates an instance of the resource. + * + * + * @param uri the URI of the new resource. + * @generated + */ + public AnalyzerResourceImpl(URI uri) { + super(uri); + } + +} //AnalyzerResourceImpl diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerSwitch.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerSwitch.java new file mode 100644 index 000000000..f5f54416b --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerSwitch.java @@ -0,0 +1,303 @@ +/** + * Copyright (c) 2021 Eclipse Foundation and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.util; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.Analysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.CapabilityResolution; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.cbi.p2repo.aggregator.analyzer.InstallableUnitAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.Project; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.RequirementResolution; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * + * @see org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage + * @generated + */ +public class AnalyzerSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static AnalyzerPackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public AnalyzerSwitch() { + if (modelPackage == null) { + modelPackage = AnalyzerPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case AnalyzerPackage.ANALYSIS: { + Analysis analysis = (Analysis) theEObject; + T result = caseAnalysis(analysis); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case AnalyzerPackage.CONTRIBUTION_ANALYSIS: { + ContributionAnalysis contributionAnalysis = (ContributionAnalysis) theEObject; + T result = caseContributionAnalysis(contributionAnalysis); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case AnalyzerPackage.INSTALLABLE_UNIT_ANALYSIS: { + InstallableUnitAnalysis installableUnitAnalysis = (InstallableUnitAnalysis) theEObject; + T result = caseInstallableUnitAnalysis(installableUnitAnalysis); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case AnalyzerPackage.REQUIREMENT_ANALYSIS: { + RequirementAnalysis requirementAnalysis = (RequirementAnalysis) theEObject; + T result = caseRequirementAnalysis(requirementAnalysis); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case AnalyzerPackage.REQUIREMENT_RESOLUTION: { + RequirementResolution requirementResolution = (RequirementResolution) theEObject; + T result = caseRequirementResolution(requirementResolution); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case AnalyzerPackage.CAPABILITY_ANALYSIS: { + CapabilityAnalysis capabilityAnalysis = (CapabilityAnalysis) theEObject; + T result = caseCapabilityAnalysis(capabilityAnalysis); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case AnalyzerPackage.CAPABILITY_RESOLUTION: { + CapabilityResolution capabilityResolution = (CapabilityResolution) theEObject; + T result = caseCapabilityResolution(capabilityResolution); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case AnalyzerPackage.PROJECT: { + Project project = (Project) theEObject; + T result = caseProject(project); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case AnalyzerPackage.GIT_REPOSITORY: { + GitRepository gitRepository = (GitRepository) theEObject; + T result = caseGitRepository(gitRepository); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Analysis'. + * + * 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 'Analysis'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAnalysis(Analysis object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Contribution Analysis'. + * + * 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 'Contribution Analysis'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseContributionAnalysis(ContributionAnalysis object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Installable Unit Analysis'. + * + * 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 'Installable Unit Analysis'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseInstallableUnitAnalysis(InstallableUnitAnalysis object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Requirement Analysis'. + * + * 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 'Requirement Analysis'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRequirementAnalysis(RequirementAnalysis object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Requirement Resolution'. + * + * 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 'Requirement Resolution'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRequirementResolution(RequirementResolution object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Capability Analysis'. + * + * 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 'Capability Analysis'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCapabilityAnalysis(CapabilityAnalysis object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Capability Resolution'. + * + * 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 'Capability Resolution'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseCapabilityResolution(CapabilityResolution object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Project'. + * + * 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 'Project'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseProject(Project object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Git Repository'. + * + * 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 'Git Repository'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseGitRepository(GitRepository object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //AnalyzerSwitch diff --git a/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerUtil.java b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerUtil.java new file mode 100644 index 000000000..4a5ec49fa --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.analyzer/src/org/eclipse/cbi/p2repo/aggregator/analyzer/util/AnalyzerUtil.java @@ -0,0 +1,73 @@ +/** + * Copyright (c) 2022 Eclipse contributors and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.analyzer.util; + +import java.util.Date; + +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerFactory; +import org.eclipse.cbi.p2repo.aggregator.analyzer.AnalyzerPackage; +import org.eclipse.cbi.p2repo.aggregator.analyzer.ContributionAnalysis; +import org.eclipse.cbi.p2repo.aggregator.analyzer.GitRepository; +import org.eclipse.emf.common.util.TreeIterator; +import org.eclipse.emf.ecore.EObject; + +public final class AnalyzerUtil { + + private AnalyzerUtil() { + throw new RuntimeException("Not instantiable"); + } + + public static Float getAgeInDays(ContributionAnalysis contributionAnalysis) { + long lastModified = contributionAnalysis.getLastModified(); + if (lastModified != Long.MIN_VALUE) { + return getAgeInDays(lastModified); + } + return null; + } + + public static Float getGitRepositoryAgeInDays(ContributionAnalysis contributionAnalysis) { + Float result = null; + for (TreeIterator eAllContents = contributionAnalysis.eAllContents(); eAllContents.hasNext();) { + EObject eObject = eAllContents.next(); + if (eObject instanceof GitRepository) { + Float ageInDays = getAgeInDays((GitRepository) eObject); + if (ageInDays != null) { + if (result == null) { + result = ageInDays; + } else { + result = Math.min(ageInDays, result); + } + } + } + } + return result; + } + + public static Float getAgeInDays(GitRepository gitRepository) { + long lastModified = gitRepository.getLastModified(); + if (lastModified != Long.MIN_VALUE) { + return getAgeInDays(lastModified); + } + return null; + } + + public static float getAgeInDays(long lastModified) { + long now = System.currentTimeMillis(); + long ageInMillis = Math.max(0, now - lastModified); + float ageInDays = ((float) ageInMillis) / 1000 / 60 / 60 / 24; + return ageInDays; + } + + public static String format(Date date) { + return AnalyzerFactory.eINSTANCE.convertToString(AnalyzerPackage.Literals.DATE, date); + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator.edit/META-INF/MANIFEST.MF index 3ff10b9fe..bd470ce3a 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.aggregator.edit/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator.edit;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.cbi.p2repo.aggregator.provider.AggregatorEditPlugin$Implementation Bundle-Localization: plugin diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/about.html b/org.eclipse.cbi.p2repo.aggregator.edit/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/about.html +++ b/org.eclipse.cbi.p2repo.aggregator.edit/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_configurations_Configuration.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_configurations_Configuration.gif deleted file mode 100644 index f70a1575bdf02220449b6950ca44d215bfa7d402..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 980 zcmZ?wbhEHb6krfw_|Cv!Zy)cQP%Z1(^6=HS7w^8U+j;Eqn{Q9wetZ7zn|=NM2d}?9 zdh_kc+ix%4fBW?1TSV!^=kLG0{`l?5yKiqleS81;n_vIlk6*sU&)@&~>$my)_aD7; z`{si?`|t0+boKPZSG!)m*}s4P{7-L={d#x$|GRVl|Nmzg1*0J_m_k7DCkrD3g9?KV z$Wfp?;m)y^%I)=_IvpvS`G oBP-@`VF7b|qjVWt#D)V5k0)|&X!Dt%nA6U~xg_hZi~xf*0B-b|0ssI2 diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_contacts_Contact.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_contacts_Contact.gif deleted file mode 100644 index 4bc180d2174cbba4773c4ab1b78712a7c1940d04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 999 zcmZ?wbhEHb6krfw_|Cwf-T+ljue_7{>xtp$SJo0$c(Z|!5 z?OV6+`s!Vm*6g~ta{IYW2d=N%b7{lg%j@@CTD$A~hP{^>rfizqiY!{Y8Hqu5;nDn`#5 zX0l6hOo?<@=H@7$tTyN3!v!ZKby70~{(Nk8pDyTSmLV}=p?8}COLE4`q+`x~3<~RI z3@rp)S%gDa-6l?0njowb#+5en!d8~)Y!S1j{InA2m@F5Y)6l@sz$V5TQNm>+^vqLS z&^vEI!wg3ru_nm{C5Z)2&76#}>t4vtNMdI)mM>W0bD`1IQBo{w2Is-04w4cQ6H;Pp I)f5=40qB$dn*aa+ diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_contributions_Contribution.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_contributions_Contribution.gif deleted file mode 100644 index cea1bc39323c55d7a60f3539b5f4649fb8df7d3a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 947 zcmZ?wbhEHb6krfw_|Cx4BrP4PuYW{BLc-=qjFZzIbMyFk`!yaO_3`%g^*|IaG4;sa z@^XnIIub`_&Yxd@f4=>ZT@w5E&;Nhl{{H>_|NqA@>LPJ6mi;#$i2gAnX zqm3K_DN`meE^_H&vrjoQLD9*ZSz14C&jdxr)=BJoDhnhwJ!fe*_x1ae@u9JCvAgNA z5X(SEmZf5h($ diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_customCategories_CustomCategory.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_customCategories_CustomCategory.gif deleted file mode 100644 index cfb1d5884558538703548ee1973b4371bd700e38..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 928 zcmZ?wbhEHb6krfw_|CwvVej?W>UAkiTT+@f_bfb8I{Dz9qn94P{;p;m%RZV9z1ru_56gpQJ&? zhYc5;*_-9X3^EQhIJWaj7>el>ELeP;nN`7Sfy1UHt^EAlaT^Y7Qf23nQ8?AYq0n%4 zHY0~aiNeC={+#N(PBR>)WUzBf>nxdbb0KrvGS-P{XCy8^VC9S0T(pAWqC?~Q1a652 T3x-A}mNa1n0fWuC4h+@+7uj)P diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_mavenMappings_MavenMapping.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_mavenMappings_MavenMapping.gif deleted file mode 100644 index 22cf3ba7acabebe9449c068b30025c61935bc7e3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 954 zcmZ?wbhEHb6krfw_|CxapMl}EgveiE;n$KPIS!J4B_;n#N&Qt&$o1B%O$}(x37ylB zHK#FaPE+>xj*f4gom-bq`!Z$9m#I^KEm&}L^Wy!74xTx4`qs^xPoF+}@$A`)moHzx zdGqz%yN@3}e0~4^>z6M-zJLGy`}cpE0ftd98UhrAfZ|UUMg|6Z1|5(YpgiHuF`c2F zL&jsnf&(nPRtyXQ4;q=7xvf<^0s6ORUe+JX%Qjtz`FVont)o6>r% z6jwR0NZ9GvJZL=J*ve&~VBxXw;2{ns7LSM-3{HU)BwZ$nR9;GDnxrE9q-K_p0)sUG DrEAh; diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_validationRepositories_MappedRepository.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_validationRepositories_MappedRepository.gif deleted file mode 100644 index b1d9e6b845e03865ee906ea49df6adc67a3d14ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 955 zcmZ?wbhEHb6krfw_|CxaY1PO7d;VXX{@~)w2Q{hPTc)1vNL;nH?R<0Y^o4CZOB36s z*RAa>UAS}hmDT-6tI~QmO+CAM!qMWT4@#FkDqa4lYR&WdP47x)*NtuX@1&Ynw(q>B(G!`>7FfjA!G#s3$e6(LprN!i9pj$H=Q>;bD!~;hUu!tuf zVPJ4Lz{p}Cu;z!ygN8P AA^-pY diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_validationRepositories_MetadataRepositoryReference.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_validationRepositories_MetadataRepositoryReference.gif deleted file mode 100644 index b1d9e6b845e03865ee906ea49df6adc67a3d14ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 955 zcmZ?wbhEHb6krfw_|CxaY1PO7d;VXX{@~)w2Q{hPTc)1vNL;nH?R<0Y^o4CZOB36s z*RAa>UAS}hmDT-6tI~QmO+CAM!qMWT4@#FkDqa4lYR&WdP47x)*NtuX@1&Ynw(q>B(G!`>7FfjA!G#s3$e6(LprN!i9pj$H=Q>;bD!~;hUu!tuf zVPJ4Lz{p}Cu;z!ygN8P AA^-pY diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_validationSets_ValidationSet.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateAggregation_validationSets_ValidationSet.gif deleted file mode 100644 index 2360372e32a3aa3a797a9d797f2a4a61ce0c5fbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 962 zcmZ?wbhEHb6krfw_|Cxa^F!j#52=5C%=zOq_^@kI-zfbD?KCS!VgyZ{TP6rm+pV<&{Y@zM(MfQ)D zi5!|~dUT%kv4!@ZHp(BGYII<#$&uMskLC#P?bSat)%^ZU(H)K2yV`7awAyTIvE9{X zyS>F`TeI!fM%zOThKCvrpH{N%uQl3NWBjy|eM7F=<}~&H|Nk?Lg3%BlA_NqFvM@3* zxHIU0)PnMaJI8#6ehwLr4G9Nj6lFvV6c!%lR%GjcF=L{lLyM9-M~cag!)$B}JQiyd zl2jJ83CeS*thms4Y@#$Rp_j9fYvEJ7bSIK;JrPOKOq_^@kI-zfbD?KCS!VgyZ{TP6rm+pV<&{Y@zM(MfQ)D zi5!|~dUT%kv4!@ZHp(BGYII<#$&uMskLC#P?bSat)%^ZU(H)K2yV`7awAyTIvE9{X zyS>F`TeI!fM%zOThKCvrpH{N%uQl3NWBjy|eM7F=<}~&H|Nk?Lg3%BlA_NqFvM@3* zxHIU0)PnMaJI8#6ehwLr4G9Nj6lFvV6c!%lR%GjcF=L{lLyM9-M~cag!)$B}JQiyd zl2jJ83CeS*thms4Y@#$Rp_j9fYvEJ7bSIK;JrPOKxj*f4gom-bq`!Z$9m#I^KEm&}L^Wy!74xTx4`qs^xPoF+}@$A`)moHzx zdGqz%yN@3}e0~4^>z6M-zJLGy`}cpE0ftd98UhrAfZ|UUMg|6Z1|5(YpgiHuF`c2F zL&jsnf&(nPRtyXQ4;q=7xvf<^0s6ORUe+JX%Qjtz`FVont)o6>r% z6jwR0NZ9GvJZL=J*ve&~VBxXw;2{ns7LSM-3{HU)BwZ$nR9;GDnxrE9q-K_p0)sUG DrEAh; diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateContribution_repositories_MappedRepository.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateContribution_repositories_MappedRepository.gif deleted file mode 100644 index b1d9e6b845e03865ee906ea49df6adc67a3d14ab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 955 zcmZ?wbhEHb6krfw_|CxaY1PO7d;VXX{@~)w2Q{hPTc)1vNL;nH?R<0Y^o4CZOB36s z*RAa>UAS}hmDT-6tI~QmO+CAM!qMWT4@#FkDqa4lYR&WdP47x)*NtuX@1&Ynw(q>B(G!`>7FfjA!G#s3$e6(LprN!i9pj$H=Q>;bD!~;hUu!tuf zVPJ4Lz{p}Cu;z!ygN8P AA^-pY diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_bundles_Bundle.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_bundles_Bundle.gif deleted file mode 100644 index 5df43b99512f82a79014736559c1b68d47990b39..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 949 zcmZ?wbhEHb6krfw_|Cv^;OrBV#MQQ08$C*P=k@H#>)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH(H?gyH}H{|uvGGz91p0*XIb7#SE08FWClf%1eq$0UYi4jGRP z3mlkOxELZh794EjRktYdn7C*`GdsV`jvEIQk2yCpDtK@tY)CoCXXqtS@_^wWBfE;n z0S3my511ImggAaYIM~WP*`Zm;C3Di!146Q9B>|a+hgjHEBT6_fHnuuUUAkiTT+@f_bfb8I{Dz9qn94P{;p;m%RZV9z1ru_56gpQJ&? zhYc5;*_-9X3^EQhIJWaj7>el>ELeP;nN`7Sfy1UHt^EAlaT^Y7Qf23nQ8?AYq0n%4 zHY0~aiNeC={+#N(PBR>)WUzBf>nxdbb0KrvGS-P{XCy8^VC9S0T(pAWqC?~Q1a652 T3x-A}mNa1n0fWuC4h+@+7uj)P diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_features_Feature.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_features_Feature.gif deleted file mode 100644 index f9f60a7477f9d4b5bca696e4f6ed0bedba47478e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 998 zcmZ?wbhEHb6krfw_|Cv^;OrBV#MQQ08$C*P=k@H#>)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&?f$esFIN11vEt9G_5VK}I@rgs zubbi0_OxHOYJT5s{{MRO|JPgoe}DM@=ktAC442jhyt&x@|LKzdUvF=%W7ty1u)c!f z(hB$gpRTScVR(G7_U5L-=QocYXf@g2VzRrz_;|PZkq)yXoo3sr4L6k=Y^pGLe>( z5UKxQz%U9%LjWTL6o0ZXGBEfu=zwHEdBUCJFvDyP6{iUu2bwu%TSQbiHaBte`OR2h zm~^a1)VFQP4UOc5JhJ9NCq5J?Cr)M%(PDXV@o$pe`$4MAbotHXa_22{$e(vG>WSF|!zS7I02p?=ww-rO}|HeY2chjm2uF zBfJ7yEOM2O*AF(c^CdlCaAacPYxJu45Yh3VfmuYOhsn~T!GV!s0;9=|4UMks0(vnD cF$xEqm>89uUR*f%RfUB!+IzL1gaCsz04MF}J^%m! diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_mapRules_ExclusionRule.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_mapRules_ExclusionRule.gif deleted file mode 100644 index fa30bcf8be1dc2017e628efc7ce38424a6fbc235..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1015 zcmZ?wbhEHb6krfw_|Cv^g@NHFi|Bbyo(o(&7rA)ual76TRxwFjy(mP=Hfy6t>FzZp z4C^ZxLK=>2DmU0vVX&o+VQU@3wra!Jj?=pvjQ6*g?CWAU&}y=;o8e#|!;ucNBb{bj zC#oFpHt(OYvTn|)j>Ts?mYnNca<*&fsY@%|r>?#9bk6b_>o3n-f92BJfDa3ne^|Ku z#qOKy58iovu=c>&CvPrxKfiJG*R7i8H;?|l+x+eR zwBPqTf8X!=^`PhXqbdKNF8TFx-tQMH{s7Ud_5WXQ{{MQ*@3))&e?0X6)7Af9&;0!c zBya!!{_y|L=l_4d{y)e7!zdWg5K#Qd!pOi-&!7Wx1t?Frb6jEg&+*1#L-T=Vj{iOp z63Hz+62dJ!o(~T?Q=b0uR#3TKb9Ov#IY&LGuBan7m_2?ri5@VcbK(jZ_xt@SB`&M`S24hCxg DNDO?+ diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_mapRules_ValidConfigurationsRule.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateMappedRepository_mapRules_ValidConfigurationsRule.gif deleted file mode 100644 index 1ef9946fce8f3a5c2fef653b0e01eb6295f34028..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 992 zcmZ?wbhEHb6krfw_|Cv!Zyzu1-sBisq#x1i9b4fSUm2cO=bhc_nLRBwyD2)S-lJ%~ zPw{O3qIt;$Z861-;iZ!!N+*U_P7A1+8(%#sxNbpFO{+`m-o*MPVa>~3+x8UKwU#ya z26S&NYnkcayR)KoMnhM(=_=FOo_SRh7B=3Ib=LGEI1(QcB;eB zxZ%W9!+;o$If@(Fg#_%}RzwINYm(HLKP&Oa*qP<%BoTHc!3~X_;>;m!86FEC^>#JN z%FN(cxZq?XTcA+Hhor^_oSfblL~bZOJ;pLg&E2mjO29!#$4a86~R9Irl1h(T(Kgx5_u&Yuf&xckkmFho3Gw`J%ITLeAPdUw;4p{^$Sa z-~Ye;`G58E|GQuRzxw(A_0RwBe*J&@>;H$}|G)hC|LWKO*T4QxoYXmUTJy|lEemJW zu3k{Od~Ri3flE%J{fWbyS_`c^N*!ymZHrUw(qbGEBORyLTK1J&O{}zk|Lnq=cJqae zRPq=gJW?0N2#;!eZgf)--whsxJ>tnJO??0{~zi^uquE diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateValidationSet_contributions_Contribution.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateValidationSet_contributions_Contribution.gif deleted file mode 100644 index 02a8aeedd698b4dc83022474534cf61d3729f141..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b&YU?74GqRK)BgXDpC51k|Gqtt z+qC9daL+Nz;x#&vZM&wc0nye;%Imu1mo`bws}!4ABK+^~dm#Gz`8*K)dA|7f-DaR^ z5TN*zg%QNk0TCcO8CYW!6#7yk?bH}%o;^I}!q!Rs&3%(fJdHn_^jyoHq$#G}FO{6> z9H=pS`3ZKBKCL;YPP$n!=&0TIcCio$YMA{Z;lrYn?Mw?3+~jYx)ZEV1I{h*|pCPBF NDYdaFTUC+48UVYTU{C-6 diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateValidationSet_validationRepositories_MappedRepository.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateValidationSet_validationRepositories_MappedRepository.gif deleted file mode 100644 index 5b03160556d11dd2ad588a8b3b5f9b2550882b22..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6?78%!XVcBJnP(gt4*dTgKR@37|9$(0 zhK8m!*MfVFSr)I+iEP_7T@8q~PEuaiCBL*uYF?$-%o5>$f8PVq-_PfP=+E=Tzwb5! zO@jc%pDc_ZmJWyj*~!2fqoB~25^1N#F!Su;DHpa*>Tm9wRN`s;*`()M_9RU)^?s@3 zOy@w2*~?F`i}Y#DId#&_ia|&1zPF2oKv2W%7YQF0oor`XnBXRVqow9{uGZ<7>G=#f OHBG6FP1&l74AuaM5Mg2f diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateValidationSet_validationRepositories_MetadataRepositoryReference.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/ctool16/CreateValidationSet_validationRepositories_MetadataRepositoryReference.gif deleted file mode 100644 index bcf1f278fa9402f392f4e75d64f7cf0d4057abe6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b&YU?14mbe8|Nrsx1OPi$TRf^3l5&rl0JrMo)AYJYW3#ZZps{ z2vGdV!U$sNfC!MC46HE<3VkV&c4`bW&mNv~Ve6#+=DtZKp2nX|dah+p(iBtgmrBlb z4%C>v`~*Pf diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/obj16/AvailableVersionsHeader.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/obj16/AvailableVersionsHeader.gif index 33854e98c25a13543eb9477dc67b0baf87fc81aa..2121fcb11991778037a7466a8ba9de72b3dd187a 100644 GIT binary patch literal 89 zcmZ?wbhEHb6krfwSjfl#1QTIE@h1yVfQdl|BnpyeVA7h>zw-23e*PH_7quL2IOfhR h<>Tm!y*c4g%7(W)lkz-fOQr@YsVmi#XfQBX0{~#&8?XQX literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgt|Nnblyy&@kGwsY7 zhXV%`f3h$#FmN*HfOLY)U|`WRIO(~1uf^*x-&FV?7P@XXWxbV>;I&}kR~x;L)6}k- WmG`XFrUhE`U)!qgijGBYJ}XDPHzn&fuLrbExPbVZr!49iz*9NM^VTyk)9EZ@P+ Y5T~pf?&7i{3uqgIr>mdKI;Vst04Q!`l>h($ diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/obj16/IUDetails.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/obj16/IUDetails.gif index 30f0c48da8d4450f7e94a696c4de0a7cc41aa728..98a2ba04eecbe9404550fc8f517322ae13d65212 100644 GIT binary patch literal 1008 zcmeH`+e?#S0LH&eXPFlRcQGM!6Hi1JWL z(jBo|_*$@SHw#DlNU7icv9u zVTd3}xDA1S%Lfq*`h0$p3?SsUIsy;{@tqzgeOm~TL5Q{i;jfXrsFI9UOP`yqV8c#W zY{2Fugp#o;iSCx-RfTj^xQp(Jd_=68P!E1G+ewoR8Le>B0laviLZ%Zoj8w{=U01wp z=y_wZ5k@OOMMZZdMKTeu`3|?Cj@u~a$wkF-5wEG9e@{}_CMi_ba}C;z32nx>CR49r zz3yg>cAnI!b5}mde}C0X_GV3KvnMsIiC)%N2S?YQw`8bZ9|u@^0~+U8{*PJaLR%E|SRP%% znU5GL$cul-5QfpB_STjf$|?$aqEmSyeV=iDHa0TCMPE%=Y>By$-+UysS4B(W4`-eG zqb$%Sa#hs(b(NpB40em0lM+`ncbs~uRaQAn7P!5RR`@-PYj diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/obj16/RepositoryBrowser.gif b/org.eclipse.cbi.p2repo.aggregator.edit/icons/full/obj16/RepositoryBrowser.gif index b1f8afa47661703c49bd5fa535dcb1342deb6fc4..6841f88f3ffbf78d349d96c4509138ce431168d5 100644 GIT binary patch literal 596 zcmZ?wbhEHb6krfwIOf8@4VZ`k2Xy`TeAGomZ@h;mp>|7`J{5q^Qtw^ch0_2v;NhM1;H1m zKe#yaLH(w850-{BZTr}|^ULgQm)duKZ{PF1Yv0eV{Xe@8{GPY}=BHI3pYKikzvutQ zo3*F!e?Rl^$Js|e&prPA@mcq;4-@}?y!U?y0>z&!j9d)$3_1)z0E!a^_KgkoP0cOr zZEY=`P3-2q>|OPmn%%wT{hgYYvXj|OP0gk^t5{m=$|_lym>9FQ$S-lWTqfsWXvo?u zv%$sEQb$(C-hic9O7^%c|0#YcJ3ZzWLBZpvC2X~{n3|-;Bqhb9PYD~Tt7|Yei8(qs zIg0V~)-$MmVW{U5vEkyf5#eiMaBI;>JnzUVE2Q#b#Rq>m4hDYK*ocphj&^Z3Gu*hW Y!EvaSg;USrgh$bZCe{fYtV|5n0J42(2)>|nFUJDj}wbA=HP3@{#dCy8s Se%_b*-m diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/pom.xml b/org.eclipse.cbi.p2repo.aggregator.edit/pom.xml index debe0ef48..3ce65da6f 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/pom.xml +++ b/org.eclipse.cbi.p2repo.aggregator.edit/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.aggregator.edit - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT
\ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2/provider/P2ItemProviderAdapterFactory.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2/provider/P2ItemProviderAdapterFactory.java new file mode 100644 index 000000000..f2f0b1477 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2/provider/P2ItemProviderAdapterFactory.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2021 Eclipse contributors and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.p2.provider; + +import org.eclipse.emf.common.notify.Adapter; + +public class P2ItemProviderAdapterFactory extends org.eclipse.cbi.p2repo.p2.provider.P2ItemProviderAdapterFactory { + + @Override + public Adapter createMetadataRepositoryAdapter() { + if (metadataRepositoryItemProvider == null) { + metadataRepositoryItemProvider = new MetadataRepositoryItemProvider(this); + } + + return metadataRepositoryItemProvider; + } + + @Override + public Adapter createProvidedCapabilityAdapter() { + if (providedCapabilityItemProvider == null) { + providedCapabilityItemProvider = new ProvidedCapabilityItemProvider(this); + } + + return providedCapabilityItemProvider; + } + + @Override + public Adapter createRequiredCapabilityAdapter() { + if (requiredCapabilityItemProvider == null) { + requiredCapabilityItemProvider = new RequiredCapabilityItemProvider(this); + } + + return requiredCapabilityItemProvider; + } +} diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2/provider/RequiredCapabilityItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2/provider/RequiredCapabilityItemProvider.java index d1176df26..835288c99 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2/provider/RequiredCapabilityItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2/provider/RequiredCapabilityItemProvider.java @@ -10,8 +10,8 @@ */ package org.eclipse.cbi.p2repo.aggregator.p2.provider; -import org.eclipse.cbi.p2repo.p2.RequiredCapability; import org.eclipse.cbi.p2repo.aggregator.util.CapabilityNamespaceImageProvider; +import org.eclipse.cbi.p2repo.p2.RequiredCapability; import org.eclipse.emf.common.notify.AdapterFactory; public class RequiredCapabilityItemProvider extends org.eclipse.cbi.p2repo.p2.provider.RequiredCapabilityItemProvider { diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/BundleItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/BundleItemProvider.java index 6fd8cd796..5a12d4e1f 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/BundleItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/BundleItemProvider.java @@ -58,6 +58,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Bundle")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/BundlesItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/BundlesItemProvider.java index 923ddbd74..d54dac925 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/BundlesItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/BundlesItemProvider.java @@ -101,6 +101,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Bundles")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/CategoriesItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/CategoriesItemProvider.java index a8afd7d0b..f9ae243d4 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/CategoriesItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/CategoriesItemProvider.java @@ -101,6 +101,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Categories")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/CategoryItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/CategoryItemProvider.java index 665e45276..ad0090517 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/CategoryItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/CategoryItemProvider.java @@ -95,6 +95,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Category")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FeatureItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FeatureItemProvider.java index 6763c52dc..d7d88f011 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FeatureItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FeatureItemProvider.java @@ -92,6 +92,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Feature")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FeaturesItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FeaturesItemProvider.java index 0fafb1a36..27dbf18d3 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FeaturesItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FeaturesItemProvider.java @@ -101,6 +101,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Features")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FragmentItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FragmentItemProvider.java index 14eb0f0fa..a750f315f 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FragmentItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FragmentItemProvider.java @@ -58,6 +58,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Fragment")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FragmentsItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FragmentsItemProvider.java index 6ee758ada..129b314ae 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FragmentsItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/FragmentsItemProvider.java @@ -101,6 +101,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Fragments")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUDetailsItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUDetailsItemProvider.java index 2d02a5971..1118c274b 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUDetailsItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUDetailsItemProvider.java @@ -138,6 +138,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/IUDetails")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUPresentationItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUPresentationItemProvider.java index 51e157ecd..e7dc16671 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUPresentationItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUPresentationItemProvider.java @@ -83,6 +83,16 @@ protected void addFilterPropertyDescriptor(Object object) { ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This adds a property descriptor for the Id feature. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUPresentationWithDetailsItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUPresentationWithDetailsItemProvider.java index e4c7ea8f5..79ec8a4cf 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUPresentationWithDetailsItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/IUPresentationWithDetailsItemProvider.java @@ -128,6 +128,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/IUPresentationWithDetails")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/InstallableUnitsItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/InstallableUnitsItemProvider.java index 04e2e340e..e1237def4 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/InstallableUnitsItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/InstallableUnitsItemProvider.java @@ -108,6 +108,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/InstallableUnits")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/LicensesItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/LicensesItemProvider.java index 9a03aaac8..b6a4ba27a 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/LicensesItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/LicensesItemProvider.java @@ -117,6 +117,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Licenses")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/MetadataRepositoryStructuredViewItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/MetadataRepositoryStructuredViewItemProvider.java index 1e163d150..9514abb4a 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/MetadataRepositoryStructuredViewItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/MetadataRepositoryStructuredViewItemProvider.java @@ -244,6 +244,16 @@ else if (mdr.getStatus().getCode() == StatusCode.WAITING) return baseImage; } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/MiscellaneousItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/MiscellaneousItemProvider.java index f6b7e0096..d1f8bce13 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/MiscellaneousItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/MiscellaneousItemProvider.java @@ -101,6 +101,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Miscellaneous")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/OtherIUItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/OtherIUItemProvider.java index ddebddcd9..7ef0dae14 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/OtherIUItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/OtherIUItemProvider.java @@ -58,6 +58,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/OtherIU")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProductItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProductItemProvider.java index 7573fa998..9fca53d60 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProductItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProductItemProvider.java @@ -92,6 +92,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Product")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProductsItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProductsItemProvider.java index d7a233038..0f7de321b 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProductsItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProductsItemProvider.java @@ -101,6 +101,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Products")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/PropertiesItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/PropertiesItemProvider.java index a8a99ada7..852416fd3 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/PropertiesItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/PropertiesItemProvider.java @@ -117,6 +117,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Properties")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProvidedCapabilitiesItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProvidedCapabilitiesItemProvider.java index fce1d048b..47723e219 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProvidedCapabilitiesItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProvidedCapabilitiesItemProvider.java @@ -118,6 +118,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/ProvidedCapabilities")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProvidedCapabilityWrapperItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProvidedCapabilityWrapperItemProvider.java index 118c15a88..3454d3f7c 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProvidedCapabilityWrapperItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/ProvidedCapabilityWrapperItemProvider.java @@ -21,9 +21,14 @@ import org.eclipse.cbi.p2repo.aggregator.provider.AggregatorItemProviderAdapter; import org.eclipse.cbi.p2repo.aggregator.util.CapabilityNamespaceImageProvider; import org.eclipse.cbi.p2repo.p2.P2Package; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; 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.ecore.EObject; +import org.eclipse.emf.edit.command.CopyCommand.Helper; +import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemColorProvider; @@ -147,6 +152,16 @@ public Object getImage(Object object) { return overlayImage(object, image); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * @@ -187,6 +202,12 @@ public String getText(Object object) { return ((LabelProvider) object).getLabel(); } + + @Override + protected Command createCreateCopyCommand(EditingDomain domain, EObject owner, Helper helper) { + return UnexecutableCommand.INSTANCE; + } + /** * 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}. diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RepositoryBrowserItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RepositoryBrowserItemProvider.java index 79c914fb7..445477239 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RepositoryBrowserItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RepositoryBrowserItemProvider.java @@ -169,6 +169,16 @@ public Object getImage(Object object) { return baseImage; } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RepositoryReferencesItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RepositoryReferencesItemProvider.java index 06ff89b76..71fc054c1 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RepositoryReferencesItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RepositoryReferencesItemProvider.java @@ -118,6 +118,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/RepositoryReferences")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RequirementWrapperItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RequirementWrapperItemProvider.java index bcac7b585..3e0e203ce 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RequirementWrapperItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RequirementWrapperItemProvider.java @@ -21,9 +21,14 @@ import org.eclipse.cbi.p2repo.aggregator.provider.AggregatorItemProviderAdapter; import org.eclipse.cbi.p2repo.aggregator.util.CapabilityNamespaceImageProvider; import org.eclipse.cbi.p2repo.p2.P2Package; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.UnexecutableCommand; 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.ecore.EObject; +import org.eclipse.emf.edit.command.CopyCommand.Helper; +import org.eclipse.emf.edit.domain.EditingDomain; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemColorProvider; @@ -200,6 +205,16 @@ public Object getImage(Object object) { return overlayImage(object, image); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * @@ -244,6 +259,11 @@ public String getText(Object object) { return ((LabelProvider) object).getLabel(); } + @Override + protected Command createCreateCopyCommand(EditingDomain domain, EObject owner, Helper helper) { + return UnexecutableCommand.INSTANCE; + } + /** * 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}. diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RequirementsItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RequirementsItemProvider.java index 8d39b3cf1..09821144e 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RequirementsItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/RequirementsItemProvider.java @@ -117,6 +117,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Requirements")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/TouchpointsItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/TouchpointsItemProvider.java index e8ceb38fa..3f3b35ac6 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/TouchpointsItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/p2view/provider/TouchpointsItemProvider.java @@ -134,6 +134,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Touchpoints")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AggregationItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AggregationItemProvider.java index c51fb0659..54b39a808 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AggregationItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AggregationItemProvider.java @@ -307,6 +307,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Aggregation")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AvailableVersionItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AvailableVersionItemProvider.java index 318c96564..b20568479 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AvailableVersionItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AvailableVersionItemProvider.java @@ -161,6 +161,16 @@ public Object getImage(Object object) { return null; } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AvailableVersionsHeaderItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AvailableVersionsHeaderItemProvider.java index da9d71fb1..7d78cbc22 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AvailableVersionsHeaderItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/AvailableVersionsHeaderItemProvider.java @@ -101,6 +101,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/AvailableVersionsHeader")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/BundleItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/BundleItemProvider.java index e034ddcec..c283915f6 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/BundleItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/BundleItemProvider.java @@ -68,6 +68,16 @@ public Object getImage(Object object) { + (!((Bundle) object).isBranchDisabledOrMappedRepositoryBroken() ? "" : "Disabled"))); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + @Override protected IQuery getInstallableUnitQuery() { return SpecialQueries.createBundleQuery(); diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/CategoryItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/CategoryItemProvider.java index a58908dec..0b3c3eec9 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/CategoryItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/CategoryItemProvider.java @@ -88,6 +88,16 @@ public Object getImage(Object object) { + (!((Category) object).isBranchDisabledOrMappedRepositoryBroken() ? "" : "Disabled"))); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + @Override protected IQuery getInstallableUnitQuery() { return QueryUtil.createIUCategoryQuery(); diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ConfigurationItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ConfigurationItemProvider.java index 78ba53ea1..3f46f86d3 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ConfigurationItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ConfigurationItemProvider.java @@ -136,6 +136,16 @@ public Object getImage(Object object) { .getImage("full/obj16/Configuration" + (((Configuration) object).isEnabled() ? "" : "Disabled"))); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ContactItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ContactItemProvider.java index ae22bbc39..232f0afd8 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ContactItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ContactItemProvider.java @@ -105,6 +105,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Contact")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ContributionItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ContributionItemProvider.java index 5bb2a1b8b..271bc3492 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ContributionItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ContributionItemProvider.java @@ -368,6 +368,16 @@ public Object getImage(Object object) { .getImage("full/obj16/Contribution" + (((Contribution) object).isBranchEnabled() ? "" : "Disabled"))); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * Allow adding children only if the contribution enabled */ diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/CustomCategoryItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/CustomCategoryItemProvider.java index ac84979ac..de051f8f4 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/CustomCategoryItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/CustomCategoryItemProvider.java @@ -239,6 +239,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/CustomCategory")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/DescriptionProviderItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/DescriptionProviderItemProvider.java index 2b5c43196..797500324 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/DescriptionProviderItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/DescriptionProviderItemProvider.java @@ -89,6 +89,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/DescriptionProvider")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ExclusionRuleItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ExclusionRuleItemProvider.java index c3ce3b37e..e54d474b3 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ExclusionRuleItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ExclusionRuleItemProvider.java @@ -58,6 +58,16 @@ public Object getImage(Object object) { + (!((ExclusionRule) object).isBranchDisabledOrMappedRepositoryBroken() ? "" : "Disabled"))); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/FeatureItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/FeatureItemProvider.java index 7a7f8c5db..7a4133cf1 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/FeatureItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/FeatureItemProvider.java @@ -90,6 +90,16 @@ public Object getImage(Object object) { + (!((Feature) object).isBranchDisabledOrMappedRepositoryBroken() ? "" : "Disabled"))); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + @Override protected IQuery getInstallableUnitQuery() { return SpecialQueries.createFeatureQuery(); diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/InstallableUnitRequestItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/InstallableUnitRequestItemProvider.java index b48055174..e6c2a775b 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/InstallableUnitRequestItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/InstallableUnitRequestItemProvider.java @@ -31,6 +31,7 @@ import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemColorProvider; @@ -176,7 +177,11 @@ protected boolean appendIUText(Object object, String typeKey, StringBuilder bld) bld.append(getString(typeKey)); bld.append(" : "); if (id == null) { - bld.append("not mapped"); + if (((EObject) iuRef).eIsProxy()) { + bld.append("unresolved reference " + ((InternalEObject) iuRef).eProxyURI()); + } else { + bld.append("not mapped"); + } return false; } @@ -232,6 +237,16 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { return super.getChildFeature(object, child); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + // hides children when disabled @Override public Collection getChildren(Object object) { diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MapRuleItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MapRuleItemProvider.java index 5341d02a0..eb5671721 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MapRuleItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MapRuleItemProvider.java @@ -66,6 +66,16 @@ protected void addEnabledPropertyDescriptor(Object object) { ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, null, null)); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MappedRepositoryItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MappedRepositoryItemProvider.java index f677a77ec..7d97797ea 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MappedRepositoryItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MappedRepositoryItemProvider.java @@ -306,6 +306,16 @@ public Object getImage(Object object) { return super.getImage(object); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * Allow adding children only if the repository enabled */ diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MappedUnitItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MappedUnitItemProvider.java index f7896ac7d..dfba7e12b 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MappedUnitItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MappedUnitItemProvider.java @@ -80,6 +80,16 @@ protected void addValidConfigurationsPropertyDescriptor(Object object) { null)); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children * that can be created under this object. diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MavenItemItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MavenItemItemProvider.java index b35587bc5..336b62302 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MavenItemItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MavenItemItemProvider.java @@ -151,6 +151,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/MavenItem")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MavenMappingItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MavenMappingItemProvider.java index 9bc12fb61..c3e476b88 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MavenMappingItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MavenMappingItemProvider.java @@ -169,6 +169,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/MavenMapping")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MetadataRepositoryReferenceItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MetadataRepositoryReferenceItemProvider.java index fe38f6dc4..34d573f5d 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MetadataRepositoryReferenceItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/MetadataRepositoryReferenceItemProvider.java @@ -205,6 +205,16 @@ public Object getImage(Object object) { } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ProductItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ProductItemProvider.java index a58ef0251..bf3da0b12 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ProductItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ProductItemProvider.java @@ -68,6 +68,16 @@ public Object getImage(Object object) { + (!((Product) object).isBranchDisabledOrMappedRepositoryBroken() ? "" : "Disabled"))); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + @Override protected IQuery getInstallableUnitQuery() { return SpecialQueries.createProductQuery(); diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/PropertyItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/PropertyItemProvider.java index d4ec14495..d596c0d29 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/PropertyItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/PropertyItemProvider.java @@ -104,6 +104,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Property")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ValidConfigurationsRuleItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ValidConfigurationsRuleItemProvider.java index 45f37fa0d..99e0455f3 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ValidConfigurationsRuleItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ValidConfigurationsRuleItemProvider.java @@ -78,6 +78,16 @@ public Object getImage(Object object) { + (!((ValidConfigurationsRule) object).isBranchDisabledOrMappedRepositoryBroken() ? "" : "Disabled"))); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ValidationSetItemProvider.java b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ValidationSetItemProvider.java index 99bfef7a2..162b87c6d 100644 --- a/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ValidationSetItemProvider.java +++ b/org.eclipse.cbi.p2repo.aggregator.edit/src/org/eclipse/cbi/p2repo/aggregator/provider/ValidationSetItemProvider.java @@ -222,6 +222,16 @@ public Object getImage(Object object) { .getImage("full/obj16/ValidationSet" + (((ValidationSet) object).isEnabled() ? "" : "Disabled"))); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.aggregator.editor.feature/feature.xml b/org.eclipse.cbi.p2repo.aggregator.editor.feature/feature.xml index 4ffe711f0..29f5a1345 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor.feature/feature.xml +++ b/org.eclipse.cbi.p2repo.aggregator.editor.feature/feature.xml @@ -2,8 +2,9 @@ @@ -18,28 +19,36 @@ %license - + diff --git a/org.eclipse.cbi.p2repo.aggregator.editor.feature/pom.xml b/org.eclipse.cbi.p2repo.aggregator.editor.feature/pom.xml index 55d3a6966..678712cd5 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor.feature/pom.xml +++ b/org.eclipse.cbi.p2repo.aggregator.editor.feature/pom.xml @@ -2,15 +2,16 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.aggregator.editor.feature - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-feature org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT - + + org.eclipse.tycho @@ -23,27 +24,6 @@ feature-source - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attach-p2-metadata - package - - p2-metadata - diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator.editor/META-INF/MANIFEST.MF index ed1714af5..95aaf023b 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.aggregator.editor/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator.editor;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.cbi.p2repo.aggregator.presentation.AggregatorEditorPlugin$Implementation Bundle-Localization: plugin diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/about.html b/org.eclipse.cbi.p2repo.aggregator.editor/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/about.html +++ b/org.eclipse.cbi.p2repo.aggregator.editor/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/about.ini b/org.eclipse.cbi.p2repo.aggregator.editor/about.ini new file mode 100644 index 000000000..f17fcd885 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.editor/about.ini @@ -0,0 +1,17 @@ +# about.ini +# contains information about a feature +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# "%key" are externalized strings defined in about.properties +# This file does not need to be translated. + +# Property "aboutText" contains blurb for "About" dialog (translated) + aboutText=%featureText + +# Property "featureImage" contains path to feature image (32x32) +featureImage=cbi32.png + +# Property "appName" contains name of the application (translated) + appName=%featureName + +# Property "welcomePage" contains path to welcome page (special XML-based format) +# welcomePage=$nl$/welcome.xml diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/about.mappings b/org.eclipse.cbi.p2repo.aggregator.editor/about.mappings new file mode 100644 index 000000000..6362b4482 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.editor/about.mappings @@ -0,0 +1,5 @@ +# about.mappings +# contains fill-ins for about.properties + +0=${build.id} +1=${git.commit} diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/about.properties b/org.eclipse.cbi.p2repo.aggregator.editor/about.properties new file mode 100644 index 000000000..c25c7dd71 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator.editor/about.properties @@ -0,0 +1,21 @@ +# Copyright (c) 2022 Eclipse Foundation and others. +# +# This program and the accompanying materials +# are made available under the terms of the Eclipse Public License 2.0 +# which accompanies this distribution, and is available at +# https://www.eclipse.org/legal/epl-2.0/ +# +# SPDX-License-Identifier: EPL-2.0 + +featureName=CBI Aggregator Editor + +featureText=Eclipse CBI Aggregator Editor\n\ +Version: {featureVersion}\n\ +Build: {0}\n\ +Commit: {1}\n\ +\n\ +(c) Copyright Eclipse contributors and others. 2006, 2022. All rights reserved.\n\ +\n\ +This is the CBI Aggregator Editor. It also contains the Engine needed to run an Aggregation from within an IDE.\n\ +\n\ +Visit https://github.com/eclipse-cbi/p2repo-aggregator diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/build.properties b/org.eclipse.cbi.p2repo.aggregator.editor/build.properties index 4fc37ec33..0c6c53380 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/build.properties +++ b/org.eclipse.cbi.p2repo.aggregator.editor/build.properties @@ -11,7 +11,12 @@ bin.includes = .,\ icons/,\ META-INF/,\ plugin.xml,\ - plugin.properties + plugin.properties,\ + about.html,\ + about.ini,\ + about.mappings,\ + about.properties,\ + cbi32.png jars.compile.order = . source.. = src/ output.. = bin diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/cbi32.png b/org.eclipse.cbi.p2repo.aggregator.editor/cbi32.png new file mode 100644 index 0000000000000000000000000000000000000000..544a796baae732178168f2fc9ddd704f96745aed GIT binary patch literal 1415 zcmV;21$g?2P)nKQSx(~)A4^kTdhH3kxW@DdY!^1%pRxFjZc2^v7HHv|<& zMa8Iuv=oE~@j-|o!5705CTc>WiIG5}m}t;iN}*Gj&Nwrjb7s!j+lOIbstm0GdC~uA z@3rt&*4y_SqbLX2%>lcAtwiUQhmi?N8p$o+gG^l{?yCURBWjmr50k4Hu z483vo@V90{C0cE_AAw~JD)U|xiZiS2U>??t)jWTzfYyk+$=!*_d_>*~FaNy(Im~Vw z+!6^*+^4j`@pNfUq0EnG8+S?b(Bjsn%r=068{IjQW=TT<&OpaY2=fuXu*ZI1+lU;% zG<-K`l~Kw#*DyppFKCqkuqq+9-Zx2ryQ!l`!J9x%`~Ff%q0X6kn(%##d@+6upj5FZ zE&C(^8eRuXkb%fkM~5#2IY1`gw>^_*``LV_1)Q4we8BNNqpxOfjX(Q%#4g-#nqH^U zlCOBy4~`Srm@RHNSf9u@jh6Q06Q2aF@?53N69va!KmJGm9)PB%r*Do0OT7SICG>SV z*T3a&0u(F&M8n?LGrx@jv?W)(n~aY5|PZ7*5=IhHH#e# zZByk}Zp}ICezUZm)!H=v5J0Zje2mJ zhNtUiZx}wU&6(>x-#Tpz1>IS(_}CJrfB~Sl&b5Gf0KS%e0Fh{6iD~*FfNZg4&*9-~ zt{ffizABxa@v&CMq;0RY!N`gB4MQVcbJN+jZ8du^P`+bY0!r@jnYFgE0!IM?fyzw) zz6zA{PIN7-87q)Vr!$)$$>tLMlLbK834b(Ed3(Q`iNEA}p)7!inmxS=h;iwuz8^~- zJ_%rm-wxn<*3n#Uyrm2P5p}%QFSc|iVOd3M3RRy@Lh9UC-6W)pY78hPWALCqrGW70 z@F?H|NI+dy4K{uSur0Se(KNoW77z}nX16x4{IF5N*5>gAw&lzM(ApT8N^Sr^Qh23) z{T(8=nCM%9{Z2W!FB&f1E}}`sGw%k?$`HA>Xx^5$TexTwwu|WV00biL^ zJWJ&!ntnb*9y*yVCSNF(Qq}iF8{#VyUzup6{#KoQM4W++U0U-1n)Tt8L#wOS=c9?3 zde{m%UCNhYsbqgsbU)Y&5DTvA@eH#Kly)5ZKq8i1WSD-F>&HGX6y7;h%iBV##j(pb z0cdRux$e5dXBFV~bzG+m4gwQeyg8BOBS)qx;rU|H@d`aPbVzGn2AYJx4xQp39KQ=7 z03f_#=skhmXl`>Z=~#Es1&E+SC*q5N9l+{Re@E)y6wvUV)*5jJI#R%Dkljv2o=o%( zW-pq68l27DS8Lz@0AUXBnr+S4c_BY0)Bl=n>h9Ed3j}&VzS7G0B^>9#`F_p*$DevC V61)D?HgEs{002ovPDHLkV1hP+oWTG9 literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/icons/full/obj16/clean_task.gif b/org.eclipse.cbi.p2repo.aggregator.editor/icons/full/obj16/clean_task.gif new file mode 100644 index 0000000000000000000000000000000000000000..6bc10f9d07cbd44b89abef5dc3732b76491db431 GIT binary patch literal 545 zcmZ?wbhEHb6krfwc*el6XlmuWNoDgVmCx!eUN)n4PJijj*$oS)RBc?`zIJ}gzV(xK ztm@setn0wWDZAHB*u8e*zrVld^p!51Ub}N;@3qt0ubhbqaZ-0IJ^!vxxKfiwb`}^na$!!lV9Q^wB z*~gcUzP)|+_097iAK!j^^Zf76@BjY%{`>papPxVe{rU6%-@pH0z%X=x;!hSv1_n0< z9gvejal*h}*WlLF+|t_C#M{}`-r?HU&)dW0;@~V`=E~L1XJ%?@@8rtgBkX9r+*p*m zoyW=6NXb@&r-#GD#@fzOnxmalSyNF#QiijKOi36ff4;2w^JVS#M-eA>hW&h5`tw!e z&sR;~A18gim-zX*)0gXBzaM4)eo}gPx%RPDrhjhv{JHJ-^=86>IkK-0svcgXa(J=& z>6QBLPdj`&Y4Q4)|K3R=uXn0EU9b0ei|xmwA-gAA?4Dw|Ym(*mdhSDgst0@3-p=EB zyhMLvt<{TmrT_o`Gms7xf3h$#Fz7MpfV6`A#K4y7FulM-M@&$%^VugyiB@JWm4pZr ztLEoRm=;D^FHh$zVNj8g2z`~gNnp?QtrMT{iHL+>nf!0x^Y5i~vQ@>670nH`?Jce~ mW!?Td+WbsBGK#u7{>nO2rYY)3`|HW+EL*0uc$JGIgEasv#fKRH literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/icons/full/obj16/validate_task.gif b/org.eclipse.cbi.p2repo.aggregator.editor/icons/full/obj16/validate_task.gif new file mode 100644 index 0000000000000000000000000000000000000000..402647cd47c1ac9a5ba2ee60cd3cf6e8e2b34b37 GIT binary patch literal 579 zcmZ?wbhEHb6krfwc$UVnS6-2!zW&aQ8++vx&iC}*ICA7zXn5$NMW@TkPhYxpzPI=C z;w3vyojPD*HvQoQ&4*Z1tvn>0zh zv-9G#>4%-1ZyY|n_xzb#XU=#mnR&LcX}`Aao-=38_x0~pR6b~Kx#I8bmu(a&nKjdtAA8O>@G8eP_=)&75_vt^L}L9n1|4d_B#li;B;+cicRA z@~D5{K})NHrsg*e9JHM=<3w`mnd%z9s;b7_8{4;SyK(*cK}+jv+jpGGFG$!w_tMp? zQk`A5uU=)WtC#NT>N>IU@}kAJ&YwSBTDIZ%@jX&9cW&NfpdL{C$->CMkj9_`G7=Og z4D1UU()kk|KD8gBeveN12ACX-KnMZ%)utbdF(n+{|M+p+V7MYD1gd362HH+)l?V{Ji#lm0>04wI}`~Uy| literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/plugin.properties b/org.eclipse.cbi.p2repo.aggregator.editor/plugin.properties index ec166bb7b..b81b22da6 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/plugin.properties +++ b/org.eclipse.cbi.p2repo.aggregator.editor/plugin.properties @@ -49,7 +49,7 @@ _UI_CreateModelError_message = Problems encountered in file "{0}" _UI_AggregatorModelWizard_label = Repository Aggregation _UI_AggregatorModelWizard_description = Create a new Aggregator model -_UI_AggregatorEditor_label = Aggregator Model Editor +_UI_AggregatorEditor_label = Aggregator Editor _UI_AggregatorEditorFilenameDefaultBase = untitled _UI_AggregatorEditorFilenameExtensions = aggr @@ -76,7 +76,7 @@ _UI_P2EditorFilenameExtensions = p2 _UI_P2viewEditor_menu = &P2view Editor _UI_P2viewModelWizard_label = P2view Model _UI_P2viewModelWizard_description = Create a new P2view model -_UI_P2viewEditor_label = P2view Model Editor +_UI_P2viewEditor_label = P2 View Model Editor _UI_P2viewEditorFilenameDefaultBase = My _UI_P2viewEditorFilenameExtensions = p2view diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/plugin.xml b/org.eclipse.cbi.p2repo.aggregator.editor/plugin.xml index a5df2b8ad..e476cd62b 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/plugin.xml +++ b/org.eclipse.cbi.p2repo.aggregator.editor/plugin.xml @@ -45,7 +45,19 @@ - + + + + + + + 4.0.0 org.eclipse.cbi.p2repo.aggregator.editor - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT
\ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/p2view/presentation/P2viewActionBarContributor.java b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/p2view/presentation/P2viewActionBarContributor.java index 063e4965c..1d0f2c20b 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/p2view/presentation/P2viewActionBarContributor.java +++ b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/p2view/presentation/P2viewActionBarContributor.java @@ -10,420 +10,12 @@ */ package org.eclipse.cbi.p2repo.aggregator.p2view.presentation; -import java.util.ArrayList; -import java.util.Collection; - -import org.eclipse.cbi.p2repo.aggregator.presentation.AggregatorEditorPlugin; -import org.eclipse.emf.common.ui.viewer.IViewerProvider; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; -import org.eclipse.emf.edit.ui.action.ControlAction; -import org.eclipse.emf.edit.ui.action.CreateChildAction; -import org.eclipse.emf.edit.ui.action.CreateSiblingAction; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.action.LoadResourceAction; -import org.eclipse.emf.edit.ui.action.ValidateAction; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IAction; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.IContributionManager; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.action.SubContributionItem; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.PartInitException; - /** * This is the action bar contributor for the P2view model editor. * + * This is bogus. * - * @generated + * @generated NOT */ -public class P2viewActionBarContributor extends EditingDomainActionBarContributor implements ISelectionChangedListener { /// - /** - * This keeps track of the active editor. - * - * - * @generated - */ - protected IEditorPart activeEditorPart; - - /** - * This keeps track of the current selection provider. - * - * - * @generated - */ - protected ISelectionProvider selectionProvider; - - /** - * This action opens the Properties view. - * - * - * @generated - */ - protected IAction showPropertiesViewAction = new Action( - AggregatorEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } catch (PartInitException exception) { - AggregatorEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * This action refreshes the viewer of the current editor if the editor - * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. - * - * - * @generated - */ - protected IAction refreshViewerAction = new Action( - AggregatorEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) { - @Override - public boolean isEnabled() { - return activeEditorPart instanceof IViewerProvider; - } - - @Override - public void run() { - if (activeEditorPart instanceof IViewerProvider) { - Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer(); - if (viewer != null) { - viewer.refresh(); - } - } - } - }; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * - * - * @generated - */ - protected Collection createChildActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateChild actions. - * - * - * @generated - */ - protected IMenuManager createChildMenuManager; - - /** - * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor - * generated for the current selection by the item provider. - * - * - * @generated - */ - protected Collection createSiblingActions; - - /** - * This is the menu manager into which menu contribution items should be added for CreateSibling actions. - * - * - * @generated - */ - protected IMenuManager createSiblingMenuManager; - - /** - * This creates an instance of the contributor. - * - * - * @generated - */ - public P2viewActionBarContributor() { - super(ADDITIONS_LAST_STYLE); - loadResourceAction = new LoadResourceAction(); - validateAction = new ValidateAction(); - controlAction = new ControlAction(); - } - - /** - * This inserts global actions before the "additions-end" separator. - * - * - * @generated - */ - @Override - protected void addGlobalActions(IMenuManager menuManager) { - menuManager.insertAfter("additions-end", new Separator("ui-actions")); - menuManager.insertAfter("ui-actions", showPropertiesViewAction); - - refreshViewerAction.setEnabled(refreshViewerAction.isEnabled()); - menuManager.insertAfter("ui-actions", refreshViewerAction); - - super.addGlobalActions(menuManager); - } - - /** - * This adds to the menu bar a menu and some separators for editor additions, - * as well as the sub-menus for object creation items. - * - * - * @generated - */ - @Override - public void contributeToMenu(IMenuManager menuManager) { - super.contributeToMenu(menuManager); - - IMenuManager submenuManager = new MenuManager( - AggregatorEditorPlugin.INSTANCE.getString("_UI_P2viewEditor_menu"), - "org.eclipse.cbi.p2repo.aggregator.p2viewMenuID"); - menuManager.insertAfter("additions", submenuManager); - submenuManager.add(new Separator("settings")); - submenuManager.add(new Separator("actions")); - submenuManager.add(new Separator("additions")); - submenuManager.add(new Separator("additions-end")); - - // Prepare for CreateChild item addition or removal. - // - createChildMenuManager = new MenuManager( - AggregatorEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager( - AggregatorEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener(new IMenuListener() { - @Override - public void menuAboutToShow(IMenuManager menuManager) { - menuManager.updateAll(true); - } - }); - - addGlobalActions(submenuManager); - } - - /** - * This adds Separators for editor additions to the tool bar. - * - * - * @generated - */ - @Override - public void contributeToToolBar(IToolBarManager toolBarManager) { - super.contributeToToolBar(toolBarManager); - toolBarManager.add(new Separator("p2view-settings")); - toolBarManager.add(new Separator("p2view-additions")); - } - - /** - * This removes from the specified manager all {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. - * - * - * @generated - */ - protected void depopulateManager(IContributionManager manager, Collection actions) { - if (actions != null) { - IContributionItem[] items = manager.getItems(); - for (int i = 0; i < items.length; i++) { - // Look into SubContributionItems - // - IContributionItem contributionItem = items[i]; - while (contributionItem instanceof SubContributionItem) { - contributionItem = ((SubContributionItem) contributionItem).getInnerItem(); - } - - // Delete the ActionContributionItems with matching action. - // - if (contributionItem instanceof ActionContributionItem) { - IAction action = ((ActionContributionItem) contributionItem).getAction(); - if (actions.contains(action)) { - manager.remove(contributionItem); - } - } - } - } - } - - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in descriptors, - * and returns the collection of these actions. - * - * - * @generated - */ - protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList<>(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateChildAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in descriptors, - * and returns the collection of these actions. - * - * - * @generated - */ - protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { - Collection actions = new ArrayList<>(); - if (descriptors != null) { - for (Object descriptor : descriptors) { - actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); - } - } - return actions; - } - - /** - * This populates the pop-up menu before it appears. - * - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - super.menuAboutToShow(menuManager); - MenuManager submenuManager = null; - - submenuManager = new MenuManager(AggregatorEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(AggregatorEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - populateManager(submenuManager, createSiblingActions, null); - menuManager.insertBefore("edit", submenuManager); - } - - /** - * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s - * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, - * by inserting them before the specified contribution item contributionID. - * If contributionID is null, they are simply added. - * - * - * @generated - */ - protected void populateManager(IContributionManager manager, Collection actions, - String contributionID) { - if (actions != null) { - for (IAction action : actions) { - if (contributionID != null) { - manager.insertBefore(contributionID, action); - } else { - manager.add(action); - } - } - } - } - - /** - * This ensures that a delete action will clean up all references to deleted objects. - * - * - * @generated - */ - @Override - protected boolean removeAllReferencesOnDelete() { - return true; - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener}, - * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings - * that can be added to the selected object and updating the menus accordingly. - * - * - * @generated - */ - @Override - public void selectionChanged(SelectionChangedEvent event) { - // Remove any menu items for old selection. - // - if (createChildMenuManager != null) { - depopulateManager(createChildMenuManager, createChildActions); - } - if (createSiblingMenuManager != null) { - depopulateManager(createSiblingMenuManager, createSiblingActions); - } - - // Query the new selection for appropriate new child/sibling descriptors - // - Collection newChildDescriptors = null; - Collection newSiblingDescriptors = null; - - ISelection selection = event.getSelection(); - if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) { - Object object = ((IStructuredSelection) selection).getFirstElement(); - - EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain(); - - newChildDescriptors = domain.getNewChildDescriptors(object, null); - newSiblingDescriptors = domain.getNewChildDescriptors(null, object); - } - - // Generate actions for selection; populate and redraw the menus. - // - createChildActions = generateCreateChildActions(newChildDescriptors, selection); - createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection); - - if (createChildMenuManager != null) { - populateManager(createChildMenuManager, createChildActions, null); - createChildMenuManager.update(true); - } - if (createSiblingMenuManager != null) { - populateManager(createSiblingMenuManager, createSiblingActions, null); - createSiblingMenuManager.update(true); - } - } - - /** - * When the active editor changes, this remembers the change and registers with it as a selection provider. - * - * - * @generated - */ - @Override - public void setActiveEditor(IEditorPart part) { - super.setActiveEditor(part); - activeEditorPart = part; - - // Switch to the new selection provider. - // - if (selectionProvider != null) { - selectionProvider.removeSelectionChangedListener(this); - } - if (part == null) { - selectionProvider = null; - } else { - selectionProvider = part.getSite().getSelectionProvider(); - selectionProvider.addSelectionChangedListener(this); - - // Fake a selection changed event to update the menus. - // - if (selectionProvider.getSelection() != null) { - selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection())); - } - } - } - -} +public class P2viewActionBarContributor { +} \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/p2view/presentation/P2viewEditor.java b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/p2view/presentation/P2viewEditor.java index 60302e518..cfe01ae27 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/p2view/presentation/P2viewEditor.java +++ b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/p2view/presentation/P2viewEditor.java @@ -10,1495 +10,12 @@ */ package org.eclipse.cbi.p2repo.aggregator.p2view.presentation; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EventObject; -import java.util.HashMap; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.eclipse.cbi.p2repo.aggregator.p2view.provider.P2viewItemProviderAdapterFactory; -import org.eclipse.cbi.p2repo.aggregator.presentation.AggregatorEditorPlugin; -import org.eclipse.cbi.p2repo.aggregator.provider.AggregatorItemProviderAdapterFactory; -import org.eclipse.core.resources.IFile; -import org.eclipse.core.resources.IMarker; -import org.eclipse.core.resources.IResource; -import org.eclipse.core.resources.IResourceChangeEvent; -import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; -import org.eclipse.core.resources.ResourcesPlugin; -import org.eclipse.core.runtime.CoreException; -import org.eclipse.core.runtime.IPath; -import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.NullProgressMonitor; -import org.eclipse.emf.common.command.BasicCommandStack; -import org.eclipse.emf.common.command.Command; -import org.eclipse.emf.common.command.CommandStack; -import org.eclipse.emf.common.command.CommandStackListener; -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.ui.MarkerHelper; -import org.eclipse.emf.common.ui.editor.ProblemEditorPart; -import org.eclipse.emf.common.ui.viewer.IViewerProvider; -import org.eclipse.emf.common.util.BasicDiagnostic; -import org.eclipse.emf.common.util.Diagnostic; -import org.eclipse.emf.common.util.URI; -import org.eclipse.emf.ecore.resource.Resource; -import org.eclipse.emf.ecore.resource.ResourceSet; -import org.eclipse.emf.ecore.util.EContentAdapter; -import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; -import org.eclipse.emf.edit.domain.EditingDomain; -import org.eclipse.emf.edit.domain.IEditingDomainProvider; -import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; -import org.eclipse.emf.edit.provider.ComposedAdapterFactory; -import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory; -import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory; -import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; -import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; -import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; -import org.eclipse.emf.edit.ui.dnd.LocalTransfer; -import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; -import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; -import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; -import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; -import org.eclipse.emf.edit.ui.util.EditUIUtil; -import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; -import org.eclipse.jface.action.IMenuListener; -import org.eclipse.jface.action.IMenuManager; -import org.eclipse.jface.action.IStatusLineManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.MenuManager; -import org.eclipse.jface.action.Separator; -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.jface.dialogs.ProgressMonitorDialog; -import org.eclipse.jface.util.LocalSelectionTransfer; -import org.eclipse.jface.viewers.ISelection; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.ISelectionProvider; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.StructuredViewer; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.dnd.DND; -import org.eclipse.swt.dnd.FileTransfer; -import org.eclipse.swt.dnd.Transfer; -import org.eclipse.swt.events.ControlAdapter; -import org.eclipse.swt.events.ControlEvent; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.Tree; -import org.eclipse.ui.IActionBars; -import org.eclipse.ui.IEditorInput; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IEditorSite; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PartInitException; -import org.eclipse.ui.actions.WorkspaceModifyOperation; -import org.eclipse.ui.dialogs.SaveAsDialog; -import org.eclipse.ui.ide.IGotoMarker; -import org.eclipse.ui.part.FileEditorInput; -import org.eclipse.ui.part.MultiPageEditorPart; -import org.eclipse.ui.views.contentoutline.ContentOutline; -import org.eclipse.ui.views.contentoutline.ContentOutlinePage; -import org.eclipse.ui.views.contentoutline.IContentOutlinePage; -import org.eclipse.ui.views.properties.IPropertySheetPage; -import org.eclipse.ui.views.properties.PropertySheet; -import org.eclipse.ui.views.properties.PropertySheetPage; - -//import org.eclipse.cbi.p2repo.p2.provider.P2ItemProviderAdapterFactory; - /** * This is an example of a P2view model editor. * + * This is bogus. * - * @generated + * @generated NOT */ -public class P2viewEditor extends MultiPageEditorPart - implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { - /** - * - * - * @generated - */ - public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { - /** - * - * - * @generated - */ - public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * - * - * @generated - */ - @Override - public Object[] getChildren(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * @generated - */ - @Override - public Object[] getElements(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * @generated - */ - @Override - public Object getParent(Object object) { - return null; - } - - /** - * - * - * @generated - */ - @Override - public boolean hasChildren(Object object) { - Object parent = super.getParent(object); - return parent != null; - } - } - - /** - * This looks up a string in the plugin's plugin.properties file. - * - * - * @generated - */ - private static String getString(String key) { - return AggregatorEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return AggregatorEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); - } - - /** - * This keeps track of the editing domain that is used to track all changes to the model. - * - * - * @generated - */ - protected AdapterFactoryEditingDomain editingDomain; - - /** - * This is the one adapter factory used for providing views of the model. - * - * - * @generated - */ - protected ComposedAdapterFactory adapterFactory; - - /** - * This is the content outline page. - * - * - * @generated - */ - protected IContentOutlinePage contentOutlinePage; - - /** - * This is a kludge... - * - * - * @generated - */ - protected IStatusLineManager contentOutlineStatusLineManager; - - /** - * This is the content outline page's viewer. - * - * - * @generated - */ - protected TreeViewer contentOutlineViewer; - - /** - * This is the property sheet page. - * - * - * @generated - */ - protected List propertySheetPages = new ArrayList<>(); - - protected PropertySheetPage propertySheetPage; - - /** - * This is the viewer that shadows the selection in the content outline. - * The parent relation must be correctly defined for this to work. - * - * - * @generated - */ - protected TreeViewer selectionViewer; - - /** - * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. - * - * - * @generated - */ - protected Viewer currentViewer; - - /** - * This listens to which ever viewer is active. - * - * - * @generated - */ - protected ISelectionChangedListener selectionChangedListener; - - /** - * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. - * - * - * @generated - */ - protected Collection selectionChangedListeners = new ArrayList<>(); - - /** - * This keeps track of the selection of the editor as a whole. - * - * - * @generated - */ - protected ISelection editorSelection = StructuredSelection.EMPTY; - - /** - * The MarkerHelper is responsible for creating workspace resource markers presented - * in Eclipse's Problems View. - * - * - * @generated - */ - protected MarkerHelper markerHelper = new EditUIMarkerHelper(); - - /** - * This listens for when the outline becomes active - * - * - * @generated - */ - protected IPartListener partListener = new IPartListener() { - @Override - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(P2viewEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(P2viewEditor.this); - handleActivate(); - } - } else if (p == P2viewEditor.this) { - handleActivate(); - } - } - - @Override - public void partBroughtToTop(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partClosed(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partDeactivated(IWorkbenchPart p) { - // Ignore. - } - - @Override - public void partOpened(IWorkbenchPart p) { - // Ignore. - } - }; - - /** - * Resources that have been removed since last activation. - * - * - * @generated - */ - protected Collection removedResources = new ArrayList<>(); - - /** - * Resources that have been changed since last activation. - * - * - * @generated - */ - protected Collection changedResources = new ArrayList<>(); - - /** - * Resources that have been saved. - * - * - * @generated - */ - protected Collection savedResources = new ArrayList<>(); - - /** - * Map to store the diagnostic associated with a resource. - * - * - * @generated - */ - protected Map resourceToDiagnosticMap = new LinkedHashMap<>(); - - /** - * Controls whether the problem indication should be updated. - * - * - * @generated - */ - protected boolean updateProblemIndication = true; - - /** - * Adapter used to update the problem indication when resources are demanded loaded. - * - * - * @generated - */ - protected EContentAdapter problemIndicationAdapter = new EContentAdapter() { - protected boolean dispatching; - - @Override - public void notifyChanged(Notification notification) { - if (notification.getNotifier() instanceof Resource) { - switch (notification.getFeatureID(Resource.class)) { - case Resource.RESOURCE__IS_LOADED: - case Resource.RESOURCE__ERRORS: - case Resource.RESOURCE__WARNINGS: { - Resource resource = (Resource) notification.getNotifier(); - Diagnostic diagnostic = analyzeResourceProblems(resource, null); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, diagnostic); - } else { - resourceToDiagnosticMap.remove(resource); - } - dispatchUpdateProblemIndication(); - break; - } - } - } else { - super.notifyChanged(notification); - } - } - - protected void dispatchUpdateProblemIndication() { - if (updateProblemIndication && !dispatching) { - dispatching = true; - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - dispatching = false; - updateProblemIndication(); - } - }); - } - } - - @Override - protected void setTarget(Resource target) { - basicSetTarget(target); - } - - @Override - protected void unsetTarget(Resource target) { - basicUnsetTarget(target); - resourceToDiagnosticMap.remove(target); - dispatchUpdateProblemIndication(); - } - }; - - /** - * This listens for workspace changes. - * - * - * @generated - */ - protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() { - @Override - public void resourceChanged(IResourceChangeEvent event) { - IResourceDelta delta = event.getDelta(); - try { - class ResourceDeltaVisitor implements IResourceDeltaVisitor { - protected ResourceSet resourceSet = editingDomain.getResourceSet(); - protected Collection changedResources = new ArrayList<>(); - protected Collection removedResources = new ArrayList<>(); - - @Override - public boolean visit(IResourceDelta delta) { - if (delta.getResource().getType() == IResource.FILE) { - if (delta.getKind() == IResourceDelta.REMOVED || delta.getKind() == IResourceDelta.CHANGED - && delta.getFlags() != IResourceDelta.MARKERS) { - Resource resource = resourceSet.getResource( - URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); - if (resource != null) { - if (delta.getKind() == IResourceDelta.REMOVED) { - removedResources.add(resource); - } else if (!savedResources.remove(resource)) { - changedResources.add(resource); - } - } - } - return false; - } - - return true; - } - - public Collection getChangedResources() { - return changedResources; - } - - public Collection getRemovedResources() { - return removedResources; - } - } - - final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); - delta.accept(visitor); - - if (!visitor.getRemovedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(P2viewEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == P2viewEditor.this) { - handleActivate(); - } - } - }); - } - } catch (CoreException exception) { - AggregatorEditorPlugin.INSTANCE.log(exception); - } - } - }; - - /** - * This creates a model editor. - * - * - * @generated - */ - public P2viewEditor() { - super(); - initializeEditingDomain(); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * Returns a diagnostic describing the errors and warnings listed in the resource - * and the specified exception (if any). - * - * - * @generated - */ - public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) { - boolean hasErrors = !resource.getErrors().isEmpty(); - if (hasErrors || !resource.getWarnings().isEmpty()) { - BasicDiagnostic basicDiagnostic = new BasicDiagnostic(hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, - "org.eclipse.cbi.p2repo.aggregator.editor", 0, - getString("_UI_CreateModelError_message", resource.getURI()), - new Object[] { exception == null ? (Object) resource : exception }); - basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); - return basicDiagnostic; - } else if (exception != null) { - return new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.cbi.p2repo.aggregator.editor", 0, - getString("_UI_CreateModelError_message", resource.getURI()), new Object[] { exception }); - } else { - return Diagnostic.OK_INSTANCE; - } - } - - /** - * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. - * - * - * @generated - */ - protected void createContextMenuFor(StructuredViewer viewer) { - MenuManager contextMenu = new MenuManager("#PopUp"); - contextMenu.add(new Separator("additions")); - contextMenu.setRemoveAllWhenShown(true); - contextMenu.addMenuListener(this); - Menu menu = contextMenu.createContextMenu(viewer.getControl()); - viewer.getControl().setMenu(menu); - getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); - - int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; - Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), - FileTransfer.getInstance() }; - viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); - viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); - } - - /** - * This is the method called to load a resource into the editing domain's resource set based on the editor's input. - * - * - * @generated - */ - public void createModel() { - URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter()); - Exception exception = null; - Resource resource = null; - try { - // Load the resource through the editing domain. - // - resource = editingDomain.getResourceSet().getResource(resourceURI, true); - } catch (Exception e) { - exception = e; - resource = editingDomain.getResourceSet().getResource(resourceURI, false); - } - - Diagnostic diagnostic = analyzeResourceProblems(resource, exception); - if (diagnostic.getSeverity() != Diagnostic.OK) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); - } - - /** - * This is the method used by the framework to install your own controls. - * - * - * @generated - */ - @Override - public void createPages() { - // Creates the model from the editor input - // - createModel(); - - // Only creates the other pages if there is something that can be edited - // - if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { - // Create a page for the selection tree view. - // - Tree tree = new Tree(getContainer(), SWT.MULTI); - selectionViewer = new TreeViewer(tree); - setCurrentViewer(selectionViewer); - - selectionViewer.setUseHashlookup(true); - selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - selectionViewer.setLabelProvider( - new AdapterFactoryLabelProvider.FontAndColorProvider(adapterFactory, selectionViewer)); - selectionViewer.setInput(editingDomain.getResourceSet()); - selectionViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), - true); - - new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); - - createContextMenuFor(selectionViewer); - int pageIndex = addPage(tree); - setPageText(pageIndex, getString("_UI_SelectionPage_label")); - - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - if (!getContainer().isDisposed()) { - setActivePage(0); - } - } - }); - } - - // Ensures that this editor will only display the page's tab - // area if there are more than one page - // - getContainer().addControlListener(new ControlAdapter() { - boolean guard = false; - - @Override - public void controlResized(ControlEvent event) { - if (!guard) { - guard = true; - hideTabs(); - guard = false; - } - } - }); - - getSite().getShell().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - updateProblemIndication(); - } - }); - } - - /** - * - * - * @generated - */ - @Override - public void dispose() { - updateProblemIndication = false; - - ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); - - getSite().getPage().removePartListener(partListener); - - adapterFactory.dispose(); - - if (getActionBarContributor().getActiveEditor() == this) { - getActionBarContributor().setActiveEditor(null); - } - - for (PropertySheetPage propertySheetPage : propertySheetPages) { - propertySheetPage.dispose(); - } - - if (contentOutlinePage != null) { - contentOutlinePage.dispose(); - } - - super.dispose(); - } - - /** - * This is for implementing {@link IEditorPart} and simply saves the model file. - * - * - * @generated - */ - @Override - public void doSave(IProgressMonitor progressMonitor) { - // Save only resources that have actually changed. - // - final Map saveOptions = new HashMap<>(); - saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); - saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); - - // Do the work within an operation because this is a long running activity that modifies the workbench. - // - WorkspaceModifyOperation operation = new WorkspaceModifyOperation() { - // This is the method that gets invoked when the operation runs. - // - @Override - public void execute(IProgressMonitor monitor) { - // Save the resources to the file system. - // - boolean first = true; - List resources = editingDomain.getResourceSet().getResources(); - for (int i = 0; i < resources.size(); ++i) { - Resource resource = resources.get(i); - if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) - && !editingDomain.isReadOnly(resource)) { - try { - long timeStamp = resource.getTimeStamp(); - resource.save(saveOptions); - if (resource.getTimeStamp() != timeStamp) { - savedResources.add(resource); - } - } catch (Exception exception) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - first = false; - } - } - } - }; - - updateProblemIndication = false; - try { - // This runs the options, and shows progress. - // - new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); - - // Refresh the necessary state. - // - ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); - firePropertyChange(IEditorPart.PROP_DIRTY); - } catch (Exception exception) { - // Something went wrong that shouldn't. - // - AggregatorEditorPlugin.INSTANCE.log(exception); - } - updateProblemIndication = true; - updateProblemIndication(); - } - - /** - * This also changes the editor's input. - * - * - * @generated - */ - @Override - public void doSaveAs() { - SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); - saveAsDialog.open(); - IPath path = saveAsDialog.getResult(); - if (path != null) { - IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); - if (file != null) { - doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); - } - } - } - - /** - * - * - * @generated - */ - protected void doSaveAs(URI uri, IEditorInput editorInput) { - (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null - ? getActionBars().getStatusLineManager().getProgressMonitor() - : new NullProgressMonitor(); - doSave(progressMonitor); - } - - /** - * This is here for the listener to be able to call it. - * - * - * @generated - */ - @Override - protected void firePropertyChange(int action) { - super.firePropertyChange(action); - } - - /** - * - * - * @generated - */ - public EditingDomainActionBarContributor getActionBarContributor() { - return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); - } - - /** - * - * - * @generated - */ - public IActionBars getActionBars() { - return getActionBarContributor().getActionBars(); - } - - /** - * This is how the framework determines which interfaces we implement. - * - * - * @generated - */ - @Override - public T getAdapter(Class key) { - if (key.equals(IContentOutlinePage.class)) { - return showOutlineView() ? key.cast(getContentOutlinePage()) : null; - } else if (key.equals(IPropertySheetPage.class)) { - return key.cast(getPropertySheetPage()); - } else if (key.equals(IGotoMarker.class)) { - return key.cast(this); - } else { - return super.getAdapter(key); - } - } - - /** - * - * - * @generated - */ - public AdapterFactory getAdapterFactory() { - return adapterFactory; - } - - /** - * This accesses a cached version of the content outliner. - * - * - * @generated - */ - public IContentOutlinePage getContentOutlinePage() { - if (contentOutlinePage == null) { - // The content outline is just a tree. - // - class MyContentOutlinePage extends ContentOutlinePage { - @Override - public void createControl(Composite parent) { - super.createControl(parent); - contentOutlineViewer = getTreeViewer(); - contentOutlineViewer.addSelectionChangedListener(this); - - // Set up the tree viewer. - // - contentOutlineViewer.setUseHashlookup(true); - contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); - contentOutlineViewer.setLabelProvider( - new AdapterFactoryLabelProvider.FontAndColorProvider(adapterFactory, contentOutlineViewer)); - contentOutlineViewer.setInput(editingDomain.getResourceSet()); - - // Make sure our popups work. - // - createContextMenuFor(contentOutlineViewer); - - if (!editingDomain.getResourceSet().getResources().isEmpty()) { - // Select the root object in the view. - // - contentOutlineViewer.setSelection( - new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); - } - } - - @Override - public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, - IStatusLineManager statusLineManager) { - super.makeContributions(menuManager, toolBarManager, statusLineManager); - contentOutlineStatusLineManager = statusLineManager; - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - } - - contentOutlinePage = new MyContentOutlinePage(); - - // Listen to selection so that we can handle it is a special way. - // - contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() { - // This ensures that we handle selections correctly. - // - @Override - public void selectionChanged(SelectionChangedEvent event) { - handleContentOutlineSelection(event.getSelection()); - } - }); - } - - return contentOutlinePage; - } - - /** - * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. - * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} - * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. - * - * - * @generated - */ - @Override - public EditingDomain getEditingDomain() { - return editingDomain; - } - - /** - * This accesses a cached version of the property sheet. - * - * - * @generated - */ - public IPropertySheetPage getPropertySheetPage() { - PropertySheetPage propertySheetPage = new ExtendedPropertySheetPage(editingDomain, - ExtendedPropertySheetPage.Decoration.NONE, null, 0, false) { - @Override - public void setSelectionToViewer(List selection) { - P2viewEditor.this.setSelectionToViewer(selection); - P2viewEditor.this.setFocus(); - } - - @Override - public void setActionBars(IActionBars actionBars) { - super.setActionBars(actionBars); - getActionBarContributor().shareGlobalActions(this, actionBars); - } - }; - propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); - propertySheetPages.add(propertySheetPage); - - return propertySheetPage; - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * @generated - */ - @Override - public ISelection getSelection() { - return editorSelection; - } - - /** - * This returns the viewer as required by the {@link IViewerProvider} interface. - * - * - * @generated - */ - @Override - public Viewer getViewer() { - return currentViewer; - } - - /** - * - * - * @generated - */ - @Override - public void gotoMarker(IMarker marker) { - List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); - if (!targetObjects.isEmpty()) { - setSelectionToViewer(targetObjects); - } - } - - /** - * Handles activation of the editor or it's associated views. - * - * - * @generated - */ - protected void handleActivate() { - // Recompute the read only state. - // - if (editingDomain.getResourceToReadOnlyMap() != null) { - editingDomain.getResourceToReadOnlyMap().clear(); - - // Refresh any actions that may become enabled or disabled. - // - setSelection(getSelection()); - } - - if (!removedResources.isEmpty()) { - if (handleDirtyConflict()) { - getSite().getPage().closeEditor(P2viewEditor.this, false); - } else { - removedResources.clear(); - changedResources.clear(); - savedResources.clear(); - } - } else if (!changedResources.isEmpty()) { - changedResources.removeAll(savedResources); - handleChangedResources(); - changedResources.clear(); - savedResources.clear(); - } - } - - /** - * Handles what to do with changed resources on activation. - * - * - * @generated - */ - protected void handleChangedResources() { - if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { - ResourceSet resourceSet = editingDomain.getResourceSet(); - if (isDirty()) { - changedResources.addAll(resourceSet.getResources()); - } - editingDomain.getCommandStack().flush(); - - updateProblemIndication = false; - for (Resource resource : changedResources) { - if (resource.isLoaded()) { - resource.unload(); - try { - resource.load(resourceSet.getLoadOptions()); - } catch (IOException exception) { - if (!resourceToDiagnosticMap.containsKey(resource)) { - resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); - } - } - } - } - - if (AdapterFactoryEditingDomain.isStale(editorSelection)) { - setSelection(StructuredSelection.EMPTY); - } - - updateProblemIndication = true; - updateProblemIndication(); - } - } - - /** - * This deals with how we want selection in the outliner to affect the other views. - * - * - * @generated - */ - public void handleContentOutlineSelection(ISelection selection) { - if (selectionViewer != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { - Iterator selectedElements = ((IStructuredSelection) selection).iterator(); - if (selectedElements.hasNext()) { - // Get the first selected element. - // - Object selectedElement = selectedElements.next(); - - ArrayList selectionList = new ArrayList<>(); - selectionList.add(selectedElement); - while (selectedElements.hasNext()) { - selectionList.add(selectedElements.next()); - } - - // Set the selection to the widget. - // - selectionViewer.setSelection(new StructuredSelection(selectionList)); - } - } - } - - /** - * Shows a dialog that asks if conflicting changes should be discarded. - * - * - * @generated - */ - protected boolean handleDirtyConflict() { - return MessageDialog.openQuestion(getSite().getShell(), getString("_UI_FileConflict_label"), - getString("_WARN_FileConflict")); - } - - /** - * If there is just one page in the multi-page editor part, - * this hides the single tab at the bottom. - * - * - * @generated - */ - protected void hideTabs() { - if (getPageCount() <= 1) { - setPageText(0, ""); - if (getContainer() instanceof CTabFolder) { - Point point = getContainer().getSize(); - Rectangle clientArea = getContainer().getClientArea(); - getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); - } - } - } - - /** - * This is called during startup. - * - * - * @generated - */ - @Override - public void init(IEditorSite site, IEditorInput editorInput) { - setSite(site); - setInputWithNotify(editorInput); - setPartName(editorInput.getName()); - site.setSelectionProvider(this); - site.getPage().addPartListener(partListener); - ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, - IResourceChangeEvent.POST_CHANGE); - } - - /** - * This sets up the editing domain for the model editor. - * - * @generated NOT - */ - protected void initializeEditingDomain() { - // Create an adapter factory that yields item providers. - // - adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE); - - adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new AggregatorItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new P2viewItemProviderAdapterFactory()); - // adapterFactory.addAdapterFactory(new P2ItemProviderAdapterFactory()); - adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); - - // Create the command stack that will notify this editor as commands are executed. - // - BasicCommandStack commandStack = new BasicCommandStack(); - - // Add a listener to set the most recent command's affected objects to be the selection of the viewer with - // focus. - // - commandStack.addCommandStackListener(new CommandStackListener() { - @Override - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec(new Runnable() { - @Override - public void run() { - firePropertyChange(IEditorPart.PROP_DIRTY); - - // Try to select the affected objects. - // - Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); - if (mostRecentCommand != null) { - setSelectionToViewer(mostRecentCommand.getAffectedObjects()); - } - if (propertySheetPage != null && !propertySheetPage.getControl().isDisposed()) { - propertySheetPage.refresh(); - } - } - }); - } - }); - - // Create the editing domain with a special command stack. - // - editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); - } - - /** - * This is for implementing {@link IEditorPart} and simply tests the command stack. - * - * - * @generated - */ - @Override - public boolean isDirty() { - return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); - } - - /** - * This returns whether something has been persisted to the URI of the specified resource. - * The implementation uses the URI converter from the editor's resource set to try to open an input stream. - * - * - * @generated - */ - protected boolean isPersisted(Resource resource) { - boolean result = false; - try { - InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI()); - if (stream != null) { - result = true; - stream.close(); - } - } catch (IOException e) { - // Ignore - } - return result; - } - - /** - * This always returns true because it is not currently supported. - * - * - * @generated - */ - @Override - public boolean isSaveAsAllowed() { - return true; - } - - /** - * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. - * - * - * @generated - */ - @Override - public void menuAboutToShow(IMenuManager menuManager) { - ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); - } - - /** - * This is used to track the active viewer. - * - * - * @generated - */ - @Override - protected void pageChange(int pageIndex) { - super.pageChange(pageIndex); - - if (contentOutlinePage != null) { - handleContentOutlineSelection(contentOutlinePage.getSelection()); - } - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, - * is the current one. - * - * - * @generated - */ - public void setCurrentViewer(Viewer viewer) { - // If it is changing... - // - if (currentViewer != viewer) { - if (selectionChangedListener == null) { - // Create the listener on demand. - // - selectionChangedListener = new ISelectionChangedListener() { - // This just notifies those things that are affected by the section. - // - @Override - public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { - setSelection(selectionChangedEvent.getSelection()); - } - }; - } - - // Stop listening to the old one. - // - if (currentViewer != null) { - currentViewer.removeSelectionChangedListener(selectionChangedListener); - } - - // Start listening to the new one. - // - if (viewer != null) { - viewer.addSelectionChangedListener(selectionChangedListener); - } - - // Remember it. - // - currentViewer = viewer; - - // Set the editors selection based on the current viewer's selection. - // - setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); - } - } - - /** - * - * - * @generated - */ - @Override - public void setFocus() { - getControl(getActivePage()).setFocus(); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. - * Calling this result will notify the listeners. - * - * - * @generated - */ - @Override - public void setSelection(ISelection selection) { - editorSelection = selection; - - for (ISelectionChangedListener listener : selectionChangedListeners) { - listener.selectionChanged(new SelectionChangedEvent(this, selection)); - } - setStatusLineManager(selection); - } - - /** - * This sets the selection into whichever viewer is active. - * - * - * @generated - */ - public void setSelectionToViewer(Collection collection) { - final Collection theSelection = collection; - // Make sure it's okay. - // - if (theSelection != null && !theSelection.isEmpty()) { - Runnable runnable = new Runnable() { - @Override - public void run() { - // Try to select the items in the current content viewer of the editor. - // - if (currentViewer != null) { - currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); - } - } - }; - getSite().getShell().getDisplay().asyncExec(runnable); - } - } - - /** - * - * - * @generated - */ - public void setStatusLineManager(ISelection selection) { - IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer - ? contentOutlineStatusLineManager - : getActionBars().getStatusLineManager(); - - if (statusLineManager != null) { - if (selection instanceof IStructuredSelection) { - Collection collection = ((IStructuredSelection) selection).toList(); - switch (collection.size()) { - case 0: { - statusLineManager.setMessage(getString("_UI_NoObjectSelected")); - break; - } - case 1: { - String text = new AdapterFactoryItemDelegator(adapterFactory) - .getText(collection.iterator().next()); - statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); - break; - } - default: { - statusLineManager - .setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); - break; - } - } - } else { - statusLineManager.setMessage(""); - } - } - } - - /** - * Returns whether the outline view should be presented to the user. - * - * - * @generated - */ - protected boolean showOutlineView() { - return false; - } - - /** - * If there is more than one page in the multi-page editor part, - * this shows the tabs at the bottom. - * - * - * @generated - */ - protected void showTabs() { - if (getPageCount() > 1) { - setPageText(0, getString("_UI_SelectionPage_label")); - if (getContainer() instanceof CTabFolder) { - Point point = getContainer().getSize(); - Rectangle clientArea = getContainer().getClientArea(); - getContainer().setSize(point.x, clientArea.height + clientArea.y); - } - } - } - - /** - * Updates the problems indication with the information described in the specified diagnostic. - * - * - * @generated - */ - protected void updateProblemIndication() { - if (updateProblemIndication) { - BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, "org.eclipse.cbi.p2repo.aggregator.editor", - 0, null, new Object[] { editingDomain.getResourceSet() }); - for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { - if (childDiagnostic.getSeverity() != Diagnostic.OK) { - diagnostic.add(childDiagnostic); - } - } - - int lastEditorPage = getPageCount() - 1; - if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { - ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); - if (diagnostic.getSeverity() != Diagnostic.OK) { - setActivePage(lastEditorPage); - } - } else if (diagnostic.getSeverity() != Diagnostic.OK) { - ProblemEditorPart problemEditorPart = new ProblemEditorPart(); - problemEditorPart.setDiagnostic(diagnostic); - problemEditorPart.setMarkerHelper(markerHelper); - try { - addPage(++lastEditorPage, problemEditorPart, getEditorInput()); - setPageText(lastEditorPage, problemEditorPart.getPartName()); - setActivePage(lastEditorPage); - showTabs(); - } catch (PartInitException exception) { - AggregatorEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - try { - markerHelper.updateMarkers(diagnostic); - } catch (CoreException exception) { - AggregatorEditorPlugin.INSTANCE.log(exception); - } - } - } - } -} +public class P2viewEditor { +} \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/AggregatorActionBarContributor.java b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/AggregatorActionBarContributor.java index c5933c1d4..8e8a2721b 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/AggregatorActionBarContributor.java +++ b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/AggregatorActionBarContributor.java @@ -84,10 +84,13 @@ import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.ui.action.CollapseAllAction; import org.eclipse.emf.edit.ui.action.CreateChildAction; import org.eclipse.emf.edit.ui.action.CreateSiblingAction; import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor; +import org.eclipse.emf.edit.ui.action.ExpandAllAction; import org.eclipse.emf.edit.ui.action.LoadResourceAction; +import org.eclipse.emf.edit.ui.action.RevertAction; import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; import org.eclipse.equinox.app.IApplication; import org.eclipse.equinox.p2.metadata.IInstallableUnit; @@ -133,7 +136,10 @@ import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbench; import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.progress.IProgressService; import org.xml.sax.SAXException; /** @@ -229,9 +235,11 @@ public BuildAggregationAction(Builder.ActionType actionType) { switch (actionType) { case CLEAN: txt = "Clean Aggregation"; + imageURLPath = "full/obj16/clean_task.gif"; break; case VALIDATE: txt = "Validate Aggregation"; + imageURLPath = "full/obj16/validate_task.gif"; break; case BUILD: txt = "Build Aggregation"; @@ -260,7 +268,7 @@ public void run() { } if (saveModel()) { - new Job("CBI Aggregator") { + Job job = new Job("CBI Aggregator") { { setUser(true); setPriority(Job.LONG); @@ -305,7 +313,14 @@ protected IStatus run(IProgressMonitor monitor) { return Status.OK_STATUS; } - }.schedule(); + }; + + job.schedule(); + if (actionType == ActionType.VALIDATE) { + IWorkbench workbench = PlatformUI.getWorkbench(); + IProgressService progressService = workbench.getProgressService(); + progressService.showInDialog(null, job); + } } } @@ -928,10 +943,14 @@ public AggregatorActionBarContributor() { verifyRepoAction = new BuildAggregationAction(ActionType.VALIDATE); buildRepoAction = new BuildAggregationAction(ActionType.BUILD); cleanBuildRepoAction = new BuildAggregationAction(ActionType.CLEAN_BUILD); + revertAction = new RevertAction(); + expandAllAction = new ExpandAllAction(); + collapseAllAction = new CollapseAllAction(); } @Override protected void addGlobalActions(IMenuManager menuManager) { + menuManager.insertBefore("additions", new Separator()); menuManager.insertBefore("additions", new ActionContributionItem(cleanRepoAction)); menuManager.insertBefore("additions", new ActionContributionItem(verifyRepoAction)); menuManager.insertBefore("additions", new ActionContributionItem(buildRepoAction)); @@ -1151,7 +1170,7 @@ private Aggregation getAggregation() { if (activeEditorPart == null || !(activeEditorPart instanceof IEditingDomainProvider)) return null; - if (lastActiveEditorPart == activeEditorPart) + if (lastActiveEditorPart == activeEditorPart && (aggregation == null || !((EObject) aggregation).eIsProxy())) return aggregation; lastActiveEditorPart = activeEditorPart; @@ -1159,14 +1178,17 @@ private Aggregation getAggregation() { IEditingDomainProvider edProvider = (IEditingDomainProvider) activeEditorPart; List resources = new ArrayList<>(edProvider.getEditingDomain().getResourceSet().getResources()); - Resource aggregatorResource = null; for (Resource resource : resources) if (resource instanceof AggregatorResourceImpl) { - aggregatorResource = resource; - break; + EList contents = resource.getContents(); + if (contents.size() == 1) { + EObject eObject = contents.get(0); + if (eObject instanceof Aggregation) { + return aggregation = (Aggregation) eObject; + } + } } - return aggregation = (aggregatorResource == null ? null - : (Aggregation) aggregatorResource.getContents().get(0)); + return aggregation = null; } @Override @@ -1199,6 +1221,7 @@ public void menuAboutToShow(IMenuManager menuManager) { addToParentRepositoryActions = generateAddToParentRepositoryAction(lastSelection); addToCustomCategoriesActions = generateAddToCustomCategoryActions(lastSelection); + menuManager.insertBefore("edit", new Separator()); if (addToParentRepositoryActions != null && addToParentRepositoryActions.size() > 0) if (addToParentRepositoryActions.size() == 1) { IAction action = addToParentRepositoryActions.get(0); diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/AggregatorEditor.java b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/AggregatorEditor.java index 90c770971..f5357c497 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/AggregatorEditor.java +++ b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/AggregatorEditor.java @@ -26,10 +26,8 @@ import java.util.regex.Pattern; import org.eclipse.cbi.p2repo.aggregator.Aggregation; +import org.eclipse.cbi.p2repo.aggregator.Contribution; import org.eclipse.cbi.p2repo.aggregator.MetadataRepositoryReference; -import org.eclipse.cbi.p2repo.aggregator.p2.provider.MetadataRepositoryItemProvider; -import org.eclipse.cbi.p2repo.aggregator.p2.provider.ProvidedCapabilityItemProvider; -import org.eclipse.cbi.p2repo.aggregator.p2.provider.RequiredCapabilityItemProvider; import org.eclipse.cbi.p2repo.aggregator.p2.util.MetadataRepositoryResourceImpl; import org.eclipse.cbi.p2repo.aggregator.p2view.MetadataRepositoryStructuredView; import org.eclipse.cbi.p2repo.aggregator.p2view.P2viewFactory; @@ -44,7 +42,6 @@ import org.eclipse.cbi.p2repo.aggregator.util.ResourceDiagnosticImpl; import org.eclipse.cbi.p2repo.aggregator.util.ResourceUtils; import org.eclipse.cbi.p2repo.aggregator.util.StatusProviderAdapterFactory; -import org.eclipse.cbi.p2repo.p2.provider.P2ItemProviderAdapterFactory; import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IResource; @@ -58,8 +55,10 @@ import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.jobs.Job; +import org.eclipse.emf.common.CommonPlugin; import org.eclipse.emf.common.command.BasicCommandStack; import org.eclipse.emf.common.command.Command; import org.eclipse.emf.common.command.CommandStack; @@ -68,6 +67,7 @@ import org.eclipse.emf.common.notify.AdapterFactory; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.ui.MarkerHelper; +import org.eclipse.emf.common.ui.URIEditorInput; import org.eclipse.emf.common.ui.celleditor.ExtendedDialogCellEditor; import org.eclipse.emf.common.ui.editor.ProblemEditorPart; import org.eclipse.emf.common.ui.viewer.IViewerProvider; @@ -109,6 +109,7 @@ import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; import org.eclipse.emf.edit.ui.util.EditUIUtil; +import org.eclipse.emf.edit.ui.util.IRevertablePart; import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; import org.eclipse.equinox.p2.metadata.VersionRange; import org.eclipse.jface.action.IMenuListener; @@ -128,6 +129,7 @@ import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.StructuredViewer; @@ -158,8 +160,11 @@ import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IEditorSite; import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; import org.eclipse.ui.IWorkbenchPart; import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.actions.WorkspaceModifyOperation; import org.eclipse.ui.contexts.IContextActivation; import org.eclipse.ui.contexts.IContextService; @@ -183,8 +188,8 @@ * @generated */ @SuppressWarnings("unused") -public class AggregatorEditor extends MultiPageEditorPart - implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { +public class AggregatorEditor extends MultiPageEditorPart implements IEditingDomainProvider, ISelectionProvider, + IMenuListener, IViewerProvider, IGotoMarker, IRevertablePart { static class MDRComparator implements Comparator { @Override @@ -317,67 +322,6 @@ protected IStatus run(IProgressMonitor monitor) { } } - /** - * - * - * @generated - */ - public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { - - /** - * - * - * @generated - */ - public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { - super(adapterFactory); - } - - /** - * - * - * @generated - */ - @Override - public Object[] getChildren(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * @generated - */ - @Override - public Object[] getElements(Object object) { - Object parent = super.getParent(object); - return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); - } - - /** - * - * - * @generated - */ - @Override - public Object getParent(Object object) { - return null; - } - - /** - * - * - * @generated - */ - @Override - public boolean hasChildren(Object object) { - Object parent = super.getParent(object); - return parent != null; - } - - } - public static final String AGGREGATOR_EDITOR_ID = "org.eclipse.cbi.p2repo.aggregator.presentation.AggregatorEditorID"; public static final String AGGREGATOR_EDITOR_SCOPE = "org.eclipse.cbi.p2repo.aggregator.presentation.aggregatorEditorScope"; @@ -715,7 +659,6 @@ protected void unsetTarget(Resource target) { private void updateMarkers() { Runnable runnable = new Runnable() { - @Override public void run() { synchronized (AggregatorEditor.this) { @@ -1012,14 +955,16 @@ public void createModel() { URI resourceURI = EditUIUtil.getURI(getEditorInput()); Exception exception = null; Resource resource = null; - if (ResourceUtils.isCurrentModel(resourceURI)) + ResourceSet resourceSet = editingDomain.getResourceSet(); + if (ResourceUtils.isCurrentModel(resourceURI) + || DetachContributionResourceAction.CONTRIBUTION_FILE_EXTENSION.equals(resourceURI.fileExtension())) try { // Load the resource through the editing domain. // - resource = editingDomain.getResourceSet().getResource(resourceURI, true); + resource = resourceSet.getResource(resourceURI, true); } catch (Exception e) { exception = e; - resource = editingDomain.getResourceSet().getResource(resourceURI, false); + resource = resourceSet.getResource(resourceURI, false); } else { TransformationWizard tz = new TransformationWizard(resourceURI); @@ -1030,7 +975,7 @@ public void createModel() { if (wd.open() == 0) { resource = tz.getTargetResource(); - editingDomain.getResourceSet().getResources().add(resource); + resourceSet.getResources().add(resource); IFile modelFile = tz.getModelFile(); setPartName(modelFile.getName()); @@ -1038,32 +983,64 @@ public void createModel() { } else { throw new RuntimeException("Deprecated resource was not transformed"); } + + // initialize all repositories + resourceURI = EditUIUtil.getURI(getEditorInput()); + resource = resourceSet.getResource(resourceURI, false); } Diagnostic diagnostic = analyzeResourceProblems(resource, exception); if (diagnostic.getSeverity() != Diagnostic.OK) { resourceToDiagnosticMap.put(resource, diagnostic); } - editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); - - // initialize all repositories - resourceURI = EditUIUtil.getURI(getEditorInput()); - resource = editingDomain.getResourceSet().getResource(resourceURI, false); if (resource == null) return; - // make sure detached resources are resolved - EcoreUtil.resolveAll(resource); - EList contents = resource.getContents(); if (contents.size() != 1) return; + // make sure detached resources are resolved + EcoreUtil.resolveAll(resource); + EObject obj = contents.get(0); + + if (obj instanceof Contribution) { + for (Resource otherResource : new ArrayList<>(resourceSet.getResources())) { + URI uri = otherResource.getURI(); + EList otherResourceContents = otherResource.getContents(); + if (contents.size() == 1) { + EObject eObject = otherResourceContents.get(0); + if (eObject instanceof Aggregation) { + try { + IEditorPart editor = openEditor(eObject); + if (editor instanceof AggregatorEditor) { + getContainer().getDisplay().asyncExec(() -> { + URI objURI = EcoreUtil.getURI(obj); + AggregatorEditor aggregatorEditor = (AggregatorEditor) editor; + EObject otherContribution = aggregatorEditor.getEditingDomain().getResourceSet() + .getEObject(objURI, true); + aggregatorEditor.setSelectionToViewer(Collections.singleton(otherContribution)); + aggregatorEditor.selectionViewer.expandToLevel(otherContribution, 2); + getEditorSite().getPage().closeEditor(this, false); + }); + } + } catch (PartInitException e) { + AggregatorEditorPlugin.INSTANCE.log(exception); + } + } + } + } + } + if (!(obj instanceof Aggregation)) return; + EcoreUtil.resolveAll(resourceSet); + + resourceSet.eAdapters().add(problemIndicationAdapter); + Aggregation aggregation = (Aggregation) obj; repositoryBrowser = P2viewFactory.eINSTANCE.createRepositoryBrowser(aggregation); @@ -1088,6 +1065,16 @@ public void createModel() { public void createPages() { createPagesGen(); + Runnable showPropertiesView = () -> { + try { + getEditorSite().getPage().showView("org.eclipse.ui.views.PropertySheet", null, + IWorkbenchPage.VIEW_VISIBLE); + } catch (PartInitException exception) { + AggregatorEditorPlugin.INSTANCE.log(exception); + } + }; + showPropertiesView.run(); + selectionViewer.addDoubleClickListener(new IDoubleClickListener() { @Override @@ -1098,6 +1085,8 @@ public void doubleClick(DoubleClickEvent event) { selectionViewer.collapseToLevel(path, 1); else selectionViewer.expandToLevel(path, 1); + + showPropertiesView.run(); } }); @@ -1116,11 +1105,11 @@ public void mouseMove(MouseEvent e) { String toolTipText = null; if (item != null && item.getData() != null) { + Object unwrappedData = AdapterFactoryEditingDomain.unwrap(item.getData()); IEditingDomainItemProvider provider = (IEditingDomainItemProvider) adapterFactory - .getRootAdapterFactory().adapt(item.getData(), IEditingDomainItemProvider.class); - - if (provider != null && provider instanceof TooltipTextProvider) - toolTipText = ((TooltipTextProvider) provider).getTooltipText(item.getData()); + .getRootAdapterFactory().adapt(unwrappedData, IEditingDomainItemProvider.class); + if (provider instanceof TooltipTextProvider) + toolTipText = ((TooltipTextProvider) provider).getTooltipText(unwrappedData); } selectionViewer.getTree().setToolTipText(toolTipText); @@ -1531,6 +1520,65 @@ public EditingDomain getEditingDomain() { return editingDomain; } + /** + * + * + * @generated + */ + public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { + /** + * + * + * @generated + */ + public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * + * + * @generated + */ + @Override + public Object[] getElements(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * @generated + */ + @Override + public Object[] getChildren(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * @generated + */ + @Override + public boolean hasChildren(Object object) { + Object parent = super.getParent(object); + return parent != null; + } + + /** + * + * + * @generated + */ + @Override + public Object getParent(Object object) { + return null; + } + } + private String getLabelPrefix(String location) { if (location != null) { URI uri = URI.createURI(location); @@ -1816,7 +1864,7 @@ protected boolean handleDirtyConflict() { * * @generated */ - protected void hideTabs() { + protected void hideTabsGen() { if (getPageCount() <= 1) { setPageText(0, ""); if (getContainer() instanceof CTabFolder) { @@ -1827,6 +1875,15 @@ protected void hideTabs() { } } + protected void hideTabs() { + hideTabsGen(); + Object[] elements = ((ITreeContentProvider) selectionViewer.getContentProvider()) + .getElements(selectionViewer.getInput()); + if (elements.length != 0 && elements[0] instanceof Aggregation) { + selectionViewer.setSelection(new StructuredSelection(elements[0])); + } + } + /** * This is called during startup. * @@ -1859,6 +1916,17 @@ protected void initializeEditingDomain() { // Present only the main resource and loaded MDR's (not detached contributions) @Override public Adapter createResourceSetAdapter() { + AdapterFactoryItemDelegator adapterFactoryItemDelegator = new AdapterFactoryItemDelegator( + adapterFactory); + Comparator stringComparator = CommonPlugin.INSTANCE.getComparator(); + Comparator objectComparator = new Comparator<>() { + @Override + public int compare(Object o1, Object o2) { + return stringComparator.compare(adapterFactoryItemDelegator.getText(o1), + adapterFactoryItemDelegator.getText(o2)); + } + }; + return new ResourceSetItemProvider(this) { @Override public Collection getChildren(Object object) { @@ -1866,29 +1934,29 @@ public Collection getChildren(Object object) { Aggregation aggregation = null; List filtered = new ArrayList<>(); + List others = new ArrayList<>(); List resources = new ArrayList<>(resourceSet.getResources()); for (Resource resource : resources) { if (resource instanceof AggregatorResource) { EList contents = resource.getContents(); if (contents.size() == 1) { EObject obj = resource.getContents().get(0); - if (obj instanceof Aggregation) + if (obj instanceof Aggregation) { filtered.add(obj); + } else { + others.add(obj); + } } } } - filtered.add(repositoryBrowser); - for (Resource resource : resources) { - if (resource instanceof AggregatorResource) { - EList contents = resource.getContents(); - if (contents.size() == 1) { - EObject obj = resource.getContents().get(0); - if (!(obj instanceof Aggregation)) - filtered.add(obj); - } - } + if (repositoryBrowser != null) { + filtered.add(repositoryBrowser); } + + others.sort(objectComparator); + filtered.addAll(others); + return filtered; } }; @@ -1899,36 +1967,7 @@ public Collection getChildren(Object object) { adapterFactory.addAdapterFactory(new AggregatorItemProviderAdapterFactory()); // override item providers that should be more specific to aggregator - adapterFactory.addAdapterFactory(new P2ItemProviderAdapterFactory() { - - @Override - public Adapter createMetadataRepositoryAdapter() { - if (metadataRepositoryItemProvider == null) { - metadataRepositoryItemProvider = new MetadataRepositoryItemProvider(this); - } - - return metadataRepositoryItemProvider; - } - - @Override - public Adapter createProvidedCapabilityAdapter() { - if (providedCapabilityItemProvider == null) { - providedCapabilityItemProvider = new ProvidedCapabilityItemProvider(this); - } - - return providedCapabilityItemProvider; - } - - @Override - public Adapter createRequiredCapabilityAdapter() { - if (requiredCapabilityItemProvider == null) { - requiredCapabilityItemProvider = new RequiredCapabilityItemProvider(this); - } - - return requiredCapabilityItemProvider; - } - - }); + adapterFactory.addAdapterFactory(new P2viewItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new P2viewItemProviderAdapterFactory()); adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory()); @@ -2035,6 +2074,66 @@ public boolean isDirty() { return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); } + /** + * This is for implementing {@link IRevertablePart}. + * + * + * @generated NOT + */ + @Override + public void doRevert() { + ResourceSet resourceSet = editingDomain.getResourceSet(); + List resources = resourceSet.getResources(); + List unloadedResources = new ArrayList<>(); + updateProblemIndication = false; + for (int i = 0; i < resources.size(); ++i) { + Resource resource = resources.get(i); + if (resource.isLoaded() && isPersisted(resource)) { + resource.unload(); + unloadedResources.add(resource); + } + } + + resourceToDiagnosticMap.clear(); + for (Resource resource : unloadedResources) { + try { + resource.load(resourceSet.getLoadOptions()); + } catch (IOException exception) { + if (!resourceToDiagnosticMap.containsKey(resource)) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + } + } + + editingDomain.getCommandStack().flush(); + + if (AdapterFactoryEditingDomain.isStale(editorSelection)) { + setSelection(StructuredSelection.EMPTY); + } + + for (Resource resource : unloadedResources) { + if (resource instanceof AggregatorResourceImpl) { + EList contents = resource.getContents(); + if (contents.size() == 1 && contents.get(0) instanceof Aggregation) { + AggregatorResourceImpl aggregatorResource = (AggregatorResourceImpl) resource; + aggregatorResource.analyzeResource(); + break; + } + } + } + + for (Resource resource : resources) { + if (resource instanceof MetadataRepositoryResourceImpl) { + ((MetadataRepositoryResourceImpl) resource).startAsynchronousLoad(false); + } + } + + selectionViewer.setInput(selectionViewer.getInput()); + + updateProblemIndication = true; + updateProblemIndication(); + } + protected boolean isPersisted(Resource resource) { return (resource instanceof MetadataRepositoryResourceImpl) ? false : isPersistedGen(resource); } @@ -2321,4 +2420,33 @@ protected void updateProblemIndication() { } } + private IEditorPart openEditor(EObject eObject) throws PartInitException { + if (eObject != null) { + Resource resource = eObject.eResource(); + if (resource != null) { + URI uri = resource.getURI(); + if (uri != null) { + IEditorInput editorInput = null; + if (uri.isPlatformResource()) { + String path = uri.toPlatformString(true); + IResource workspaceResource = ResourcesPlugin.getWorkspace().getRoot() + .findMember(new Path(path)); + if (workspaceResource instanceof IFile) { + editorInput = new FileEditorInput((IFile) workspaceResource); + } + } else { + editorInput = new URIEditorInput(uri); + } + if (editorInput != null) { + IWorkbench workbench = PlatformUI.getWorkbench(); + IWorkbenchPage page = workbench.getActiveWorkbenchWindow().getActivePage(); + IEditorPart editorPart = page.openEditor(editorInput, getEditorSite().getId()); + return editorPart; + } + } + } + } + return null; + } + } diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/DetachContributionResourceAction.java b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/DetachContributionResourceAction.java index 7e810bfef..957337769 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/DetachContributionResourceAction.java +++ b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/DetachContributionResourceAction.java @@ -30,11 +30,10 @@ * */ public class DetachContributionResourceAction extends ControlAction { + public static final String CONTRIBUTION_FILE_EXTENSION = "aggrcon"; protected static class DetachContributionResourceDialog extends ControlResourceDialog { - private static final String CONTRIBUTION_FILE_EXTENSION = "aggrcon"; - private static final String UNTITLED_FILE_NAME = "untitled"; private EObject currentEObject; diff --git a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/FixVersionsDialog.java b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/FixVersionsDialog.java index 5771a6531..518729ef9 100644 --- a/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/FixVersionsDialog.java +++ b/org.eclipse.cbi.p2repo.aggregator.editor/src/org/eclipse/cbi/p2repo/aggregator/presentation/FixVersionsDialog.java @@ -17,14 +17,15 @@ import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import org.eclipse.cbi.p2repo.aggregator.Aggregation; import org.eclipse.cbi.p2repo.aggregator.AvailableVersion; -import org.eclipse.cbi.p2repo.aggregator.P2RepoMessages; import org.eclipse.cbi.p2repo.aggregator.Contribution; import org.eclipse.cbi.p2repo.aggregator.InstallableUnitRequest; import org.eclipse.cbi.p2repo.aggregator.MappedRepository; +import org.eclipse.cbi.p2repo.aggregator.P2RepoMessages; import org.eclipse.equinox.p2.metadata.Version; import org.eclipse.equinox.p2.metadata.VersionRange; import org.eclipse.jface.dialogs.TitleAreaDialog; @@ -204,6 +205,7 @@ protected void setValue(Object element, Object value) { } }); viewer.setContentProvider(new ArrayContentProvider()); + this.suggestedVersions.values().removeIf(Objects::isNull); viewer.setInput(this.suggestedVersions.keySet()); return res; diff --git a/org.eclipse.cbi.p2repo.aggregator.engine.feature/feature.xml b/org.eclipse.cbi.p2repo.aggregator.engine.feature/feature.xml index 846edb4d9..d15c237fa 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine.feature/feature.xml +++ b/org.eclipse.cbi.p2repo.aggregator.engine.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.cbi.p2repo.aggregator.engine.feature/pom.xml b/org.eclipse.cbi.p2repo.aggregator.engine.feature/pom.xml index 792b05bda..f3f8e9e12 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine.feature/pom.xml +++ b/org.eclipse.cbi.p2repo.aggregator.engine.feature/pom.xml @@ -3,14 +3,15 @@ 4.0.0 org.eclipse.cbi org.eclipse.cbi.p2repo.aggregator.engine.feature - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-feature + @@ -24,27 +25,6 @@ feature-source - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attach-p2-metadata - package - - p2-metadata - diff --git a/org.eclipse.cbi.p2repo.aggregator.engine.maven/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator.engine.maven/META-INF/MANIFEST.MF index 4880bd439..60983ce3f 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine.maven/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.aggregator.engine.maven/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator.engine.maven;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/org.eclipse.cbi.p2repo.aggregator.engine.maven/about.html b/org.eclipse.cbi.p2repo.aggregator.engine.maven/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine.maven/about.html +++ b/org.eclipse.cbi.p2repo.aggregator.engine.maven/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.aggregator.engine.maven/pom.xml b/org.eclipse.cbi.p2repo.aggregator.engine.maven/pom.xml index d1365bea6..42ed31dee 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine.maven/pom.xml +++ b/org.eclipse.cbi.p2repo.aggregator.engine.maven/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.aggregator.engine.maven - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.engine/.classpath b/org.eclipse.cbi.p2repo.aggregator.engine/.classpath index 4b6e1fd8f..bb1d7781e 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine/.classpath +++ b/org.eclipse.cbi.p2repo.aggregator.engine/.classpath @@ -10,6 +10,7 @@ + diff --git a/org.eclipse.cbi.p2repo.aggregator.engine/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator.engine/META-INF/MANIFEST.MF index 3de43856b..96623936f 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.aggregator.engine/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator.engine;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-Activator: org.eclipse.cbi.p2repo.aggregator.engine.Engine Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-ActivationPolicy: lazy @@ -32,6 +32,7 @@ Require-Bundle: org.apache.ant, org.eclipse.equinox.p2.touchpoint.eclipse, org.kohsuke.args4j, org.eclipse.osgi.services, - org.eclipse.equinox.p2.updatesite;bundle-version="1.0.400" + org.eclipse.equinox.p2.updatesite;bundle-version="1.1.0", + org.eclipse.equinox.p2.repository.tools Bundle-Vendor: %providerName Automatic-Module-Name: org.eclipse.cbi.p2repo.aggregator.engine diff --git a/org.eclipse.cbi.p2repo.aggregator.engine/about.html b/org.eclipse.cbi.p2repo.aggregator.engine/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine/about.html +++ b/org.eclipse.cbi.p2repo.aggregator.engine/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.aggregator.engine/pom.xml b/org.eclipse.cbi.p2repo.aggregator.engine/pom.xml index bed9b63af..a0145ac4c 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine/pom.xml +++ b/org.eclipse.cbi.p2repo.aggregator.engine/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.aggregator.engine - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/Builder.java b/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/Builder.java index b77253707..ab37aefc0 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/Builder.java +++ b/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/Builder.java @@ -35,6 +35,7 @@ import java.util.Properties; import java.util.Set; import java.util.TimeZone; +import java.util.concurrent.ConcurrentLinkedQueue; import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @@ -84,6 +85,9 @@ import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.impl.AdapterImpl; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EObject; @@ -717,7 +721,7 @@ public Aggregation getAggregation() { public IFileArtifactRepository getAggregationArtifactRepository(IProgressMonitor monitor) throws OperationCanceledException, CoreException { - if(aggregationAr != null) { + if (aggregationAr != null) { MonitorUtils.complete(monitor); return aggregationAr; } @@ -726,16 +730,14 @@ public IFileArtifactRepository getAggregationArtifactRepository(IProgressMonitor File destination = new File(getBuildRoot(), REPO_FOLDER_FINAL); File aggregateDestination = new File(destination, REPO_FOLDER_AGGREGATE); URI aggregateURI = createURI(aggregateDestination); - Map properties = new HashMap(); - properties.put(IRepository.PROP_COMPRESSED, Boolean.toString(true)); - properties.put(Publisher.PUBLISH_PACK_FILES_AS_SIBLINGS, Boolean.toString(true)); try { MonitorUtils.testCancelStatus(monitor); aggregationAr = (IFileArtifactRepository) arMgr.loadRepository(aggregateURI, monitor); - } - catch(ProvisionException e) { - aggregationAr = (IFileArtifactRepository) arMgr.createRepository( - aggregateURI, getAggregation().getLabel() + " artifacts", SIMPLE_ARTIFACTS_TYPE, properties); //$NON-NLS-1$ + } catch (ProvisionException e) { + Map properties = Map.of(IRepository.PROP_COMPRESSED, Boolean.toString(true), + Publisher.PUBLISH_PACK_FILES_AS_SIBLINGS, Boolean.toString(true)); + aggregationAr = (IFileArtifactRepository) arMgr.createRepository(aggregateURI, + getAggregation().getLabel() + " artifacts", SIMPLE_ARTIFACTS_TYPE, properties); //$NON-NLS-1$ MonitorUtils.complete(monitor); } return aggregationAr; @@ -1137,7 +1139,7 @@ public boolean isVerifyOnly() { return action == ActionType.VALIDATE; } - private void loadAllMappedRepositories() throws CoreException { + private void loadAllMappedRepositories(IProgressMonitor monitor) throws CoreException { LogUtils.info("Loading all repositories"); Set repositoriesToLoad = new HashSet(); @@ -1145,13 +1147,33 @@ private void loadAllMappedRepositories() throws CoreException { Aggregation aggregation = getAggregation(); ResourceSet topSet = ((EObject) aggregation).eResource().getResourceSet(); // first, set up asynchronous loading jobs so that the repos are loaded in parallel - for(MetadataRepositoryReference repo : aggregation.getAllMetadataRepositoryReferences(true)) { + EList allMetadataRepositoryReferences = aggregation + .getAllMetadataRepositoryReferences(true); + SubMonitor subMonitor = SubMonitor.convert(monitor, allMetadataRepositoryReferences.size()); + ConcurrentLinkedQueue uris = new ConcurrentLinkedQueue<>(); + for (MetadataRepositoryReference repo : allMetadataRepositoryReferences) { org.eclipse.emf.common.util.URI repoURI = org.eclipse.emf.common.util.URI.createGenericURI( "p2aggr", repo.getNature() + ":" + repo.getResolvedLocation(), null); + uris.add(repoURI); P2ResourceImpl res = (P2ResourceImpl) topSet.getResource(repoURI, false); if(res == null) res = (P2ResourceImpl) topSet.createResource(repoURI); res.startAsynchronousLoad(); + EList eAdapters = res.eAdapters(); + eAdapters.add(new AdapterImpl() { + @Override + public void notifyChanged(Notification msg) { + if (msg.getFeatureID(null) == Resource.RESOURCE__IS_LOADED) { + eAdapters.remove(this); + subMonitor.worked(1); + uris.remove(repoURI); + org.eclipse.emf.common.util.URI remaining = uris.peek(); + if (remaining != null) { + subMonitor.subTask("Waiting for " + remaining); + } + } + } + }); repositoriesToLoad.add(repo); } @@ -1609,13 +1631,13 @@ public int run(boolean fromIDE, IProgressMonitor monitor) throws Exception { ticks = 50; break; case VALIDATE: - ticks = 200; + ticks = 300; break; case BUILD: - ticks = 2150; + ticks = 2250; break; default: - ticks = 2200; + ticks = 2300; } SubMonitor subMon = SubMonitor.convert(monitor, ticks); try { @@ -1690,7 +1712,7 @@ public int run(boolean fromIDE, IProgressMonitor monitor) throws Exception { P2Utils.ungetProfileRegistry(provisioningAgent, profileRegistry); } - loadAllMappedRepositories(); + loadAllMappedRepositories(subMon.newChild(100)); // we generate the verification IUs in a separate loop // to detect non p2 related problems early diff --git a/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/MirrorGenerator.java b/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/MirrorGenerator.java index 6ab28ebf1..2894e9593 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/MirrorGenerator.java +++ b/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/MirrorGenerator.java @@ -17,12 +17,20 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.lang.reflect.Field; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; import org.eclipse.cbi.p2repo.aggregator.Aggregation; import org.eclipse.cbi.p2repo.aggregator.Contribution; @@ -43,10 +51,14 @@ import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.SubMonitor; +import org.eclipse.equinox.internal.p2.artifact.processors.checksum.ChecksumUtilities; import org.eclipse.equinox.internal.p2.artifact.repository.MirrorRequest; import org.eclipse.equinox.internal.p2.artifact.repository.RawMirrorRequest; +import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository; import org.eclipse.equinox.internal.p2.repository.Transport; +import org.eclipse.equinox.internal.p2.repository.helpers.ChecksumHelper; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.ProcessingStepHandler; +import org.eclipse.equinox.p2.internal.repository.tools.XZCompressor; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.query.IQueryResult; @@ -58,6 +70,7 @@ import org.eclipse.equinox.spi.p2.publisher.PublisherHelper; public class MirrorGenerator extends BuilderPhase { + /** * A request to restore the canonical form after a raw copy of the optimized form */ @@ -87,26 +100,24 @@ public void perform(IArtifactRepository sourceRepository, IProgressMonitor monit try { File destFolder = destination.getParentFile(); destFolder.mkdirs(); - if(!destFolder.isDirectory()) + if (!destFolder.isDirectory()) throw new IOException("Unable to create path " + destFolder.getAbsolutePath()); out = new BufferedOutputStream(new FileOutputStream(destination)); IStatus status = sourceRepository.getArtifact(optimizedDescriptor, out, subMon.newChild(90)); - if(!status.isOK()) { + if (!status.isOK()) { setResult(status); return; } - } - catch(IOException e) { + } catch (IOException e) { setResult(new Status(IStatus.ERROR, Engine.PLUGIN_ID, e.getMessage(), e)); return; - } - finally { + } finally { IOUtils.close(out); } - ArtifactDescriptor canonical = (ArtifactDescriptor) PublisherHelper.createArtifactDescriptor( - artifactKey, destination); - for(Map.Entry entry : optimizedDescriptor.getProperties().entrySet()) { + ArtifactDescriptor canonical = (ArtifactDescriptor) PublisherHelper + .createArtifactDescriptor(artifactKey, destination); + for (Map.Entry entry : optimizedDescriptor.getProperties().entrySet()) { String propKey = entry.getKey(); if (propKey.equals("download.md5") || propKey.startsWith(IArtifactDescriptor.DOWNLOAD_CHECKSUM) || propKey.equals(IArtifactDescriptor.DOWNLOAD_SIZE) @@ -117,8 +128,7 @@ public void perform(IArtifactRepository sourceRepository, IProgressMonitor monit } fbTarget.addDescriptor(canonical, subMon.newChild(10)); setResult(Status.OK_STATUS); - } - finally { + } finally { MonitorUtils.done(monitor); } } @@ -126,62 +136,55 @@ public void perform(IArtifactRepository sourceRepository, IProgressMonitor monit private static boolean checkIfTargetPresent(IArtifactRepository destination, IArtifactKey key, boolean packed) { IArtifactDescriptor found = getArtifactDescriptor(destination, key, packed); - if(found != null) { - LogUtils.debug(" %s artifact is already present", packed - ? "optimized" - : "canonical"); + if (found != null) { + LogUtils.debug(" %s artifact is already present", packed ? "optimized" : "canonical"); return true; } return false; } private static IStatus extractDeeperRootCause(IStatus status) { - if(status == null) + if (status == null) return null; - if(status.isMultiStatus()) { + if (status.isMultiStatus()) { IStatus[] children = ((MultiStatus) status).getChildren(); - for(int i = 0; i < children.length; i++) { + for (int i = 0; i < children.length; i++) { IStatus deeper = extractDeeperRootCause(children[i]); - if(deeper != null) + if (deeper != null) return deeper; } } Throwable t = status.getException(); - if(t instanceof CoreException) { + if (t instanceof CoreException) { IStatus deeper = extractDeeperRootCause(((CoreException) t).getStatus()); - if(deeper != null) + if (deeper != null) return deeper; } - return status.getSeverity() == IStatus.ERROR - ? status - : null; + return status.getSeverity() == IStatus.ERROR ? status : null; } /** - * Extract the root cause. The root cause is the first severe non-MultiStatus status containing an exception when - * searching depth first otherwise null. + * Extract the root cause. The root cause is the first severe non-MultiStatus status containing an exception when searching + * depth first otherwise null. * * @param status * @return root cause */ private static IStatus extractRootCause(IStatus status) { IStatus rootCause = extractDeeperRootCause(status); - return rootCause == null - ? status - : rootCause; + return rootCause == null ? status : rootCause; } private static IArtifactDescriptor getArtifactDescriptor(IArtifactRepository destination, IArtifactKey key, boolean packed) { - for(IArtifactDescriptor candidate : destination.getArtifactDescriptors(key)) { - if(isPacked(candidate)) { - if(packed) + for (IArtifactDescriptor candidate : destination.getArtifactDescriptors(key)) { + if (isPacked(candidate)) { + if (packed) return candidate; - } - else { - if(!packed) + } else { + if (!packed) return candidate; } } @@ -189,46 +192,47 @@ private static IArtifactDescriptor getArtifactDescriptor(IArtifactRepository des } private static boolean isPacked(IArtifactDescriptor desc) { - return desc != null && "packed".equals(desc.getProperty(IArtifactDescriptor.FORMAT)) && - ProcessingStepHandler.canProcess(desc); + return desc != null && "packed".equals(desc.getProperty(IArtifactDescriptor.FORMAT)) + && ProcessingStepHandler.canProcess(desc); } - static void mirror(Collection keysToInstall, IArtifactRepository cache, IArtifactRepository source, - IFileArtifactRepository dest, Transport transport, PackedStrategy strategy, List errors, - IProgressMonitor monitor) { + static void mirror(ExecutorService executor, Collection keysToInstall, IArtifactRepository cache, + IArtifactRepository source, IFileArtifactRepository dest, Transport transport, PackedStrategy strategy, + List errors, IProgressMonitor monitor) { IQueryResult result = source.query(ArtifactKeyQuery.ALL_KEYS, null); IArtifactKey[] keys = result.toArray(IArtifactKey.class); MonitorUtils.begin(monitor, keys.length * 100); try { - for(IArtifactKey key : keys) { + Collection> futures = new ArrayList<>(); + for (IArtifactKey key : keys) { // We must iterate here since EMF lists use identity comparison // ant not equals. boolean found = false; Iterator keyIterator = keysToInstall.iterator(); - while(keyIterator.hasNext()) { + while (keyIterator.hasNext()) { IArtifactKey keyToInstall = keyIterator.next(); - if(keyToInstall.equals(key)) { + if (keyToInstall.equals(key)) { found = true; keyIterator.remove(); break; } } - if(!found) + if (!found) continue; LogUtils.info("- mirroring artifact %s", key); IArtifactRepository sourceForCopy; - if(cache != null && cache.contains(key)) + if (cache != null && cache.contains(key)) sourceForCopy = cache; else sourceForCopy = source; PackedStrategy keyStrategy; - if(!"osgi.bundle".equals(key.getClassifier())) + if (!"osgi.bundle".equals(key.getClassifier())) // // Only osgi.bundles will contain .class files so we get rid of // excessive use of pack200 here. @@ -237,128 +241,142 @@ static void mirror(Collection keysToInstall, IArtifactRepository c else keyStrategy = strategy; - try { - IArtifactDescriptor[] aDescs = sourceForCopy.getArtifactDescriptors(key); - // Typically one that has no format and one that is packed. - // If so, - // just copy the packed one. - // - IArtifactDescriptor optimized = null; - IArtifactDescriptor canonical = null; - for(IArtifactDescriptor desc : aDescs) { - if(isPacked(desc)) - optimized = desc; + Future future = executor.submit(() -> { + try { + IArtifactDescriptor[] aDescs = sourceForCopy.getArtifactDescriptors(key); + // Typically one that has no format and one that is packed. + // If so, + // just copy the packed one. + // + IArtifactDescriptor optimized = null; + IArtifactDescriptor canonical = null; + for (IArtifactDescriptor desc : aDescs) { + if (isPacked(desc)) + optimized = desc; + else + canonical = desc; + } + + if (optimized == null && canonical == null) + throw ExceptionUtils.fromMessage( + "Found no usable descriptor for artifact %s in repository %s", key, + dest.getLocation()); + + PackedStrategy effectiveKeyStrategy; + if (keyStrategy == PackedStrategy.SKIP && canonical == null) { + LogUtils.warning(" canonical artifact unavailable, using optimized one instead"); + effectiveKeyStrategy = PackedStrategy.COPY; + } else if (keyStrategy != PackedStrategy.SKIP && optimized == null) + effectiveKeyStrategy = PackedStrategy.SKIP; else - canonical = desc; - } + effectiveKeyStrategy = keyStrategy; + + switch (effectiveKeyStrategy) { + case SKIP: + if (!checkIfTargetPresent(dest, key, false)) { + LogUtils.debug(" doing copy of canonical artifact"); + mirror(sourceForCopy, dest, canonical, new ArtifactDescriptor(canonical), transport, + MonitorUtils.subMonitor(monitor, 90)); + } + break; + case COPY: + if (!checkIfTargetPresent(dest, key, true)) { + LogUtils.debug(" doing copy of optimized artifact"); + mirror(sourceForCopy, dest, optimized, new ArtifactDescriptor(optimized), transport, + MonitorUtils.subMonitor(monitor, 90)); + } + break; + default: + if (effectiveKeyStrategy == PackedStrategy.UNPACK) { + if (!checkIfTargetPresent(dest, key, false)) { + LogUtils.debug(" doing copy of optimized artifact into canonical target"); + unpack(sourceForCopy, dest, optimized, transport, + MonitorUtils.subMonitor(monitor, 90)); + } + return; + } - if(optimized == null && canonical == null) - throw ExceptionUtils.fromMessage( - "Found no usable descriptor for artifact %s in repository %s", key, dest.getLocation()); + boolean isVerify = effectiveKeyStrategy == PackedStrategy.VERIFY; + if (checkIfTargetPresent(dest, key, true)) { + if (isVerify) + // Treat the target as verified. + break; + } else { + LogUtils.debug(" doing copy of optimized artifact"); + mirror(sourceForCopy, dest, optimized, new ArtifactDescriptor(optimized), transport, + MonitorUtils.subMonitor(monitor, 70)); + } - if(keyStrategy == PackedStrategy.SKIP && canonical == null) { - LogUtils.warning(" canonical artifact unavailable, using optimized one instead"); - keyStrategy = PackedStrategy.COPY; - } - else if(keyStrategy != PackedStrategy.SKIP && optimized == null) - keyStrategy = PackedStrategy.SKIP; - - switch(keyStrategy) { - case SKIP: - if(!checkIfTargetPresent(dest, key, false)) { - LogUtils.debug(" doing copy of canonical artifact"); - mirror( - sourceForCopy, dest, canonical, new ArtifactDescriptor(canonical), transport, - MonitorUtils.subMonitor(monitor, 90)); - } - break; - case COPY: - if(!checkIfTargetPresent(dest, key, true)) { - LogUtils.debug(" doing copy of optimized artifact"); - mirror( - sourceForCopy, dest, optimized, new ArtifactDescriptor(optimized), transport, - MonitorUtils.subMonitor(monitor, 90)); - } - break; - default: - if(keyStrategy == PackedStrategy.UNPACK) { - if(!checkIfTargetPresent(dest, key, false)) { - LogUtils.debug(" doing copy of optimized artifact into canonical target"); - unpack( - sourceForCopy, dest, optimized, transport, - MonitorUtils.subMonitor(monitor, 90)); + if (isVerify) + LogUtils.debug(" unpacking optimized artifact for verification"); + else { + if (checkIfTargetPresent(dest, key, false)) + break; + LogUtils.debug(" unpacking optimized artifact"); } - continue; - } - - boolean isVerify = keyStrategy == PackedStrategy.VERIFY; - if(checkIfTargetPresent(dest, key, true)) { - if(isVerify) - // Treat the target as verified. - break; - } - else { - LogUtils.debug(" doing copy of optimized artifact"); - mirror( - sourceForCopy, dest, optimized, new ArtifactDescriptor(optimized), transport, - MonitorUtils.subMonitor(monitor, 70)); - } - - if(isVerify) - LogUtils.debug(" unpacking optimized artifact for verification"); - else { - if(checkIfTargetPresent(dest, key, false)) - break; - LogUtils.debug(" unpacking optimized artifact"); - } - - unpackToSibling( - dest, getArtifactDescriptor(dest, key, true), transport, isVerify, - MonitorUtils.subMonitor(monitor, 20)); + + unpackToSibling(dest, getArtifactDescriptor(dest, key, true), transport, isVerify, + MonitorUtils.subMonitor(monitor, 20)); + } + } catch (CoreException e) { + LogUtils.error(e, e.getMessage()); + synchronized (errors) { + errors.add(Builder.getExceptionMessages(e)); + } + dest.removeDescriptor(key, MonitorUtils.subMonitor(monitor, 2)); } - } - catch(CoreException e) { - LogUtils.error(e, e.getMessage()); - errors.add(Builder.getExceptionMessages(e)); - dest.removeDescriptor(key, MonitorUtils.subMonitor(monitor, 2)); + + LogUtils.info("- mirrored artifact %s", key); + }); + futures.add(future); + } + + for (Future future : futures) { + try { + future.get(); + } catch (InterruptedException | ExecutionException e) { + String msg = e.getMessage(); + LogUtils.error(msg); + errors.add(msg); } } // the collection of keys to install should now be empty unless some artifacts could not be found - for(IArtifactKey key : keysToInstall) { - String msg = "Artifact " + key + " could not be found in the artifact repository (" + - source.getLocation() + ")"; + for (IArtifactKey key : keysToInstall) { + String msg = "Artifact " + key + " could not be found in the artifact repository (" + + source.getLocation() + ")"; LogUtils.error(msg); errors.add(msg); } - } - catch(OperationCanceledException e) { + } catch (OperationCanceledException e) { LogUtils.info("Operation canceled."); //$NON-NLS-1$ - } - finally { + } finally { MonitorUtils.done(monitor); } } - static IArtifactDescriptor mirror(IArtifactRepository source, IArtifactRepository dest, + static IArtifactDescriptor mirror(IArtifactRepository source, IFileArtifactRepository dest, IArtifactDescriptor sourceDesc, IArtifactDescriptor targetDesc, Transport transport, IProgressMonitor monitor) throws OperationCanceledException, CoreException { - if(dest.contains(targetDesc)) + if (dest.contains(targetDesc)) return targetDesc; RawMirrorRequest request = new RawMirrorRequest(sourceDesc, targetDesc, dest, transport); request.perform(source, monitor); IStatus result = request.getResult(); - switch(result.getSeverity()) { + switch (result.getSeverity()) { case IStatus.INFO: LogUtils.info(result.getMessage()); case IStatus.OK: // Unfortunately, this doesn't necessarily mean that everything is OK. Zero sized files are // silently ignored. See bug 290986 // We can't have that here. - if(getArtifactDescriptor(dest, targetDesc.getArtifactKey(), isPacked(targetDesc)) != null) + IArtifactDescriptor destDesc = getArtifactDescriptor(dest, targetDesc.getArtifactKey(), isPacked(targetDesc)); + if (destDesc != null) { + updateCheckSum(dest, destDesc); // All is well. return targetDesc; + } result = new Status(IStatus.ERROR, Engine.PLUGIN_ID, "Zero bytes copied"); break; @@ -366,16 +384,32 @@ static IArtifactDescriptor mirror(IArtifactRepository source, IArtifactRepositor LogUtils.info("Aggregation cancelled while mirroring artifact %s", sourceDesc.getArtifactKey()); throw new OperationCanceledException(); default: - if(result.getCode() == org.eclipse.equinox.p2.core.ProvisionException.ARTIFACT_EXISTS) { + if (result.getCode() == org.eclipse.equinox.p2.core.ProvisionException.ARTIFACT_EXISTS) { LogUtils.warning(" copy failed. Artifact %s is already present", sourceDesc.getArtifactKey()); return targetDesc; } result = extractRootCause(result); } - throw ExceptionUtils.fromMessage( - result.getException(), "Unable to mirror artifact %s from repository %s: %s", sourceDesc.getArtifactKey(), - source.getLocation(), result.getMessage()); + throw ExceptionUtils.fromMessage(result.getException(), "Unable to mirror artifact %s from repository %s: %s", + sourceDesc.getArtifactKey(), source.getLocation(), result.getMessage()); + } + + private static void updateCheckSum(IFileArtifactRepository dest, IArtifactDescriptor destDesc) + throws CoreException { + Map downloadChecksums = ChecksumHelper.getChecksums(destDesc, + IArtifactDescriptor.DOWNLOAD_CHECKSUM); + if (!downloadChecksums.containsKey("sha-256")) { + File artifactFile = dest.getArtifactFile(destDesc); + Map caculatedCheckSums = new LinkedHashMap<>(); + IStatus status = ChecksumUtilities.calculateChecksums(artifactFile, caculatedCheckSums, Set.of("md5")); + if (!status.isMultiStatus()) { + throw new CoreException(status); + } + ((ArtifactDescriptor) destDesc).addProperties( + ChecksumUtilities.checksumsToProperties(IArtifactDescriptor.DOWNLOAD_CHECKSUM, caculatedCheckSums)); + LogUtils.info("- computed new artifact checksum %s", artifactFile); + } } private static void unpack(IArtifactRepository source, IFileArtifactRepository target, @@ -383,15 +417,14 @@ private static void unpack(IArtifactRepository source, IFileArtifactRepository t CanonicalizeRequest request = new CanonicalizeRequest(optimized, source, target, transport); request.perform(source, monitor); IStatus result = request.getResult(); - if(result.getSeverity() != IStatus.ERROR || - result.getCode() == org.eclipse.equinox.p2.core.ProvisionException.ARTIFACT_EXISTS) { + if (result.getSeverity() != IStatus.ERROR + || result.getCode() == org.eclipse.equinox.p2.core.ProvisionException.ARTIFACT_EXISTS) { return; } result = extractRootCause(result); - throw ExceptionUtils.fromMessage( - result.getException(), "Unable to unpack artifact %s in repository %s: %s", optimized.getArtifactKey(), - target.getLocation(), result.getMessage()); + throw ExceptionUtils.fromMessage(result.getException(), "Unable to unpack artifact %s in repository %s: %s", + optimized.getArtifactKey(), target.getLocation(), result.getMessage()); } private static void unpackToSibling(IFileArtifactRepository target, IArtifactDescriptor optimized, @@ -401,21 +434,18 @@ private static void unpackToSibling(IFileArtifactRepository target, IArtifactDes try { request.perform(target, MonitorUtils.subMonitor(monitor, 18)); IStatus result = request.getResult(); - if(result.getSeverity() != IStatus.ERROR || - result.getCode() == org.eclipse.equinox.p2.core.ProvisionException.ARTIFACT_EXISTS) { - if(verifyOnly) - target.removeDescriptor( - getArtifactDescriptor(target, optimized.getArtifactKey(), false), - MonitorUtils.subMonitor(monitor, 2)); + if (result.getSeverity() != IStatus.ERROR + || result.getCode() == org.eclipse.equinox.p2.core.ProvisionException.ARTIFACT_EXISTS) { + if (verifyOnly) + target.removeDescriptor(getArtifactDescriptor(target, optimized.getArtifactKey(), false), + MonitorUtils.subMonitor(monitor, 2)); return; } result = extractRootCause(result); - throw ExceptionUtils.fromMessage( - result.getException(), "Unable to unpack artifact %s in repository %s: %s", optimized.getArtifactKey(), - target.getLocation(), result.getMessage()); - } - finally { + throw ExceptionUtils.fromMessage(result.getException(), "Unable to unpack artifact %s in repository %s: %s", + optimized.getArtifactKey(), target.getLocation(), result.getMessage()); + } finally { MonitorUtils.done(monitor); } } @@ -437,6 +467,8 @@ public void run(IProgressMonitor monitor) throws CoreException { long start = TimeUtils.getNow(); Builder builder = getBuilder(); + ExecutorService executor = Executors + .newFixedThreadPool(Math.min(10, Runtime.getRuntime().availableProcessors())); Aggregation aggregation = builder.getAggregation(); PackedStrategy packedStrategy = aggregation.getPackedStrategy(); @@ -449,66 +481,104 @@ public void run(IProgressMonitor monitor) throws CoreException { try { IArtifactRepository tempAr = builder.getTemporaryArtifactRepository(subMon.newChild(10)); IFileArtifactRepository aggregationAr = builder.getAggregationArtifactRepository(subMon.newChild(10)); - for(Contribution contrib : contribs) { + Runnable disableSave = disableSave(aggregationAr); + for (Contribution contrib : contribs) { SubMonitor contribMonitor = subMon.newChild(100); List repos = contrib.getRepositories(true); List errors = new ArrayList(); MonitorUtils.begin(contribMonitor, repos.size() * 100); - for(MappedRepository repo : repos) { - if(builder.isMapVerbatim(repo) || !repo.isMirrorArtifacts()) { + for (MappedRepository repo : repos) { + if (builder.isMapVerbatim(repo) || !repo.isMirrorArtifacts()) { MonitorUtils.worked(contribMonitor, 100); continue; } MetadataRepository childMdr = ResourceUtils.getMetadataRepository(repo); ArrayList keysToMirror = null; - for(IInstallableUnit iu : childMdr.getInstallableUnits()) { - if(!unitsToAggregate.contains(iu)) + for (IInstallableUnit iu : childMdr.getInstallableUnits()) { + if (!unitsToAggregate.contains(iu)) continue; - for(IArtifactKey ak : iu.getArtifacts()) { - if(!keysToExclude.add(ak)) + for (IArtifactKey ak : iu.getArtifacts()) { + if (!keysToExclude.add(ak)) continue; - if(keysToMirror == null) + if (keysToMirror == null) keysToMirror = new ArrayList(); keysToMirror.add(ak); } } - if(keysToMirror != null) { + if (keysToMirror != null) { String msg = format("Mirroring artifacts from %s", childMdr.getLocation()); LogUtils.info(msg); contribMonitor.subTask(msg); - IArtifactRepository childAr = builder.getArtifactRepository( - repo, contribMonitor.newChild( - 1, SubMonitor.SUPPRESS_BEGINTASK | SubMonitor.SUPPRESS_SETTASKNAME)); - mirror( - keysToMirror, tempAr, childAr, aggregationAr, getTransport(), packedStrategy, errors, - contribMonitor.newChild( - 94, SubMonitor.SUPPRESS_BEGINTASK | SubMonitor.SUPPRESS_SETTASKNAME)); - } - else + IArtifactRepository childAr = builder.getArtifactRepository(repo, contribMonitor.newChild(1, + SubMonitor.SUPPRESS_BEGINTASK | SubMonitor.SUPPRESS_SETTASKNAME)); + mirror(executor, keysToMirror, tempAr, childAr, aggregationAr, getTransport(), packedStrategy, + errors, contribMonitor.newChild(94, + SubMonitor.SUPPRESS_BEGINTASK | SubMonitor.SUPPRESS_SETTASKNAME)); + } else MonitorUtils.worked(contribMonitor, 95); } - if(errors.size() > 0) { + if (errors.size() > 0) { artifactErrors = true; builder.sendEmail(contrib, errors); - for(String err : errors) + for (String err : errors) LogUtils.error("Error during mirroring: " + err); } MonitorUtils.done(contribMonitor); } - } - catch(OperationCanceledException e) { + + LogUtils.error("Saving: " + aggregationAr.getLocation()); + disableSave.run(); + + xzCompress(aggregationAr); + } catch (OperationCanceledException e) { LogUtils.info("Operation canceled."); //$NON-NLS-1$ - } - finally { + } finally { + executor.shutdownNow(); + try { + executor.awaitTermination(5, TimeUnit.MINUTES); + } catch (InterruptedException e) { + //$FALL-THROUGH$ + } MonitorUtils.done(monitor); } - if(!monitor.isCanceled()) { + if (!monitor.isCanceled()) { LogUtils.info("Done. Took %s", TimeUtils.getFormattedDuration(start)); //$NON-NLS-1$ } - if(artifactErrors) + if (artifactErrors) throw ExceptionUtils.fromMessage("Not all artifacts could be mirrored, see log for details"); } + + private void xzCompress(IFileArtifactRepository aggregationAr) { + try { + LogUtils.error("XZ compressing: " + aggregationAr.getLocation()); + XZCompressor xzCompressor = new XZCompressor(); + xzCompressor.setRepoFolder(Paths.get(aggregationAr.getLocation()).toString()); + xzCompressor.compressRepo(); + } catch (IOException e) { + ExceptionUtils.wrap(e); + } + } + + private Runnable disableSave(IFileArtifactRepository aggregationAr) { + try { + Field field = aggregationAr.getClass().getDeclaredField("disableSave"); + field.setAccessible(true); + field.set(aggregationAr, true); + return () -> { + try { + field.set(aggregationAr, false); + } catch (ReflectiveOperationException e) { + LogUtils.error("Error saving %s", aggregationAr.getLocation()); //$NON-NLS-1$ + } + ((SimpleArtifactRepository) aggregationAr).save(); + }; + } catch (ReflectiveOperationException e) { + LogUtils.info("Cannot disable save for %s", aggregationAr.getLocation()); //$NON-NLS-1$ + return () -> { + }; + } + } } diff --git a/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/ValidationSetVerifier.java b/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/ValidationSetVerifier.java index 5908494de..16bb1e2bb 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/ValidationSetVerifier.java +++ b/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/ValidationSetVerifier.java @@ -20,11 +20,17 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; import java.util.Map.Entry; import java.util.Set; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; import org.eclipse.cbi.p2repo.aggregator.Aggregation; import org.eclipse.cbi.p2repo.aggregator.Configuration; @@ -99,11 +105,11 @@ public static class AnalyzedPlannerStatus extends MultiStatus { private static final String MESSAGE_INDENT = " "; private static void appendChildren(StringBuilder messageBuilder, IStatus[] children, String indent, int level) { - for(IStatus child : children) { - for(int i = 0; i < level; ++i) + for (IStatus child : children) { + for (int i = 0; i < level; ++i) messageBuilder.append(indent); messageBuilder.append(child.getMessage()).append('\n'); - if(child.isMultiStatus()) + if (child.isMultiStatus()) appendChildren(messageBuilder, child.getChildren(), indent, level + 1); } } @@ -112,7 +118,7 @@ private static StringBuilder getRootProblemMessage(Explanation rootProblem) { IStatus status = rootProblem.toStatus(); StringBuilder messageBuilder = new StringBuilder(status.getMessage()).append('\n'); - if(status.isMultiStatus()) + if (status.isMultiStatus()) appendChildren(messageBuilder, status.getChildren(), MESSAGE_INDENT, 1); return messageBuilder; @@ -123,17 +129,16 @@ private static StringBuilder getRootProblemMessage(Explanation rootProblem) { protected ArrayList verificationDiagnostics = new ArrayList(); public AnalyzedPlannerStatus(Resource resource, Configuration config, PlannerStatus plannerStatus) { - super( - plannerStatus.getPlugin(), plannerStatus.getCode(), plannerStatus.getMessage(), - plannerStatus.getException()); + super(plannerStatus.getPlugin(), plannerStatus.getCode(), plannerStatus.getMessage(), + plannerStatus.getException()); this.plannerStatus = plannerStatus; RequestStatus requestStatus = plannerStatus.getRequestStatus(); - if(requestStatus == null) + if (requestStatus == null) return; Set explanations = requestStatus.getExplanations(); - if(explanations == null) + if (explanations == null) return; // The set of the root problem explanations @@ -142,47 +147,45 @@ public AnalyzedPlannerStatus(Resource resource, Configuration config, PlannerSta // The map of dependency chain explanations HashMap> links = new HashMap>(); - for(Explanation explanation : explanations) { - if(explanation instanceof HardRequirement) { + for (Explanation explanation : explanations) { + if (explanation instanceof HardRequirement) { // This represents one link in the chain of dependencies from the root requirement // (the verification IU) to the conflicting/missing IU HardRequirement link = (HardRequirement) explanation; HashSet requirementSet = links.get(link.iu); - if(requirementSet == null) { + if (requirementSet == null) { requirementSet = new HashSet(); links.put(link.iu, requirementSet); } requirementSet.add(link.req); - } - else if(explanation instanceof PatchedHardRequirement) { + } else if (explanation instanceof PatchedHardRequirement) { // This represents one link in the chain of dependencies from the root requirement // (the verification IU) to the conflicting/missing IU PatchedHardRequirement link = (PatchedHardRequirement) explanation; HashSet requirementSet = links.get(link.iu); - if(requirementSet == null) { + if (requirementSet == null) { requirementSet = new HashSet(); links.put(link.iu, requirementSet); } - for(IRequirementChange change : link.patch.getRequirementsChange()) { - if(change.newValue().equals(link.req)) { - for(IRequirement r : link.iu.getRequirements()) { - if(r instanceof IRequiredCapability && change.matches((IRequiredCapability) r)) + for (IRequirementChange change : link.patch.getRequirementsChange()) { + if (change.newValue().equals(link.req)) { + for (IRequirement r : link.iu.getRequirements()) { + if (r instanceof IRequiredCapability && change.matches((IRequiredCapability) r)) requirementSet.add(r); } } } requirementSet = links.get(link.patch); - if(requirementSet == null) { + if (requirementSet == null) { requirementSet = new HashSet(); links.put(link.patch, requirementSet); } requirementSet.add(link.req); - } - else if(explanation instanceof MissingIU || explanation instanceof MissingGreedyIU || - explanation instanceof Singleton) + } else if (explanation instanceof MissingIU || explanation instanceof MissingGreedyIU + || explanation instanceof Singleton) // MissingIU means we have a missing dependency problem // Singleton means we have a dependency version conflict problem rootProblems.add(explanation); @@ -190,13 +193,13 @@ else if(explanation instanceof MissingIU || explanation instanceof MissingGreedy // a cache of IInstallableUnit parents HashMap dependencyChainsCache = new HashMap(); - for(Explanation rootProblem : rootProblems) { - if(rootProblem instanceof Singleton) { + for (Explanation rootProblem : rootProblems) { + if (rootProblem instanceof Singleton) { IInstallableUnit[] ius = ((Singleton) rootProblem).ius; LinkedHashSet dependencyChains = new LinkedHashSet( - ius.length); + ius.length); - for(IInstallableUnit iu : ius) { + for (IInstallableUnit iu : ius) { dependencyChains.add(getDependencyChain(iu, links, dependencyChainsCache)); } // just in case we failed to construct some dependency chain @@ -204,10 +207,10 @@ else if(explanation instanceof MissingIU || explanation instanceof MissingGreedy org.eclipse.emf.common.util.URI resourceURI = resource.getURI(); LinkedHashSet modelElementURISet = new LinkedHashSet( - dependencyChains.size()); + dependencyChains.size()); StringBuilder messageBuilder = getRootProblemMessage(rootProblem); - for(VerificationDiagnostic.DependencyLink dependencyChain : dependencyChains) { + for (VerificationDiagnostic.DependencyLink dependencyChain : dependencyChains) { VerificationDiagnostic.identifyDependencyChain(dependencyChain, resource, "\n", MESSAGE_INDENT); modelElementURISet.add(dependencyChain.getModelElementURI().deresolve(resourceURI)); @@ -217,7 +220,7 @@ else if(explanation instanceof MissingIU || explanation instanceof MissingGreedy messageBuilder.append(" is required by:"); VerificationDiagnostic.DependencyLink parent = dependencyChain.getParent(); - if(parent != null) + if (parent != null) messageBuilder.append(parent.getIdentifier()); } @@ -228,21 +231,21 @@ else if(explanation instanceof MissingIU || explanation instanceof MissingGreedy // just in case we could not find URI of a model element corresponding to some of the dependency chains modelElementURISet.remove(null); - VerificationDiagnostic.Singleton[] relatedDiagnostics = new VerificationDiagnostic.Singleton[modelElementURISet.size()]; + VerificationDiagnostic.Singleton[] relatedDiagnostics = new VerificationDiagnostic.Singleton[modelElementURISet + .size()]; int i = 0; - for(org.eclipse.emf.common.util.URI modelElementURI : modelElementURISet) { - VerificationDiagnostic.Singleton singleton = new VerificationDiagnostic.Singleton( - rootProblem, modelElementURI, relatedDiagnostics); + for (org.eclipse.emf.common.util.URI modelElementURI : modelElementURISet) { + VerificationDiagnostic.Singleton singleton = new VerificationDiagnostic.Singleton(rootProblem, + modelElementURI, relatedDiagnostics); relatedDiagnostics[i++] = singleton; verificationDiagnostics.add(singleton); } - } - else if(rootProblem instanceof MissingIU) { + } else if (rootProblem instanceof MissingIU) { MissingIU missingIU = ((MissingIU) rootProblem); - VerificationDiagnostic.DependencyLink dependencyChain = getDependencyChain( - missingIU.iu, links, dependencyChainsCache); + VerificationDiagnostic.DependencyLink dependencyChain = getDependencyChain(missingIU.iu, links, + dependencyChainsCache); - if(dependencyChain != null) { + if (dependencyChain != null) { VerificationDiagnostic.identifyDependencyChain(dependencyChain, resource, "\n", MESSAGE_INDENT); StringBuilder messageBuilder = getRootProblemMessage(rootProblem); @@ -257,19 +260,16 @@ else if(rootProblem instanceof MissingIU) { org.eclipse.emf.common.util.URI modelElementURI = dependencyChain.getModelElementURI(); - if(modelElementURI != null) - verificationDiagnostics.add( - new VerificationDiagnostic( - rootProblem.toString(), + if (modelElementURI != null) + verificationDiagnostics.add(new VerificationDiagnostic(rootProblem.toString(), dependencyChain.getModelElementURI().deresolve(resource.getURI()))); } - } - else if(rootProblem instanceof MissingGreedyIU) { + } else if (rootProblem instanceof MissingGreedyIU) { MissingGreedyIU missingGreedyIU = ((MissingGreedyIU) rootProblem); - VerificationDiagnostic.DependencyLink dependencyChain = getDependencyChain( - missingGreedyIU.iu, links, dependencyChainsCache); + VerificationDiagnostic.DependencyLink dependencyChain = getDependencyChain(missingGreedyIU.iu, + links, dependencyChainsCache); - if(dependencyChain != null) { + if (dependencyChain != null) { VerificationDiagnostic.identifyDependencyChain(dependencyChain, resource, "\n", MESSAGE_INDENT); StringBuilder messageBuilder = getRootProblemMessage(rootProblem); @@ -278,7 +278,7 @@ else if(rootProblem instanceof MissingGreedyIU) { messageBuilder.append(" is required by:"); VerificationDiagnostic.DependencyLink parent = dependencyChain.getParent(); - if(parent != null) + if (parent != null) messageBuilder.append(parent.getIdentifier()); String message = messageBuilder.toString(); @@ -287,10 +287,8 @@ else if(rootProblem instanceof MissingGreedyIU) { org.eclipse.emf.common.util.URI modelElementURI = dependencyChain.getModelElementURI(); - if(modelElementURI != null) - verificationDiagnostics.add( - new VerificationDiagnostic( - rootProblem.toString(), + if (modelElementURI != null) + verificationDiagnostics.add(new VerificationDiagnostic(rootProblem.toString(), dependencyChain.getModelElementURI().deresolve(resource.getURI()))); } } @@ -298,8 +296,9 @@ else if(rootProblem instanceof MissingGreedyIU) { } /** - * Build the dependency chain from the specified IU up to an UI which has the model element URI information attached. Use a cache to store the - * built chains so that they can be reused in case other chain(s) need to be built which contain any of the cached chains as a prefix. + * Build the dependency chain from the specified IU up to an UI which has the model element URI information attached. Use a + * cache to store the built chains so that they can be reused in case other chain(s) need to be built which contain any of + * the cached chains as a prefix. * * @param iu * the IU for which to build the dependency chain @@ -307,21 +306,22 @@ else if(rootProblem instanceof MissingGreedyIU) { * a map of dependency chain links * @param dependencyChainsCache * a cache of the dependency chains - * @return the dependency chain from the specified IU up to an UI which has the model element URI information attached, or null - * if no such IU was found + * @return the dependency chain from the specified IU up to an UI which has the model element URI information attached, or + * null if no such IU was found */ protected VerificationDiagnostic.DependencyLink getDependencyChain(IInstallableUnit iu, HashMap> links, HashMap dependencyChainsCache) { - if(dependencyChainsCache.containsKey(iu)) + if (dependencyChainsCache.containsKey(iu)) return dependencyChainsCache.get(iu); // may return null in case of a dependency loop String elementURI = iu.getProperty(VerificationDiagnostic.PROP_AGGREGATOR_MODEL_ELEMENT_URI); VerificationDiagnostic.DependencyLink lastLink; GET_DEPENDENCY_CHAIN: { - // if the IU has the model element URI information attached then it is the head of the dependency chain and it means that we are done - if(elementURI != null) { + // if the IU has the model element URI information attached then it is the head of the dependency chain and it means + // that we are done + if (elementURI != null) { lastLink = new VerificationDiagnostic.DependencyLink(iu, null); break GET_DEPENDENCY_CHAIN; } @@ -329,13 +329,14 @@ protected VerificationDiagnostic.DependencyLink getDependencyChain(IInstallableU // we need to put a null value to the cache to prevent (otherwise) possible infinite loop dependencyChainsCache.put(iu, null); - // walk the dependency chain up and in an attempt to build a dependency chain from the given IU to an IU with the model element + // walk the dependency chain up and in an attempt to build a dependency chain from the given IU to an IU with the + // model element // URI information attached - for(Entry> link : links.entrySet()) { - for(IRequirement requirement : link.getValue()) { - if(requirement.isMatch(iu)) { + for (Entry> link : links.entrySet()) { + for (IRequirement requirement : link.getValue()) { + if (requirement.isMatch(iu)) { lastLink = getDependencyChain(link.getKey(), links, dependencyChainsCache); - if(lastLink != null) { + if (lastLink != null) { lastLink = new VerificationDiagnostic.DependencyLink(iu, lastLink); break GET_DEPENDENCY_CHAIN; } @@ -355,7 +356,7 @@ protected VerificationDiagnostic.DependencyLink getDependencyChain(IInstallableU public String getMessage() { StringBuilder bld = new StringBuilder(); bld.append(super.getMessage()); - for(String error : getResolutionErrors(plannerStatus)) { + for (String error : getResolutionErrors(plannerStatus)) { bld.append(' '); bld.append(error); } @@ -373,11 +374,11 @@ public List getVerificationDiagnostics() { private static List getResolutionErrors(PlannerStatus plannerStatus) { RequestStatus requestStatus = plannerStatus.getRequestStatus(); - if(requestStatus == null) + if (requestStatus == null) return Collections.emptyList(); ArrayList errors = new ArrayList(); - for(Explanation explanation : requestStatus.getExplanations()) + for (Explanation explanation : requestStatus.getExplanations()) errors.add(explanation.toString()); return errors; } @@ -387,9 +388,9 @@ private static IInstallableUnit[] getRootIUs(IMetadataRepository site, String iu IQuery query = QueryUtil.createIUQuery(iuName, version); IQueryResult roots = site.query(query, monitor); - if(roots.isEmpty()) { + if (roots.isEmpty()) { // roots might be empty because operation canceled. - if(monitor != null && !monitor.isCanceled()) { + if (monitor != null && !monitor.isCanceled()) { throw ExceptionUtils.fromMessage("IU %s not found", iuName); //$NON-NLS-1$ } } @@ -407,19 +408,19 @@ public ValidationSetVerifier(Builder builder, ValidationSet validationSet) { private boolean addLeafmostContributions(Set explanations, Map contributions, IRequirement prq) { boolean contribsFound = false; - for(Explanation explanation : explanations) { - if(explanation instanceof Singleton) { - if(contribsFound) + for (Explanation explanation : explanations) { + if (explanation instanceof Singleton) { + if (contribsFound) // All explicit contributions for Singletons are added at // top level. We just want to find out if this Singleton // is the leaf problem here, not add anything continue; - for(IInstallableUnit iu : ((Singleton) explanation).ius) { - if(prq.isMatch(iu)) { + for (IInstallableUnit iu : ((Singleton) explanation).ius) { + if (prq.isMatch(iu)) { // A singleton is always a leaf problem. Add // contributions if we can find any - if(!findContributions(iu.getId()).isEmpty()) { + if (!findContributions(iu.getId()).isEmpty()) { contribsFound = true; break; } @@ -430,28 +431,26 @@ private boolean addLeafmostContributions(Set explanations, Map findContributions(IInstallableUnit iu, IRequirement rq) { List contribs = Collections.emptyList(); - if(!(rq instanceof IRequiredCapability)) + if (!(rq instanceof IRequiredCapability)) return contribs; IRequiredCapability cap = (IRequiredCapability) rq; - if(Builder.NAMESPACE_OSGI_BUNDLE.equals(cap.getNamespace()) || - IInstallableUnit.NAMESPACE_IU_ID.equals(cap.getNamespace())) + if (Builder.NAMESPACE_OSGI_BUNDLE.equals(cap.getNamespace()) + || IInstallableUnit.NAMESPACE_IU_ID.equals(cap.getNamespace())) contribs = findContributions(cap.getName()); - if(contribs.isEmpty()) + if (contribs.isEmpty()) // Not found, try the owner of the requirement contribs = findContributions(iu.getId()); return contribs; @@ -498,32 +497,30 @@ private List findContributions(IInstallableUnit iu, IRequirement r private List findContributions(String componentId) { List result = null; - for(Contribution contrib : validationSet.getAllContributions()) - for(MappedRepository repository : contrib.getRepositories(true)) - for(MappedUnit mu : repository.getUnits(true)) - if(componentId.equals(mu.getName())) { - if(result == null) + for (Contribution contrib : validationSet.getAllContributions()) + for (MappedRepository repository : contrib.getRepositories(true)) + for (MappedUnit mu : repository.getUnits(true)) + if (componentId.equals(mu.getName())) { + if (result == null) result = new ArrayList(); result.add(contrib); } - return result == null - ? Collections. emptyList() - : result; + return result == null ? Collections.emptyList() : result; } private Map getContributionMap(PlannerStatus plannerStatus) { Map contribs = new HashMap(); RequestStatus requestStatus = plannerStatus.getRequestStatus(); - if(requestStatus == null) + if (requestStatus == null) return Collections.emptyMap(); Set explanations = requestStatus.getExplanations(); - for(Explanation explanation : explanations) { - if(explanation instanceof Singleton) { + for (Explanation explanation : explanations) { + if (explanation instanceof Singleton) { // A singleton is always a leaf problem. Add contributions // if we can find any. They are all culprits - for(IInstallableUnit iu : ((Singleton) explanation).ius) { - for(Contribution contrib : findContributions(iu.getId())) + for (IInstallableUnit iu : ((Singleton) explanation).ius) { + for (Contribution contrib : findContributions(iu.getId())) contribs.put(contrib.getLabel(), contrib); } continue; @@ -531,23 +528,21 @@ private Map getContributionMap(PlannerStatus plannerStatus IInstallableUnit iu; IRequirement crq; - if(explanation instanceof HardRequirement) { + if (explanation instanceof HardRequirement) { HardRequirement hrq = (HardRequirement) explanation; iu = hrq.iu; crq = hrq.req; - } - else if(explanation instanceof MissingIU) { + } else if (explanation instanceof MissingIU) { MissingIU miu = (MissingIU) explanation; iu = miu.iu; crq = miu.req; - } - else + } else continue; // Find the leafmost contributions for the problem. We don't want to // blame consuming contributors - if(!addLeafmostContributions(explanations, contribs, crq)) { - for(Contribution contrib : findContributions(iu, crq)) + if (!addLeafmostContributions(explanations, contribs, crq)) { + for (Contribution contrib : findContributions(iu, crq)) contribs.put(contrib.getLabel(), contrib); } } @@ -564,7 +559,7 @@ private Set getUnpatchedTransitiveScope(IQueryable getUnpatchedTransitiveScope(IQueryable units = new HashSet(); units.add(patch); Operand[] ops = plan.getOperands(); - for(Operand op : ops) { - if(!(op instanceof InstallableUnitOperand)) + for (Operand op : ops) { + if (!(op instanceof InstallableUnitOperand)) continue; InstallableUnitOperand iuOp = (InstallableUnitOperand) op; IInstallableUnit iu = iuOp.second(); - if(iu != null) + if (iu != null) units.add(iu); } return units; @@ -596,7 +591,7 @@ private Set getUnpatchedTransitiveScope(IQueryable emptyMap()); + } catch (ProvisionException e) { + tempAr = (IFileArtifactRepository) arMgr.createRepository(tempRepositoryURI, + "temporary artifacts" + " artifacts", Builder.SIMPLE_ARTIFACTS_TYPE, //$NON-NLS-2$ + Collections.emptyMap()); } Collection artifacts = miu.getArtifacts(); - if(artifacts.isEmpty()) { + if (artifacts.isEmpty()) { LogUtils.warning("Unable to resolve partial IU '%s' since it does not have any artifacts", iu.getId()); return iu; } IArtifactKey key = artifacts.iterator().next(); ArrayList errors = new ArrayList(); - MirrorGenerator.mirror( - artifacts, null, sourceAr, tempAr, getBuilder().getTransport(), PackedStrategy.UNPACK_AS_SIBLING, - errors, subMon.newChild(1)); + ExecutorService executor = Executors.newSingleThreadExecutor(); + MirrorGenerator.mirror(executor, artifacts, null, sourceAr, tempAr, getBuilder().getTransport(), + PackedStrategy.UNPACK_AS_SIBLING, errors, subMon.newChild(1)); + executor.shutdownNow(); int numErrors = errors.size(); - if(numErrors > 0) { + if (numErrors > 0) { IStatus[] children = new IStatus[numErrors]; - for(int idx = 0; idx < numErrors; ++idx) + for (int idx = 0; idx < numErrors; ++idx) children[idx] = new Status(IStatus.ERROR, Engine.PLUGIN_ID, errors.get(idx)); - MultiStatus status = new MultiStatus( - Engine.PLUGIN_ID, IStatus.ERROR, children, "Unable to mirror", null); + MultiStatus status = new MultiStatus(Engine.PLUGIN_ID, IStatus.ERROR, children, "Unable to mirror", + null); throw new CoreException(status); } File bundleFile = tempAr.getArtifactFile(key); - if(bundleFile == null) - throw ExceptionUtils.fromMessage( - "Unable to resolve partial IU. Artifact file for %s could not be found", key); + if (bundleFile == null) + throw ExceptionUtils + .fromMessage("Unable to resolve partial IU. Artifact file for %s could not be found", key); IInstallableUnit preparedIU = PublisherUtil.createBundleIU(key, bundleFile); - if(preparedIU == null) { - LogUtils.warning( - "Unable to resolve partial IU. Artifact file for %s did not contain a bundle manifest", key); + if (preparedIU == null) { + LogUtils.warning("Unable to resolve partial IU. Artifact file for %s did not contain a bundle manifest", + key); return iu; } IInstallableUnit newIU = P2Bridge.importToModel(preparedIU, iu); @@ -678,9 +674,8 @@ artifacts, null, sourceAr, tempAr, getBuilder().getTransport(), PackedStrategy.U allIUs.remove(miu); allIUs.add(newIU); return newIU; - } - catch(CoreException e) { - for(Contribution contrib : findContributions(iu.getId())) + } catch (CoreException e) { + for (Contribution contrib : findContributions(iu.getId())) getBuilder().sendEmail(contrib, Collections.singletonList(e.getMessage())); throw e; } @@ -706,26 +701,25 @@ public void run(IProgressMonitor monitor) throws CoreException { IProfileRegistry profileRegistry = P2Utils.getProfileRegistry(builder.getProvisioningAgent()); IPlanner planner = P2Utils.getPlanner(builder.getProvisioningAgent()); IMetadataRepositoryManager mdrMgr = builder.getMdrManager(); + ExecutorService executor = Executors.newFixedThreadPool(configs.size()); try { URI repoLocation = builder.getSourceCompositeURI(validationSet); - Set validationOnlyIUs = null; - for(MetadataRepositoryReference validationRepo : validationSet.getAllValidationRepositories()) { - if(validationOnlyIUs == null) - validationOnlyIUs = new HashSet(); + Set validationOnlyIUs = new HashSet(); + for (MetadataRepositoryReference validationRepo : validationSet.getAllValidationRepositories()) { validationOnlyIUs.addAll(validationRepo.getMetadataRepository().getInstallableUnits()); } - if(validationOnlyIUs == null) - validationOnlyIUs = Collections.emptySet(); IMetadataRepository sourceRepo = mdrMgr.loadRepository(repoLocation, subMon.newChild(1)); - if(sourceRepo instanceof UpdateSiteMetadataRepository && - !getBuilder().getAggregation().isAllowLegacySites()) + if (sourceRepo instanceof UpdateSiteMetadataRepository + && !getBuilder().getAggregation().isAllowLegacySites()) throw ExceptionUtils.fromMessage( - "Location %s appoints a legacy update site. They are not allowed in this aggregation", - repoLocation); + "Location %s appoints a legacy update site. They are not allowed in this aggregation", + repoLocation); + + Map> futures = new LinkedHashMap<>(); - for(Configuration config : configs) { - if(!config.isEnabled()) + for (Configuration config : configs) { + if (!config.isEnabled()) continue; String configName = config.getName(); @@ -739,104 +733,67 @@ public void run(IProgressMonitor monitor) throws CoreException { props.put(IProfile.PROP_ENVIRONMENTS, config.getOSGiEnvironmentString()); props.put(IProfile.PROP_INSTALL_FEATURES, "true"); - IProfile profile = null; String profileId = profilePrefix + configName; - profile = profileRegistry.getProfile(profileId); - if(profile == null) - profile = profileRegistry.addProfile(profileId, props); + IProfile profile = profileRegistry.getProfile(profileId) != null ? profileRegistry.getProfile(profileId) + : profileRegistry.addProfile(profileId, props); - IInstallableUnit[] rootArr = getRootIUs( - sourceRepo, builder.getVerificationIUName(validationSet), Builder.ALL_CONTRIBUTED_CONTENT_VERSION, - subMon.newChild(9)); + IInstallableUnit[] rootArr = getRootIUs(sourceRepo, builder.getVerificationIUName(validationSet), + Builder.ALL_CONTRIBUTED_CONTENT_VERSION, subMon.newChild(9)); // Add as root IU's to a request ProfileChangeRequest request = new ProfileChangeRequest(profile); - for(IInstallableUnit rootIU : rootArr) - request.setInstallableUnitProfileProperty( - rootIU, IProfile.PROP_PROFILE_ROOT_IU, Boolean.TRUE.toString()); + for (IInstallableUnit rootIU : rootArr) + request.setInstallableUnitProfileProperty(rootIU, IProfile.PROP_PROFILE_ROOT_IU, + Boolean.TRUE.toString()); request.addInstallableUnits(rootArr); - while(true) { - MonitorUtils.testCancelStatus(monitor); - ProvisioningContext context = createContext(repoLocation); - ProvisioningPlan plan = (ProvisioningPlan) planner.getProvisioningPlan( - request, context, - subMon.newChild(80, SubMonitor.SUPPRESS_BEGINTASK | SubMonitor.SUPPRESS_SETTASKNAME)); - - IStatus status = plan.getStatus(); - if(status.getSeverity() == IStatus.ERROR) { - LogUtils.log(status); - sendEmails((PlannerStatus) status); - LogUtils.info("Done. Took %s", TimeUtils.getFormattedDuration(start)); //$NON-NLS-1$ - throw new CoreException( - new AnalyzedPlannerStatus( - ((EObject) aggregation).eResource(), config, (PlannerStatus) status)); - } - - boolean hadPartials = false; - - Set suspectedValidationOnlyIUs = null; - Operand[] ops = plan.getOperands(); - for(Operand op : ops) { - if(!(op instanceof InstallableUnitOperand)) - continue; - - InstallableUnitOperand iuOp = (InstallableUnitOperand) op; - IInstallableUnit iu = iuOp.second(); - if(iu == null) - continue; - - // skip all IUs generated for verification purposes - if(Boolean.parseBoolean(iu.getProperty(Builder.PROP_AGGREGATOR_GENERATED_IU))) - continue; - - if(validationOnlyIUs.contains(iu)) { - // This IU should not be included unless it is also included in one of - // the contributed repositories - if(suspectedValidationOnlyIUs == null) - suspectedValidationOnlyIUs = new HashSet(); - suspectedValidationOnlyIUs.add(iu); + CountDownLatch latch = new CountDownLatch(1); + Future future = executor.submit(() -> { + while (true) { + MonitorUtils.testCancelStatus(monitor); + ProvisioningContext context = createContext(repoLocation); + ProvisioningPlan plan = (ProvisioningPlan) planner.getProvisioningPlan(request, context, + subMon.newChild(80, SubMonitor.SUPPRESS_BEGINTASK | SubMonitor.SUPPRESS_SETTASKNAME)); + + latch.await(); + + IStatus status = plan.getStatus(); + if (status.getSeverity() == IStatus.ERROR) { + LogUtils.log(status); + sendEmails((PlannerStatus) status); + LogUtils.info("Done. Took %s", TimeUtils.getFormattedDuration(start)); //$NON-NLS-1$ + throw new CoreException(new AnalyzedPlannerStatus(((EObject) aggregation).eResource(), + config, (PlannerStatus) status)); } - else { - if(!unitsToAggregate.contains(iu)) { - if(Boolean.valueOf(iu.getProperty(IInstallableUnit.PROP_PARTIAL_IU)).booleanValue()) { - iu = resolvePartialIU(iu, subMon.newChild(1)); - hadPartials = true; - } - unitsToAggregate.add(iu); - } - } - } - Iterator itor = sourceRepo.query( - QueryUtil.createIUPatchQuery(), subMon.newChild(1)).iterator(); + boolean hadPartials = false; - IQueryable collectedStuff = null; - while(itor.hasNext()) { - IInstallableUnitPatch patch = (IInstallableUnitPatch) itor.next(); - if(!unitsToAggregate.contains(patch)) - continue; + Set suspectedValidationOnlyIUs = null; + Operand[] ops = plan.getOperands(); + for (Operand op : ops) { + if (!(op instanceof InstallableUnitOperand)) + continue; - if(collectedStuff == null) { - collectedStuff = new QueryableArray( - unitsToAggregate.toArray(new IInstallableUnit[unitsToAggregate.size()])); - } + InstallableUnitOperand iuOp = (InstallableUnitOperand) op; + IInstallableUnit iu = iuOp.second(); + if (iu == null) + continue; - Set units = getUnpatchedTransitiveScope( - collectedStuff, patch, profile, planner, repoLocation, subMon.newChild(1)); - for(IInstallableUnit iu : units) { - if(validationOnlyIUs.contains(iu)) { + // skip all IUs generated for verification purposes + if (Boolean.parseBoolean(iu.getProperty(Builder.PROP_AGGREGATOR_GENERATED_IU))) + continue; + + if (validationOnlyIUs.contains(iu)) { // This IU should not be included unless it is also included in one of // the contributed repositories - if(suspectedValidationOnlyIUs == null) + if (suspectedValidationOnlyIUs == null) suspectedValidationOnlyIUs = new HashSet(); suspectedValidationOnlyIUs.add(iu); - } - else { - if(!unitsToAggregate.contains(iu)) { - if(Boolean.valueOf( - iu.getProperty(IInstallableUnit.PROP_PARTIAL_IU)).booleanValue()) { + } else { + if (!unitsToAggregate.contains(iu)) { + if (Boolean.valueOf(iu.getProperty(IInstallableUnit.PROP_PARTIAL_IU)) + .booleanValue()) { iu = resolvePartialIU(iu, subMon.newChild(1)); hadPartials = true; } @@ -844,77 +801,130 @@ public void run(IProgressMonitor monitor) throws CoreException { } } } - } - if(suspectedValidationOnlyIUs != null) { - // Prune the set of IU's that we suspect are there for validation - // purposes only using the source repository - // - final Set candidates = suspectedValidationOnlyIUs; - final boolean hadPartialsHolder[] = new boolean[] { false }; - - Iterator allIUs = sourceRepo.query( - QueryUtil.createIUAnyQuery(), subMon.newChild(1)).iterator(); - - while(allIUs.hasNext()) { - IInstallableUnit iu = allIUs.next(); - if(candidates.contains(iu) && !unitsToAggregate.contains(iu)) { - try { - if(Boolean.valueOf( - iu.getProperty(IInstallableUnit.PROP_PARTIAL_IU)).booleanValue()) { - iu = resolvePartialIU(iu, SubMonitor.convert(new NullProgressMonitor())); - hadPartialsHolder[0] = true; + Iterator itor = sourceRepo + .query(QueryUtil.createIUPatchQuery(), subMon.newChild(1)).iterator(); + + IQueryable collectedStuff = null; + while (itor.hasNext()) { + IInstallableUnitPatch patch = (IInstallableUnitPatch) itor.next(); + if (!unitsToAggregate.contains(patch)) + continue; + + if (collectedStuff == null) { + collectedStuff = new QueryableArray( + unitsToAggregate.toArray(new IInstallableUnit[unitsToAggregate.size()])); + } + + Set units = getUnpatchedTransitiveScope(collectedStuff, patch, profile, + planner, repoLocation, subMon.newChild(1)); + for (IInstallableUnit iu : units) { + if (validationOnlyIUs.contains(iu)) { + // This IU should not be included unless it is also included in one of + // the contributed repositories + if (suspectedValidationOnlyIUs == null) + suspectedValidationOnlyIUs = new HashSet(); + suspectedValidationOnlyIUs.add(iu); + } else { + if (!unitsToAggregate.contains(iu)) { + if (Boolean.valueOf(iu.getProperty(IInstallableUnit.PROP_PARTIAL_IU)) + .booleanValue()) { + iu = resolvePartialIU(iu, subMon.newChild(1)); + hadPartials = true; + } + unitsToAggregate.add(iu); } } - catch(CoreException e) { - throw new RuntimeException(e); + } + } + + if (suspectedValidationOnlyIUs != null) { + // Prune the set of IU's that we suspect are there for validation + // purposes only using the source repository + // + final Set candidates = suspectedValidationOnlyIUs; + final boolean hadPartialsHolder[] = new boolean[] { false }; + + Iterator allIUs = sourceRepo + .query(QueryUtil.createIUAnyQuery(), subMon.newChild(1)).iterator(); + + while (allIUs.hasNext()) { + IInstallableUnit iu = allIUs.next(); + if (candidates.contains(iu) && !unitsToAggregate.contains(iu)) { + try { + if (Boolean.valueOf(iu.getProperty(IInstallableUnit.PROP_PARTIAL_IU)) + .booleanValue()) { + iu = resolvePartialIU(iu, SubMonitor.convert(new NullProgressMonitor())); + hadPartialsHolder[0] = true; + } + } catch (CoreException e) { + throw new RuntimeException(e); + } + unitsToAggregate.add(iu); } - unitsToAggregate.add(iu); } } - } - // exit the loop if there are no more partial IUs - if(!hadPartials) - break; + // exit the loop if there are no more partial IUs + if (!hadPartials) + break; + + LogUtils.info("Partial IU's encountered. Verifying %s again...", configName); //$NON-NLS-1$ + } + LogUtils.info(format("Verified config %s...", configName)); //$NON-NLS-1$ + return null; + }); + futures.put(latch, future); + } - LogUtils.info("Partial IU's encountered. Verifying %s again...", configName); //$NON-NLS-1$ + Exception exception = null; + for (Map.Entry> entry : futures.entrySet()) { + entry.getKey().countDown(); + try { + entry.getValue().get(); + } catch (ExecutionException ex) { + if (exception == null) { + exception = (Exception) ex.getCause(); + } } } + if (exception != null) { + throw exception; + } + LogUtils.info("Verification successful"); //$NON-NLS-1$ - } - catch(OperationCanceledException e) { + } catch (OperationCanceledException e) { LogUtils.info("Operation canceled."); //$NON-NLS-1$ - } - catch(RuntimeException e) { + } catch (Exception e) { throw ExceptionUtils.wrap(e); - } - finally { + } finally { MonitorUtils.done(monitor); P2Utils.ungetProfileRegistry(builder.getProvisioningAgent(), profileRegistry); P2Utils.ungetPlanner(builder.getProvisioningAgent(), planner); - if(!monitor.isCanceled()) { + if (!monitor.isCanceled()) { LogUtils.info("Done. Took %s", TimeUtils.getFormattedDuration(start)); //$NON-NLS-1$ } + + executor.shutdown(); } } private void sendEmails(PlannerStatus plannerStatus) { Builder builder = getBuilder(); - if(!builder.getAggregation().isSendmail()) + if (!builder.getAggregation().isSendmail()) return; RequestStatus requestStatus = plannerStatus.getRequestStatus(); - if(requestStatus == null) + if (requestStatus == null) return; Map contribs = getContributionMap(plannerStatus); List errors = getResolutionErrors(plannerStatus); - if(contribs.isEmpty()) + if (contribs.isEmpty()) builder.sendEmail(null, errors); else { - for(Contribution contrib : contribs.values()) + for (Contribution contrib : contribs.values()) builder.sendEmail(contrib, errors); } } diff --git a/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/internal/InternalMetadataRepositoryIO.java b/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/internal/InternalMetadataRepositoryIO.java index b4aaf270b..618f2b52f 100644 --- a/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/internal/InternalMetadataRepositoryIO.java +++ b/org.eclipse.cbi.p2repo.aggregator.engine/src/org/eclipse/cbi/p2repo/aggregator/engine/internal/InternalMetadataRepositoryIO.java @@ -431,7 +431,7 @@ else if(name.equals(REQUIREMENT_VERSION_RANGE_ELEMENT)) { private IMetadataRepository theRepository = null; public InternalParser(BundleContext context, String bundleId) { - super(context, bundleId); + super(bundleId); } @Override diff --git a/org.eclipse.cbi.p2repo.aggregator.legacy.ui/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator.legacy.ui/META-INF/MANIFEST.MF index 0acc697ac..280a576ee 100644 --- a/org.eclipse.cbi.p2repo.aggregator.legacy.ui/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.aggregator.legacy.ui/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator.legacy.ui;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-Vendor: %providerName Require-Bundle: org.eclipse.cbi.p2repo.aggregator.editor, diff --git a/org.eclipse.cbi.p2repo.aggregator.legacy.ui/about.html b/org.eclipse.cbi.p2repo.aggregator.legacy.ui/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.aggregator.legacy.ui/about.html +++ b/org.eclipse.cbi.p2repo.aggregator.legacy.ui/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.aggregator.legacy.ui/pom.xml b/org.eclipse.cbi.p2repo.aggregator.legacy.ui/pom.xml index e4c23faf7..9a0fb49e7 100644 --- a/org.eclipse.cbi.p2repo.aggregator.legacy.ui/pom.xml +++ b/org.eclipse.cbi.p2repo.aggregator.legacy.ui/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.aggregator.legacy.ui - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator.legacy/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator.legacy/META-INF/MANIFEST.MF index 037cb30d6..02a99cdda 100644 --- a/org.eclipse.cbi.p2repo.aggregator.legacy/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.aggregator.legacy/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Localization: plugin Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator.legacy;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport, diff --git a/org.eclipse.cbi.p2repo.aggregator.legacy/about.html b/org.eclipse.cbi.p2repo.aggregator.legacy/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.aggregator.legacy/about.html +++ b/org.eclipse.cbi.p2repo.aggregator.legacy/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.aggregator.legacy/pom.xml b/org.eclipse.cbi.p2repo.aggregator.legacy/pom.xml index 8c95d734a..b3378c9a0 100644 --- a/org.eclipse.cbi.p2repo.aggregator.legacy/pom.xml +++ b/org.eclipse.cbi.p2repo.aggregator.legacy/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.aggregator.legacy - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.aggregator/META-INF/MANIFEST.MF index 228d7b9ae..dc7c66418 100644 --- a/org.eclipse.cbi.p2repo.aggregator/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.aggregator/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cbi.p2repo.aggregator;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.cbi.p2repo.aggregator.AggregatorPlugin$Implementation Bundle-Localization: plugin diff --git a/org.eclipse.cbi.p2repo.aggregator/about.html b/org.eclipse.cbi.p2repo.aggregator/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.aggregator/about.html +++ b/org.eclipse.cbi.p2repo.aggregator/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.aggregator/model/Aggregator.genmodel b/org.eclipse.cbi.p2repo.aggregator/model/Aggregator.genmodel index 080182b69..54ae51436 100644 --- a/org.eclipse.cbi.p2repo.aggregator/model/Aggregator.genmodel +++ b/org.eclipse.cbi.p2repo.aggregator/model/Aggregator.genmodel @@ -1,9 +1,10 @@ + interfaceNamePattern="" classNamePattern="" importOrganizing="true" cleanup="true" + autoResizeProperties="true" expandAllAction="true" collapseAllAction="true" revertAction="true"> Aggregator.ecore 4.0.0 org.eclipse.cbi.p2repo.aggregator - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/impl/AggregationImpl.java b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/impl/AggregationImpl.java index 0cbf65213..7d6914c75 100644 --- a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/impl/AggregationImpl.java +++ b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/impl/AggregationImpl.java @@ -20,6 +20,7 @@ import org.eclipse.cbi.p2repo.aggregator.Contact; import org.eclipse.cbi.p2repo.aggregator.Contribution; import org.eclipse.cbi.p2repo.aggregator.CustomCategory; +import org.eclipse.cbi.p2repo.aggregator.Feature; import org.eclipse.cbi.p2repo.aggregator.InfosProvider; import org.eclipse.cbi.p2repo.aggregator.MappedRepository; import org.eclipse.cbi.p2repo.aggregator.MavenMapping; @@ -1069,6 +1070,13 @@ synchronized public Status getStatus() { if ((statusCode = mapping.getStatus().getCode()) != StatusCode.OK && statusCode != StatusCode.WAITING) return AggregatorFactory.eINSTANCE.createStatus(StatusCode.BROKEN); } + for (CustomCategory customCategory : getCustomCategories()) { + for (Feature feature : customCategory.getFeatures()) { + if ((statusCode = feature.getStatus().getCode()) != StatusCode.OK && statusCode != StatusCode.WAITING) { + return AggregatorFactory.eINSTANCE.createStatus(StatusCode.BROKEN); + } + } + } return AggregatorFactory.eINSTANCE.createStatus(StatusCode.OK); } diff --git a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/impl/InstallableUnitRequestImpl.java b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/impl/InstallableUnitRequestImpl.java index 991f8b353..5909b8c4e 100644 --- a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/impl/InstallableUnitRequestImpl.java +++ b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/impl/InstallableUnitRequestImpl.java @@ -594,6 +594,11 @@ public String getName() { */ @Override synchronized public Status getStatus() { + if (eIsProxy()) { + return AggregatorFactory.eINSTANCE.createStatus(StatusCode.BROKEN, + AggregatorPlugin.INSTANCE.getString("_UI_ErrorMessage_UnresolvedProxy", + new Object[] { eProxyURI() })); + } if (!isBranchDisabledOrMappedRepositoryBroken()) { if (resolveAsSingleton() == null) return AggregatorFactory.eINSTANCE.createStatus(StatusCode.BROKEN, @@ -707,6 +712,10 @@ synchronized public void resolveAvailableVersions(boolean updateOnly) { List avList = new ArrayList<>(); IQuery query = QueryUtil.createIUQuery(name); MappedRepository mr = getMappedRepository(); + if (mr == null) { + return; + } + addAvailableVersions(mr, query, AvailableFrom.REPOSITORY, avList); Contribution contrib = (Contribution) ((EObject) mr).eContainer(); if (contrib == null) { diff --git a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2/util/MetadataRepositoryResourceImpl.java b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2/util/MetadataRepositoryResourceImpl.java index 093009f32..dc2cf0c59 100644 --- a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2/util/MetadataRepositoryResourceImpl.java +++ b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2/util/MetadataRepositoryResourceImpl.java @@ -17,11 +17,8 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; import java.util.regex.Pattern; import org.eclipse.cbi.p2repo.aggregator.Aggregation; @@ -29,39 +26,27 @@ import org.eclipse.cbi.p2repo.aggregator.AggregatorPlugin; import org.eclipse.cbi.p2repo.aggregator.ChildrenProvider; import org.eclipse.cbi.p2repo.aggregator.Contribution; -import org.eclipse.cbi.p2repo.aggregator.InstallableUnitType; import org.eclipse.cbi.p2repo.aggregator.MappedRepository; import org.eclipse.cbi.p2repo.aggregator.MappedUnit; import org.eclipse.cbi.p2repo.aggregator.MetadataRepositoryReference; -import org.eclipse.cbi.p2repo.aggregator.Property; import org.eclipse.cbi.p2repo.aggregator.Status; import org.eclipse.cbi.p2repo.aggregator.StatusCode; import org.eclipse.cbi.p2repo.aggregator.StatusProvider; import org.eclipse.cbi.p2repo.aggregator.ValidationSet; -import org.eclipse.cbi.p2repo.aggregator.p2view.Bundle; import org.eclipse.cbi.p2repo.aggregator.p2view.Categories; -import org.eclipse.cbi.p2repo.aggregator.p2view.Category; -import org.eclipse.cbi.p2repo.aggregator.p2view.Feature; -import org.eclipse.cbi.p2repo.aggregator.p2view.Fragment; import org.eclipse.cbi.p2repo.aggregator.p2view.IUPresentation; import org.eclipse.cbi.p2repo.aggregator.p2view.MetadataRepositoryStructuredView; -import org.eclipse.cbi.p2repo.aggregator.p2view.OtherIU; import org.eclipse.cbi.p2repo.aggregator.p2view.P2viewFactory; -import org.eclipse.cbi.p2repo.aggregator.p2view.Product; import org.eclipse.cbi.p2repo.aggregator.p2view.RepositoryBrowser; -import org.eclipse.cbi.p2repo.aggregator.p2view.RepositoryReferences; -import org.eclipse.cbi.p2repo.aggregator.util.InstallableUnitUtils; +import org.eclipse.cbi.p2repo.aggregator.p2view.util.MetadataRepositoryStructuredViewBuilder; import org.eclipse.cbi.p2repo.aggregator.util.ResourceDiagnosticImpl; import org.eclipse.cbi.p2repo.aggregator.util.ResourceUtils; import org.eclipse.cbi.p2repo.aggregator.util.TwoColumnMatrix; import org.eclipse.cbi.p2repo.p2.MetadataRepository; import org.eclipse.cbi.p2repo.p2.P2Factory; -import org.eclipse.cbi.p2repo.p2.impl.InstallableUnitImpl; import org.eclipse.cbi.p2repo.p2.impl.MetadataRepositoryImpl; import org.eclipse.cbi.p2repo.p2.loader.IRepositoryLoader; -import org.eclipse.cbi.p2repo.p2.util.IUUtils; import org.eclipse.cbi.p2repo.p2.util.P2Utils; -import org.eclipse.cbi.p2repo.p2.util.RepositoryTranslationSupport; import org.eclipse.cbi.p2repo.p2.util.ResourceSetWithAgent; import org.eclipse.cbi.p2repo.util.LogUtils; import org.eclipse.cbi.p2repo.util.MonitorUtils; @@ -81,13 +66,10 @@ import org.eclipse.emf.ecore.resource.ResourceSet; import org.eclipse.emf.ecore.resource.impl.ResourceImpl; import org.eclipse.emf.ecore.util.EcoreUtil; -import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability; import org.eclipse.equinox.p2.core.IProvisioningAgent; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.metadata.IRequirement; -import org.eclipse.equinox.p2.metadata.Version; import org.eclipse.equinox.p2.metadata.VersionRange; -import org.eclipse.equinox.p2.repository.IRepositoryReference; public class MetadataRepositoryResourceImpl extends ResourceImpl implements StatusProvider { class AsynchronousLoader extends Job { @@ -221,252 +203,6 @@ public RepositoryLoaderJob(IProvisioningAgent agent, MetadataRepositoryImpl repo setPriority(Job.SHORT); } - private void addIUsToMap(Object container, List iuPresentations) { - Object[] treePath = new Object[4]; - treePath[0] = MetadataRepositoryResourceImpl.this; - treePath[1] = repoView; - treePath[2] = repoView.getInstallableUnitList(); - treePath[3] = container; - - for(IUPresentation iup : iuPresentations) - allIUMatrix.add(iup, treePath); - } - - private void createStructuredView() { - repoView.setName(repository.getName()); - repoView.setInstallableUnitList(P2viewFactory.eINSTANCE.createInstallableUnits()); - - Map> iuMap = new HashMap>(); - List categories = new ArrayList(); - List features = new ArrayList(); - List products = new ArrayList(); - List bundles = new ArrayList(); - List fragments = new ArrayList(); - List miscellaneous = new ArrayList(); - List allIUs = repoView.getInstallableUnitList().getAllIUs(); - - for(IInstallableUnit iu : repository.getInstallableUnits()) { - IUPresentation iuPresentation; - - switch(InstallableUnitUtils.getType(iu)) { - case CATEGORY: - iuPresentation = P2viewFactory.eINSTANCE.createCategory(iu); - if(!((Category) iuPresentation).isNested()) - categories.add((Category) iuPresentation); - break; - case FEATURE: - iuPresentation = P2viewFactory.eINSTANCE.createFeature(iu); - features.add((Feature) iuPresentation); - break; - case PRODUCT: - iuPresentation = P2viewFactory.eINSTANCE.createProduct(iu); - products.add((Product) iuPresentation); - break; - case BUNDLE: - iuPresentation = P2viewFactory.eINSTANCE.createBundle(iu); - bundles.add((Bundle) iuPresentation); - break; - case FRAGMENT: - iuPresentation = P2viewFactory.eINSTANCE.createFragment(iu); - fragments.add((Fragment) iuPresentation); - break; - default: - iuPresentation = P2viewFactory.eINSTANCE.createOtherIU(iu); - miscellaneous.add((OtherIU) iuPresentation); - } - - iuPresentation.setId(iu.getId()); - iuPresentation.setVersion(iu.getVersion()); - iuPresentation.setFilter(P2Utils.filterToString(iu.getFilter())); - - String name = RepositoryTranslationSupport.getInstance( - (MetadataRepository) ((InstallableUnitImpl) iu).eContainer()).getIUProperty( - iu, IInstallableUnit.PROP_NAME); - if(name == null || name.length() == 0) - iuPresentation.setName(iu.getId()); - else - iuPresentation.setName(name); - - if(name != null && name.startsWith("%")) - name = null; - - if(InstallableUnitUtils.getType(iu) == InstallableUnitType.CATEGORY || iu.getVersion() == null) - iuPresentation.setLabel(name != null && name.length() > 0 - ? name - : iu.getId()); - else - iuPresentation.setLabel( - iu.getId() + " / " + IUUtils.stringifyVersion(iu.getVersion()) + - (name != null && name.length() > 0 - ? " (" + name + ")" - : "")); - iuPresentation.setDescription( - RepositoryTranslationSupport.getInstance( - (MetadataRepository) ((InstallableUnitImpl) iu).eContainer()).getIUProperty( - iu, IInstallableUnit.PROP_DESCRIPTION)); - - Map versionMap = iuMap.get(iu.getId()); - if(versionMap == null) - iuMap.put(iu.getId(), versionMap = new HashMap()); - versionMap.put(iu.getVersion(), iuPresentation); - - allIUs.add(iuPresentation); - } - - if(categories.size() > 0) { - Collections.sort(categories, IUPresentation.COMPARATOR); - repoView.getInstallableUnitList().getNotNullCategoryContainer().getCategories().addAll(categories); - - addIUsToMap(repoView.getInstallableUnitList().getCategoryContainer(), categories); - } - if(features.size() > 0) { - Collections.sort(features, IUPresentation.COMPARATOR); - repoView.getInstallableUnitList().getNotNullFeatureContainer().getFeatures().addAll(features); - - addIUsToMap(repoView.getInstallableUnitList().getFeatureContainer(), features); - } - if(products.size() > 0) { - Collections.sort(products, IUPresentation.COMPARATOR); - repoView.getInstallableUnitList().getNotNullProductContainer().getProducts().addAll(products); - - addIUsToMap(repoView.getInstallableUnitList().getProductContainer(), products); - } - if(bundles.size() > 0) { - Collections.sort(bundles, IUPresentation.COMPARATOR); - repoView.getInstallableUnitList().getNotNullBundleContainer().getBundles().addAll(bundles); - - addIUsToMap(repoView.getInstallableUnitList().getBundleContainer(), bundles); - } - if(fragments.size() > 0) { - Collections.sort(fragments, IUPresentation.COMPARATOR); - repoView.getInstallableUnitList().getNotNullFragmentContainer().getFragments().addAll(fragments); - - addIUsToMap(repoView.getInstallableUnitList().getFragmentContainer(), fragments); - } - if(miscellaneous.size() > 0) { - Collections.sort(miscellaneous, IUPresentation.COMPARATOR); - repoView.getInstallableUnitList().getNotNullMiscellaneousContainer().getOthers().addAll(miscellaneous); - - addIUsToMap(repoView.getInstallableUnitList().getMiscellaneousContainer(), miscellaneous); - } - - Categories categoryContainer = repoView.getInstallableUnitList().getCategoryContainer(); - if(categoryContainer != null) - for(Category category : categoryContainer.getCategories()) { - Set visited = new HashSet(); - exploreCategory(category, iuMap, visited); - } - - List propList = new ArrayList(); - for(Map.Entry property : repository.getPropertyMap()) - propList.add(AggregatorFactory.eINSTANCE.createProperty(property.getKey(), property.getValue())); - if(propList.size() > 0) { - repoView.setProperties(P2viewFactory.eINSTANCE.createProperties()); - Collections.sort(propList); - repoView.getProperties().getPropertyList().addAll(propList); - } - - List references = repository.getReferences(); - if(references.size() > 0) { - RepositoryReferences repoRefs = P2viewFactory.eINSTANCE.createRepositoryReferences(); - repoView.setRepositoryReferences(repoRefs); - repoRefs.getRepositoryReferences().addAll(references); - } - - repoView.setLoaded(true); - - Aggregation aggregation = ResourceUtils.getAggregation(getResourceSet()); - if(aggregation != null) { - for(MetadataRepositoryReference mdrReference : aggregation.getAllMetadataRepositoryReferences(true)) { - String refLocation = mdrReference.getLocation(); - if(refLocation != null && refLocation.endsWith("/")) - refLocation = refLocation.substring(0, refLocation.length() - 1); - if(repository.getLocation().toString().equals(refLocation)) - // force notification by formal setting the value to current value - // once the adapter (if exists) receives the notification, it will take care of - // refreshing labels and content of itself and its parents - mdrReference.setLocation(mdrReference.getLocation()); - } - } - } - - private void exploreCategory(Category category, Map> iuMap, - Set visited) { - visited.add(category); - - List categories = new ArrayList(); - List features = new ArrayList(); - List products = new ArrayList(); - List bundles = new ArrayList(); - List fragments = new ArrayList(); - - int idx = allIUMatrix.indexOf(category); - Object[] oldTreePath = allIUMatrix.getValue(idx); - int len = oldTreePath.length; - Object[] categoryTreePath = new Object[len + 1]; - System.arraycopy(oldTreePath, 0, categoryTreePath, 0, len); - categoryTreePath[len] = category; - - for(IRequirement requirement : category.getInstallableUnit().getRequirements()) { - for(IUPresentation iuPresentation : findMatchingIUs(requirement, iuMap)) { - if(visited.contains(iuPresentation)) - // there's a recursion - continue; - - allIUMatrix.add(++idx, iuPresentation, categoryTreePath); - if(iuPresentation instanceof Category) { - categories.add((Category) iuPresentation); - exploreCategory((Category) iuPresentation, iuMap, visited); - } - else if(iuPresentation instanceof Feature) - features.add((Feature) iuPresentation); - else if(iuPresentation instanceof Product) - products.add((Product) iuPresentation); - else if(iuPresentation instanceof Fragment) - fragments.add((Fragment) iuPresentation); - else if(iuPresentation instanceof Bundle) - bundles.add((Bundle) iuPresentation); - } - } - - if(categories.size() > 0) { - Collections.sort(categories, IUPresentation.COMPARATOR); - category.getNotNullCategoryContainer().getCategories().addAll(categories); - } - if(features.size() > 0) { - Collections.sort(features, IUPresentation.COMPARATOR); - category.getNotNullFeatureContainer().getFeatures().addAll(features); - } - if(products.size() > 0) { - Collections.sort(products, IUPresentation.COMPARATOR); - category.getNotNullProductContainer().getProducts().addAll(products); - } - if(bundles.size() > 0) { - Collections.sort(bundles, IUPresentation.COMPARATOR); - category.getNotNullBundleContainer().getBundles().addAll(bundles); - } - if(fragments.size() > 0) { - Collections.sort(fragments, IUPresentation.COMPARATOR); - category.getNotNullFragmentContainer().getFragments().addAll(fragments); - } - } - - private List findMatchingIUs(IRequirement rq, Map> iuMap) { - List found = new ArrayList(); - if(rq instanceof IRequiredCapability) { - Map vps = iuMap.get(((IRequiredCapability) rq).getName()); - if(vps != null) - for(Map.Entry vp : vps.entrySet()) - if(vp.getValue().getInstallableUnit().satisfies(rq)) - found.add(vp.getValue()); - } - for(Map vps : iuMap.values()) - for(Map.Entry vp : vps.entrySet()) - if(vp.getValue().getInstallableUnit().satisfies(rq)) - found.add(vp.getValue()); - return found; - } - public Exception getException() { return exception; } @@ -492,7 +228,8 @@ protected IStatus run(IProgressMonitor monitor) { updateAvailableVersions(); - createStructuredView(); + MetadataRepositoryStructuredViewBuilder.build(MetadataRepositoryResourceImpl.this, repoView, repository, + allIUMatrix); LogUtils.debug("Repository %s loaded (Took %s)", location, TimeUtils.getFormattedDuration(start)); } diff --git a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2view/impl/RepositoryBrowserImpl.java b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2view/impl/RepositoryBrowserImpl.java index 2e86a366a..d19d6cac7 100644 --- a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2view/impl/RepositoryBrowserImpl.java +++ b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2view/impl/RepositoryBrowserImpl.java @@ -31,6 +31,7 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; +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.resource.Resource; @@ -94,10 +95,12 @@ public void notifyChanged(Notification notification) { */ protected static final boolean LOADING_EDEFAULT = false; - private final Aggregation aggregation; - private final NotifyDispatcher notifyDispatcher = new NotifyDispatcher(); + private final ResourceSet resourceSet; + + private Aggregation aggregation; + /** * * @@ -110,7 +113,19 @@ protected RepositoryBrowserImpl() { protected RepositoryBrowserImpl(Aggregation aggregation) { super(); this.aggregation = aggregation; - ((EObject) aggregation).eResource().getResourceSet().eAdapters().add(notifyDispatcher); + resourceSet = ((EObject) aggregation).eResource().getResourceSet(); + resourceSet.eAdapters().add(notifyDispatcher); + } + + /** + * @return the aggregation + */ + public Aggregation getAggregation() { + if (((EObject) aggregation).eIsProxy()) { + aggregation = (Aggregation) resourceSet.getEObject(((InternalEObject) aggregation).eProxyURI(), true); + + } + return aggregation; } /** @@ -249,7 +264,7 @@ public EList getChildren() { @Override public EList getRepositories() { List resources = getResources(); - EList result = new BasicEList<>(resources.size() - 1); + EList result = new BasicEList<>(resources.size()); for (Resource resource : resources) { if (resource instanceof MetadataRepositoryResourceImpl) { EList contents = resource.getContents(); @@ -265,7 +280,7 @@ public EList getRepositories() { private List getResources() { List result = null; - Resource aggrResource = ((EObject) aggregation).eResource(); + Resource aggrResource = ((EObject) getAggregation()).eResource(); if (aggrResource != null) { ResourceSet rs = aggrResource.getResourceSet(); if (rs != null) diff --git a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2view/util/MetadataRepositoryStructuredViewBuilder.java b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2view/util/MetadataRepositoryStructuredViewBuilder.java new file mode 100644 index 000000000..4760e5e46 --- /dev/null +++ b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/p2view/util/MetadataRepositoryStructuredViewBuilder.java @@ -0,0 +1,328 @@ +/** + * Copyright (c) 2022 Eclipse contributors and others. + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + */ +package org.eclipse.cbi.p2repo.aggregator.p2view.util; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.eclipse.cbi.p2repo.aggregator.Aggregation; +import org.eclipse.cbi.p2repo.aggregator.AggregatorFactory; +import org.eclipse.cbi.p2repo.aggregator.InstallableUnitType; +import org.eclipse.cbi.p2repo.aggregator.MetadataRepositoryReference; +import org.eclipse.cbi.p2repo.aggregator.Property; +import org.eclipse.cbi.p2repo.aggregator.p2view.Bundle; +import org.eclipse.cbi.p2repo.aggregator.p2view.Categories; +import org.eclipse.cbi.p2repo.aggregator.p2view.Category; +import org.eclipse.cbi.p2repo.aggregator.p2view.Feature; +import org.eclipse.cbi.p2repo.aggregator.p2view.Fragment; +import org.eclipse.cbi.p2repo.aggregator.p2view.IUPresentation; +import org.eclipse.cbi.p2repo.aggregator.p2view.MetadataRepositoryStructuredView; +import org.eclipse.cbi.p2repo.aggregator.p2view.OtherIU; +import org.eclipse.cbi.p2repo.aggregator.p2view.P2viewFactory; +import org.eclipse.cbi.p2repo.aggregator.p2view.Product; +import org.eclipse.cbi.p2repo.aggregator.p2view.RepositoryReferences; +import org.eclipse.cbi.p2repo.aggregator.util.InstallableUnitUtils; +import org.eclipse.cbi.p2repo.aggregator.util.ResourceUtils; +import org.eclipse.cbi.p2repo.aggregator.util.TwoColumnMatrix; +import org.eclipse.cbi.p2repo.p2.MetadataRepository; +import org.eclipse.cbi.p2repo.p2.impl.InstallableUnitImpl; +import org.eclipse.cbi.p2repo.p2.util.IUUtils; +import org.eclipse.cbi.p2repo.p2.util.P2Utils; +import org.eclipse.cbi.p2repo.p2.util.RepositoryTranslationSupport; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.IRequirement; +import org.eclipse.equinox.p2.metadata.Version; +import org.eclipse.equinox.p2.repository.IRepositoryReference; + +public class MetadataRepositoryStructuredViewBuilder { + private final Resource resource; + private final MetadataRepositoryStructuredView repoView; + private final MetadataRepository repository; + private final TwoColumnMatrix allIUMatrix; + + public static MetadataRepositoryStructuredView create(MetadataRepository repository) { + MetadataRepositoryStructuredView repoView = P2viewFactory.eINSTANCE + .createMetadataRepositoryStructuredView(repository); + new MetadataRepositoryStructuredViewBuilder(null, repoView, repository, new TwoColumnMatrix<>()) + .buildStructuredView(); + return repoView; + } + + public static void build(Resource resource, MetadataRepositoryStructuredView repoView, + MetadataRepository repository, TwoColumnMatrix allIUMatrix) { + new MetadataRepositoryStructuredViewBuilder(resource, repoView, repository, allIUMatrix).buildStructuredView(); + } + + private MetadataRepositoryStructuredViewBuilder(Resource resource, MetadataRepositoryStructuredView repoView, + MetadataRepository repository, TwoColumnMatrix allIUMatrix) { + this.resource = resource; + this.repoView = repoView; + this.repository = repository; + this.allIUMatrix = allIUMatrix; + } + + private void buildStructuredView() { + repoView.setName(repository.getName()); + repoView.setInstallableUnitList(P2viewFactory.eINSTANCE.createInstallableUnits()); + + Map> iuMap = new HashMap>(); + List categories = new ArrayList(); + List features = new ArrayList(); + List products = new ArrayList(); + List bundles = new ArrayList(); + List fragments = new ArrayList(); + List miscellaneous = new ArrayList(); + List allIUs = repoView.getInstallableUnitList().getAllIUs(); + + for (IInstallableUnit iu : repository.getInstallableUnits()) { + IUPresentation iuPresentation; + + switch (InstallableUnitUtils.getType(iu)) { + case CATEGORY: + iuPresentation = P2viewFactory.eINSTANCE.createCategory(iu); + if (!((Category) iuPresentation).isNested()) + categories.add((Category) iuPresentation); + break; + case FEATURE: + iuPresentation = P2viewFactory.eINSTANCE.createFeature(iu); + features.add((Feature) iuPresentation); + break; + case PRODUCT: + iuPresentation = P2viewFactory.eINSTANCE.createProduct(iu); + products.add((Product) iuPresentation); + break; + case BUNDLE: + iuPresentation = P2viewFactory.eINSTANCE.createBundle(iu); + bundles.add((Bundle) iuPresentation); + break; + case FRAGMENT: + iuPresentation = P2viewFactory.eINSTANCE.createFragment(iu); + fragments.add((Fragment) iuPresentation); + break; + default: + iuPresentation = P2viewFactory.eINSTANCE.createOtherIU(iu); + miscellaneous.add((OtherIU) iuPresentation); + } + + iuPresentation.setId(iu.getId()); + iuPresentation.setVersion(iu.getVersion()); + iuPresentation.setFilter(P2Utils.filterToString(iu.getFilter())); + + String name = RepositoryTranslationSupport + .getInstance((MetadataRepository) ((InstallableUnitImpl) iu).eContainer()) + .getIUProperty(iu, IInstallableUnit.PROP_NAME); + if (name == null || name.length() == 0) + iuPresentation.setName(iu.getId()); + else + iuPresentation.setName(name); + + if (name != null && name.startsWith("%")) + name = null; + + if (InstallableUnitUtils.getType(iu) == InstallableUnitType.CATEGORY || iu.getVersion() == null) + iuPresentation.setLabel(name != null && name.length() > 0 ? name : iu.getId()); + else + iuPresentation.setLabel(iu.getId() + " / " + IUUtils.stringifyVersion(iu.getVersion()) + + (name != null && name.length() > 0 ? " (" + name + ")" : "")); + iuPresentation.setDescription(RepositoryTranslationSupport + .getInstance((MetadataRepository) ((InstallableUnitImpl) iu).eContainer()) + .getIUProperty(iu, IInstallableUnit.PROP_DESCRIPTION)); + + Map versionMap = iuMap.get(iu.getId()); + if (versionMap == null) + iuMap.put(iu.getId(), versionMap = new HashMap()); + versionMap.put(iu.getVersion(), iuPresentation); + + allIUs.add(iuPresentation); + } + + if (categories.size() > 0) { + Collections.sort(categories, IUPresentation.COMPARATOR); + repoView.getInstallableUnitList().getNotNullCategoryContainer().getCategories().addAll(categories); + + addIUsToMap(repoView.getInstallableUnitList().getCategoryContainer(), categories); + } + if (features.size() > 0) { + Collections.sort(features, IUPresentation.COMPARATOR); + repoView.getInstallableUnitList().getNotNullFeatureContainer().getFeatures().addAll(features); + + addIUsToMap(repoView.getInstallableUnitList().getFeatureContainer(), features); + } + if (products.size() > 0) { + Collections.sort(products, IUPresentation.COMPARATOR); + repoView.getInstallableUnitList().getNotNullProductContainer().getProducts().addAll(products); + + addIUsToMap(repoView.getInstallableUnitList().getProductContainer(), products); + } + if (bundles.size() > 0) { + Collections.sort(bundles, IUPresentation.COMPARATOR); + repoView.getInstallableUnitList().getNotNullBundleContainer().getBundles().addAll(bundles); + + addIUsToMap(repoView.getInstallableUnitList().getBundleContainer(), bundles); + } + if (fragments.size() > 0) { + Collections.sort(fragments, IUPresentation.COMPARATOR); + repoView.getInstallableUnitList().getNotNullFragmentContainer().getFragments().addAll(fragments); + + addIUsToMap(repoView.getInstallableUnitList().getFragmentContainer(), fragments); + } + if (miscellaneous.size() > 0) { + Collections.sort(miscellaneous, IUPresentation.COMPARATOR); + repoView.getInstallableUnitList().getNotNullMiscellaneousContainer().getOthers().addAll(miscellaneous); + + addIUsToMap(repoView.getInstallableUnitList().getMiscellaneousContainer(), miscellaneous); + } + + Categories categoryContainer = repoView.getInstallableUnitList().getCategoryContainer(); + if (categoryContainer != null) + for (Category category : categoryContainer.getCategories()) { + Set visited = new HashSet(); + exploreCategory(category, iuMap, visited); + } + + List propList = new ArrayList(); + for (Map.Entry property : repository.getPropertyMap()) + propList.add(AggregatorFactory.eINSTANCE.createProperty(property.getKey(), property.getValue())); + if (propList.size() > 0) { + repoView.setProperties(P2viewFactory.eINSTANCE.createProperties()); + Collections.sort(propList); + repoView.getProperties().getPropertyList().addAll(propList); + } + + List references = repository.getReferences(); + if (references.size() > 0) { + RepositoryReferences repoRefs = P2viewFactory.eINSTANCE.createRepositoryReferences(); + repoView.setRepositoryReferences(repoRefs); + repoRefs.getRepositoryReferences().addAll(references); + } + + repoView.setLoaded(true); + + Aggregation aggregation = ResourceUtils.getAggregation(getResourceSet()); + if (aggregation != null) { + for (MetadataRepositoryReference mdrReference : aggregation.getAllMetadataRepositoryReferences(true)) { + String refLocation = mdrReference.getLocation(); + if (refLocation != null && refLocation.endsWith("/")) + refLocation = refLocation.substring(0, refLocation.length() - 1); + if (repository.getLocation().toString().equals(refLocation)) + // force notification by formal setting the value to current value + // once the adapter (if exists) receives the notification, it will take care of + // refreshing labels and content of itself and its parents + mdrReference.setLocation(mdrReference.getLocation()); + } + } + } + + protected Resource getResource() { + return resource; + } + + protected ResourceSet getResourceSet() { + Resource resource = getResource(); + return resource == null ? null : resource.getResourceSet(); + } + + protected void addIUsToMap(Object container, List iuPresentations) { + Object[] treePath = new Object[4]; + treePath[0] = getResource(); + treePath[1] = repoView; + treePath[2] = repoView.getInstallableUnitList(); + treePath[3] = container; + + for (IUPresentation iup : iuPresentations) + allIUMatrix.add(iup, treePath); + } + + protected void exploreCategory(Category category, Map> iuMap, + Set visited) { + visited.add(category); + + List categories = new ArrayList(); + List features = new ArrayList(); + List products = new ArrayList(); + List bundles = new ArrayList(); + List fragments = new ArrayList(); + + int idx = allIUMatrix.indexOf(category); + Object[] oldTreePath = allIUMatrix.getValue(idx); + int len = oldTreePath.length; + Object[] categoryTreePath = new Object[len + 1]; + System.arraycopy(oldTreePath, 0, categoryTreePath, 0, len); + categoryTreePath[len] = category; + + for (IRequirement requirement : category.getInstallableUnit().getRequirements()) { + for (IUPresentation iuPresentation : findMatchingIUs(requirement, iuMap)) { + if (visited.contains(iuPresentation)) + // there's a recursion + continue; + + allIUMatrix.add(++idx, iuPresentation, categoryTreePath); + if (iuPresentation instanceof Category) { + categories.add((Category) iuPresentation); + exploreCategory((Category) iuPresentation, iuMap, visited); + } else if (iuPresentation instanceof Feature) + features.add((Feature) iuPresentation); + else if (iuPresentation instanceof Product) + products.add((Product) iuPresentation); + else if (iuPresentation instanceof Fragment) + fragments.add((Fragment) iuPresentation); + else if (iuPresentation instanceof Bundle) + bundles.add((Bundle) iuPresentation); + } + } + + if (categories.size() > 0) { + Collections.sort(categories, IUPresentation.COMPARATOR); + category.getNotNullCategoryContainer().getCategories().addAll(categories); + } + if (features.size() > 0) { + Collections.sort(features, IUPresentation.COMPARATOR); + category.getNotNullFeatureContainer().getFeatures().addAll(features); + } + if (products.size() > 0) { + Collections.sort(products, IUPresentation.COMPARATOR); + category.getNotNullProductContainer().getProducts().addAll(products); + } + if (bundles.size() > 0) { + Collections.sort(bundles, IUPresentation.COMPARATOR); + category.getNotNullBundleContainer().getBundles().addAll(bundles); + } + if (fragments.size() > 0) { + Collections.sort(fragments, IUPresentation.COMPARATOR); + category.getNotNullFragmentContainer().getFragments().addAll(fragments); + } + } + + private List findMatchingIUs(IRequirement rq, Map> iuMap) { + List found = new ArrayList(); + if (rq instanceof IRequiredCapability) { + Map vps = iuMap.get(((IRequiredCapability) rq).getName()); + if (vps != null) + for (Map.Entry vp : vps.entrySet()) + if (vp.getValue().getInstallableUnit().satisfies(rq)) + found.add(vp.getValue()); + } + for (Map vps : iuMap.values()) + for (Map.Entry vp : vps.entrySet()) + if (vp.getValue().getInstallableUnit().satisfies(rq)) + found.add(vp.getValue()); + return found; + } + +} diff --git a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/util/ResourceUtils.java b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/util/ResourceUtils.java index d2d2b6837..395e0df1b 100644 --- a/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/util/ResourceUtils.java +++ b/org.eclipse.cbi.p2repo.aggregator/src/org/eclipse/cbi/p2repo/aggregator/util/ResourceUtils.java @@ -12,7 +12,6 @@ package org.eclipse.cbi.p2repo.aggregator.util; import java.io.IOException; -import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; @@ -33,6 +32,7 @@ import org.eclipse.cbi.p2repo.p2.MetadataRepository; import org.eclipse.cbi.p2repo.util.ExceptionUtils; import org.eclipse.core.runtime.CoreException; +import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.URI; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.resource.Resource; @@ -134,16 +134,19 @@ public static Aggregation getAggregation(ResourceSet resourceSet) { if(resourceSet == null) return null; - List resources = new ArrayList(resourceSet.getResources()); - Resource aggregatorResource = null; - for(Resource resource : resources) - if(resource instanceof AggregatorResourceImpl) { - aggregatorResource = resource; - break; + List resources = resourceSet.getResources(); + for (int i = 0, size = resources.size(); i < size; ++i) { + Resource resource = resources.get(i); + EList contents = resource.getContents(); + if (contents.size() == 1) { + EObject eObject = contents.get(0); + if (eObject instanceof Aggregation) { + return (Aggregation) eObject; + } } - return aggregatorResource == null - ? null - : (Aggregation) aggregatorResource.getContents().get(0); + } + + return null; } /** diff --git a/org.eclipse.cbi.p2repo.cli.product.feature/feature.properties b/org.eclipse.cbi.p2repo.cli.product.feature/feature.properties index c932bd234..757d6c29f 100644 --- a/org.eclipse.cbi.p2repo.cli.product.feature/feature.properties +++ b/org.eclipse.cbi.p2repo.cli.product.feature/feature.properties @@ -7,7 +7,7 @@ # # SPDX-License-Identifier: EPL-2.0 -featureName=Eclipse CBI Aggregator Product Feature +featureName=CBI Aggregator Product Feature # "description" property - description of the feature description=This feature includes all features needed for the CBI Aggregator product. diff --git a/org.eclipse.cbi.p2repo.cli.product.feature/feature.xml b/org.eclipse.cbi.p2repo.cli.product.feature/feature.xml index 1e6f426e0..61e41339c 100644 --- a/org.eclipse.cbi.p2repo.cli.product.feature/feature.xml +++ b/org.eclipse.cbi.p2repo.cli.product.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.cbi.p2repo.cli.product.feature/pom.xml b/org.eclipse.cbi.p2repo.cli.product.feature/pom.xml index 9f92c9d5b..4721d4c31 100644 --- a/org.eclipse.cbi.p2repo.cli.product.feature/pom.xml +++ b/org.eclipse.cbi.p2repo.cli.product.feature/pom.xml @@ -5,13 +5,13 @@ org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT org.eclipse.cbi.p2repo.cli.product.feature - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-feature - + org.eclipse.tycho @@ -33,20 +33,6 @@ - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attach-p2-metadata - package - - p2-metadata - - - - diff --git a/org.eclipse.cbi.p2repo.cli.product/cbi.p2repo.product b/org.eclipse.cbi.p2repo.cli.product/cbi.p2repo.product index 2ea507aa2..7fef16bf9 100644 --- a/org.eclipse.cbi.p2repo.cli.product/cbi.p2repo.product +++ b/org.eclipse.cbi.p2repo.cli.product/cbi.p2repo.product @@ -1,7 +1,7 @@ - + diff --git a/org.eclipse.cbi.p2repo.cli.product/pom.xml b/org.eclipse.cbi.p2repo.cli.product/pom.xml index bda670ae3..80a53803c 100644 --- a/org.eclipse.cbi.p2repo.cli.product/pom.xml +++ b/org.eclipse.cbi.p2repo.cli.product/pom.xml @@ -6,30 +6,21 @@ eclipse-repository org.eclipse.cbi org.eclipse.cbi.p2repo.cli.product - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT ../org.eclipse.cbi.p2repo.releng.parent - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - '${buildId}' - - org.eclipse.tycho target-platform-configuration - false @@ -44,35 +35,9 @@ - - - macosx - cocoa - x86_64 - - - macosx - cocoa - aarch64 - - - win32 - win32 - x86_64 - - - linux - gtk - x86_64 - - - linux - gtk - aarch64 - - + org.eclipse.tycho tycho-p2-repository-plugin @@ -81,6 +46,7 @@ true + org.eclipse.tycho tycho-p2-director-plugin @@ -119,6 +85,7 @@ + org.apache.maven.plugins maven-resources-plugin diff --git a/org.eclipse.cbi.p2repo.cli/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.cli/META-INF/MANIFEST.MF index e4436921d..fe7e5718a 100644 --- a/org.eclipse.cbi.p2repo.cli/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.cli/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.cbi.p2repo.cli;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-Vendor: %providerName Require-Bundle: org.eclipse.core.runtime, diff --git a/org.eclipse.cbi.p2repo.cli/about.html b/org.eclipse.cbi.p2repo.cli/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.cli/about.html +++ b/org.eclipse.cbi.p2repo.cli/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.cli/pom.xml b/org.eclipse.cbi.p2repo.cli/pom.xml index fff3fe80c..3dc6d0b47 100644 --- a/org.eclipse.cbi.p2repo.cli/pom.xml +++ b/org.eclipse.cbi.p2repo.cli/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.cli - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.p2.edit/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.p2.edit/META-INF/MANIFEST.MF index f35195a1f..88515edc4 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.p2.edit/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cbi.p2repo.p2.edit;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.cbi.p2repo.p2.provider.P2EditPlugin$Implementation Bundle-Vendor: %providerName diff --git a/org.eclipse.cbi.p2repo.p2.edit/about.html b/org.eclipse.cbi.p2repo.p2.edit/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/about.html +++ b/org.eclipse.cbi.p2repo.p2.edit/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactDescriptor_processingStepList_ProcessingStepDescriptor.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactDescriptor_processingStepList_ProcessingStepDescriptor.gif deleted file mode 100644 index 3a9b7cdb673df58f83923d77af78d556f3efec02..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b=9#pHh6V=*hyVZM=f~Uszi$uZ zzSwi=X3wTGX)_NvH0+wL21HvYDX;62U)m%!uTpGgiSWO_?}6y==kq}H=lSB_cbkEx zL4e{<7Df3tK1kH}_2{@ihKy(sM0)lBSq?zf^Lj zbD+lTg4sA2Ytgb#~OwlghEaFf5$Qgb_3>-5X?e1@Ew Nrqsr!Y*j@DYXFjhVW9v3 diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactDescriptor_propertyMap_Property.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactDescriptor_propertyMap_Property.gif deleted file mode 100644 index 3da98f774369141f4654a5bcd2bbcdb33eadef6e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6G&Nld4nAgSxkg8)?f?Jy`SJGu@7p&t zG`!ez>1NNSGifsqI5g~M%l3&^+HLp@^W{L2>zwd$Q@8|PC^ym5F-*=mV zra^$>PZmZHO9w=N>||h#QBdehiL_H=n0fZ_lnYxY^*8rTD)BV_Y|?Wrdy=M@dcRb1 zrgNai?ByreMf$YnoI2@d#h{~h-`mAPAgE#Xi-Zr0PPQ{GOmLIG(Nc3eSL^i4^n8Y# Onx@porfgM325SJv8eo_J diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactRepository_artifactMap_ArtifactsByKey.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactRepository_artifactMap_ArtifactsByKey.gif deleted file mode 100644 index 1cbba050adaaae418e2150d3d843a673b21e2f0e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b|NQ$64Gj(s4*&nh&yTnNf8QR+ z1&Ys^Gv~kops>TP>1sfJIv@gMCj)DYfrlb&nYlQhND`=ydI zodY#yFF(O9(x)}&)JZoh1|7Bg-YymbK@GECBz#zOvYlyRf}8w}mYUnSTBl#8=QHHg OG^I8+WvePOSOWkKN@I5b diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactsByKey_value_ArtifactDescriptor.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactsByKey_value_ArtifactDescriptor.gif deleted file mode 100644 index a37ddd6bc24c1ef97f4ae9b6ae81e305202994f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6yx4Q;X3wTGX)_NvH2nV`KR@37|9$(0 zhK2(N4(y+QAINZUaM(3n4T!c*QeM|3zqCneUZvQ~65)S;-viO#&*y>Y&-2B!EQ}zQ4u}BR$-o+;pwO2RX{W|8^X%a%7q(97Z|<8^;%WTZq~}`pBuz2(eyQY4 z=Rl3w%TKV2^l8mGb<)j>K}YSrw~K{9P{ZsO2_F`nY-d`S;3j{grRH|7*6Ek&`3yNV NO{tAd*{X^R)&K)4ViN!W diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactsByKey_value_SimpleArtifactDescriptor.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateArtifactsByKey_value_SimpleArtifactDescriptor.gif deleted file mode 100644 index dd1f51dec738d168115748ace6cbf216ddec92f2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6Tx)7N7970B(y~oQ=l}os`SJGu@7p&t zG#of^VE_F4K!$^Z!>;LSK(uv|^13ehrA<=vD#d1&2><*09*F*aJ`Y5Ho-h7=w;5;} z1StMwVFa;sKm^E62G$q_g}#(XJ2i%xXAe)guys;@bKj&APvg%fJ=d})X^N@$OC@JI z2Wre-eu7=3PixMplWtZFI%@a5T`UBG8fL#p_^{|?JJZ4hH~AYaHMeuMPQOggXUM5( NN^NY)R#jxM1^^O6Uwr@o diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnitFragment_hostList_RequiredCapability.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnitFragment_hostList_RequiredCapability.gif deleted file mode 100644 index c44d6579328dd863af03e390a05e5dc3f2fdacaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 976 zcmZ?wbhEHb6krfw_|Cv^;OrBV#MQQ08$C*P=k@H#>)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH*fx*@iVG4F4|F|GUueA4sk<{kzVzH$iV!mf8RR{~1QXXb4a> z1QdU=FfuS$GU$Lz1?35Mj9QszQsCjy&N_}B&2EHna@*gB>%v2*NAU~pz*Q*_$n zaIwjidlDnljWZmJS2@n)D7>*E@$sqyLb7HhD`s9e*v!sXwBd!oBIfQ*d;&5B4oxop uEi4=&31OPi$TRf^3l5&rl0JrMo)AYJYW3#ZZps{ z2vGdV!U$sNfC!MC46HE<3VkV&c4`bW&mNv~Ve6#+=DtZKp2nX|dah+p(iBtgmrBlb z4%C>v`~*Pf diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnitFragment_host_Requirement.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnitFragment_host_Requirement.gif deleted file mode 100644 index 89c5f57f9447f2011a9d2ffef465047d22c07aad..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6{Qmmm&Cwh8=kLE%x$OV{`1$en|L@y3 zG&CGIaA3}yIR_3n0Ku;5YCyDglJdGP`K3)#^D4z=mI(j*`yPn?em)OGf1WS?eYY8C z8U!f*WMKrcbU*~iP6pN(1%MmLCOy}(CuxeQ_e&*b zItOaZUVegIq)%(ksgrJ23_5D}yf*NMONcgbmWINNs1ULB`Ej71uwNAfG&u7S~ OX-aKu%2rimum%7K%dGPg|6>q#}6kYzm~%Vt`k^VCA;X@xFR z3ti?``p&8JUD6aDVqx(A|9^&2Fd71M2?52QEQ|~ch739&+dz53ouiK-nM1~7!-50i z+!hCJFg#>z<(4q2iP*rva!^QuHLJt1VX>pI0&kZ{r=r`*Min-m0s{wzPC*qTjuQ?^ z30%w^dJ4mSU}RKfNjhNQaQLJEuTIH|0}Hg78F-9X m5)_o&x>TXKc6%bPP}&s2%7?1_p+Ph6WHd3PwYKdLf|r zlZ6pvnhuBntIMoXW{zYjmZ56sxP*yIn?32o0>|nURsf8UT!~qvHSo diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_metaRequiredCapabilityList_RequiredCapability.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_metaRequiredCapabilityList_RequiredCapability.gif deleted file mode 100644 index c44d6579328dd863af03e390a05e5dc3f2fdacaa..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 976 zcmZ?wbhEHb6krfw_|Cv^;OrBV#MQQ08$C*P=k@H#>)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH*fx*@iVG4F4|F|GUueA4sk<{kzVzH$iV!mf8RR{~1QXXb4a> z1QdU=FfuS$GU$Lz1?35Mj9QszQsCjy&N_}B&2EHna@*gB>%v2*NAU~pz*Q*_$n zaIwjidlDnljWZmJS2@n)D7>*E@$sqyLb7HhD`s9e*v!sXwBd!oBIfQ*d;&5B4oxop uEi4=&389XBIcluI^q`+q1Z~XHoN{ z73+4MY@52Ob;`=_S?iW;II!o~mF4iB|842(?891Ko&3<1Uq9oU5y hd1Vwh9$@Wc7iOEF_3%LGY!=QA+1;DpoNHjP1^^>8SUdm# diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_propertyMap_Property.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_propertyMap_Property.gif deleted file mode 100644 index 0a224de7a089e057006ef87d715b646b39214352..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 920 zcmZ?wbhEHb6krfw_|CwPT{X41X-;%bXL8Ae)Y1vr)l>89XBIcluI^q`+q1Z~XHoN{ z73+4MY@52Ob;`=_S?iW;II!o~mF4iB|842(?891Ko&3<1Uq9oU5y hd1Vwh9$@Wc7iOEF_3%LGY!=QA+1;DpoNHjP1^^>8SUdm# diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_providedCapabilities_ProvidedCapability.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstallableUnit_providedCapabilities_ProvidedCapability.gif deleted file mode 100644 index bc24e8ab317b27a5c6c3683cecadbd222d58ce18..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 962 zcmZ?wbhEHb6krfw_|Cv^;OrBV#MQQ08$C*P=k@H#>)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH*fx*@iVG4F4|F|GUueA4sk<{kzVzH$iV!mf3%7fMFDjh5!X2 zp!k!8k%7UUK?h_8C{MU^%x9?Qkn#Ay-Y0FrW))H4*xba;=hhLy=+w$3%v!JW=V20a zkBos?3Xj7=rv?c_qg5gmi=F#~%#Ex%3=TSW3K=>q5wTeCoRwL^$bdue5o?#2PE-%i zhD|FSC1ev+N}?7WZsSu;v8#CSfW4bf(Q1Rn4uOM=>?$4)R6H6S7#Ru}O>S&>$kNWI e86*&+aKMR)QQl@p!A2tn7EYhJTK@zE7_0%1)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH*fx*@iVG4F4|F|GUueA4sk<{kzVzH$iV!mf3%7fMFDjh5!X2 zp!k!8k%7UUK?h_8C{MU^%x9?Qkn#Ay-Y0FrW))H4*xba;=hhLy=+w$3%v!JW=V20a zkBos?3Xj7=rv?c_qg5gmi=F#~%#Ex%3=TSW3K=>q5wTeCoRwL^$bdue5o?#2PE-%i zhD|FSC1ev+N}?7WZsSu;v8#CSfW4bf(Q1Rn4uOM=>?$4)R6H6S7#Ru}O>S&>$kNWI e86*&+aKMR)QQl@p!A2tn7EYhJTK@zE7_0%1)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH*fx*@iVG4F4|F|GUueA4sk<{kzVzH$iV!mf8RR{~1QXXb4a> z1QdU=FfuS$GU$Lz1?35Mj9QszQsCjy&N_}B&2EHna@*gB>%v2*NAU~pz*Q*_$n zaIwjidlDnljWZmJS2@n)D7>*E@$sqyLb7HhD`s9e*v!sXwBd!oBIfQ*d;&5B4oxop uEi4=&3)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH*fx*@iVG4F4|F|GUueA4sk<{kzVzH$iV!mf8RR{~1QXXb4a> z1QdU=FfuS$GU$Lz1?35Mj9QszQsCjy&N_}B&2EHna@*gB>%v2*NAU~pz*Q*_$n zaIwjidlDnljWZmJS2@n)D7>*E@$sqyLb7HhD`s9e*v!sXwBd!oBIfQ*d;&5B4oxop uEi4=&3#kk9?rq3xI7cbtqbLaW<=ieSb{!biW7zLvtFo;7y@h1x-1A{z+4#R?LhC2`wC)Qc4{PjY%!dd@?R3CoV2%CB8kE#GB^ Ko9j3@7_0#@J932p diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstructionMap_value_TouchpointInstruction.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateInstructionMap_value_TouchpointInstruction.gif deleted file mode 100644 index b0acf0439ff5033de8f523e29389bf651e35c497..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 907 zcmZ?wbhEHb6krfw_|Cv!#mk#0E!`m_)1#^yV`1?^Qu3Ix@<~_M$vHWlot;l7P1?G3 z>#kk9?rq3xI7cbtqbLaW<=ieSb{!biW7zLvtFo;7y@h1x-1A{z+4#R?LhC2`wC)Qc4{PjY%!dd@?R3CoV2%CB8kE#GB^ Ko9j3@7_0#@J932p diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_installableUnits_InstallableUnit.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_installableUnits_InstallableUnit.gif deleted file mode 100644 index d192c7c6426df07c0b920858169819c6ca68fea9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 996 zcmZ?wbhEHb6krfw_|Cv^;OrBV#MQQ08$C*P=k@H#>)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&?f$esFIN11vEt9G_5VK}I@rgs zubbi0_OxHOYJT5s{{MRO|JPgoe}DM@=ktAC442jhyt&x@|LKzdUvF=%W7ty1u)c!f z(hB$gpRTScVR(G7_U^9QySr;|ZYn(7X?DEZd|!*n-e!}{1#17nfMFDjh5(@uQ2fcl z$iU#ipaW6}$`kG!2N@=E$T$^r9BAg4Xc1B2*xba;=Qm@4VbZZ4QIEDIH#CwL@+g}J zo%m3otT>55M2qFc#lueo_+-4Ud=Ols(4nlwC$ur~aa%Kou*`~pi^(qDjm(qc3>p-f znT1r!ww!2GZa>Mu=%Zv(wB)s*GKZsr%%g>C+WF;Atzsx-cJWhjiaSyI;Xz}wgoVQd zhDPTH{Bky8N)`_oSh*HC@ChjdFf=4H@S5c$Tx4wF7UvM>*f7DNp+mr`B*T`|(dpX7 K6~b&R4AuaHh2HJ} diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_installableUnits_InstallableUnitFragment.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_installableUnits_InstallableUnitFragment.gif deleted file mode 100644 index 1b68d379647598bb199c90406fe6a81af97b240d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 949 zcmZ?wbhEHb6krfw_|Cxa|NsBagaeaOjvbnHcT(!{HLdbTXKc6%bPP}&s2%7?1_p+Ph6WHd3PwYKdLf|r zlZ6pvnhuBntIMoXW{zYjmZ56sxP*yIn?32o0>|nURsf8UT!~qvHSo diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_installableUnits_InstallableUnitPatch.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_installableUnits_InstallableUnitPatch.gif deleted file mode 100644 index af3a295d908347198e73b116d7fab1e5e57d2c04..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z6Tx(i$EVyTlWpSHMy0-@_urqt>{8{f>1sf89XBIcluI^q`+q1Z~XHoN{ z73+4MY@52Ob;`=_S?iW;II!o~mF4iB|842(?891Ko&3<1Uq9oU5y hd1Vwh9$@Wc7iOEF_3%LGY!=QA+1;DpoNHjP1^^>8SUdm# diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_references_RepositoryReference.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_references_RepositoryReference.gif deleted file mode 100644 index ec1b197d6b33f4ec24af97df174d42c041e258eb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`^`{`~t54Gj(s4*&nh&yTnNf8QR+ z{qg(jjWMmLCOy}(CuxeQ_e&*b zItOaZUVegIq)%(ksgrJ23_5D}yf*NMONcgbmWINNs1ULB`Ej71uwNAfG&u7S~ OX-aKu%2rimum%7uL}U5@ diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_repositoryReferences_RepositoryReference.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateMetadataRepository_repositoryReferences_RepositoryReference.gif deleted file mode 100644 index 2360372e32a3aa3a797a9d797f2a4a61ce0c5fbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 962 zcmZ?wbhEHb6krfw_|Cxa^F!j#52=5C%=zOq_^@kI-zfbD?KCS!VgyZ{TP6rm+pV<&{Y@zM(MfQ)D zi5!|~dUT%kv4!@ZHp(BGYII<#$&uMskLC#P?bSat)%^ZU(H)K2yV`7awAyTIvE9{X zyS>F`TeI!fM%zOThKCvrpH{N%uQl3NWBjy|eM7F=<}~&H|Nk?Lg3%BlA_NqFvM@3* zxHIU0)PnMaJI8#6ehwLr4G9Nj6lFvV6c!%lR%GjcF=L{lLyM9-M~cag!)$B}JQiyd zl2jJ83CeS*thms4Y@#$Rp_j9fYvEJ7bSIK;JrPOK1OPi$TRf^3l5&rl0JrMo)AYJYW3#ZZps{ z2vGdV!U$sNfC!MC46HE<3VkV&c4`bW&mNv~Ve6#+=DtZKp2nX|dah+p(iBtgmrBlb z4%C>v`~JIv@gMCj)DYfrlb&nYlQhND`=ydI zodY#yFF(O9(x)}&)JZoh1|7Bg-YymbK@GECBz#zOvYlyRf}8w}mYUnSTBl#8=QHHg OG^I8+WvePOSOWkQQeFZ8 diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateSimpleArtifactRepository_rules_MappingRule.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateSimpleArtifactRepository_rules_MappingRule.gif deleted file mode 100644 index 222e7ae979180c18e8ff1db60b70a522aeb5be53..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 223 zcmZ?wbhEHb6krfwIKsg2|NsB{_xIb|$1^Z695`@b&YU?84F?`9tp>its5na+V4 zvzMP>7wOZQbLym<6@!l2eQy^FfuM%jFA_d1I@!*&Fu_g!MoZ1@T&>eD)AJc}YMN3T Ko3d3E8LR=7GGHA5 diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateTouchpointData_instructionMap_InstructionMap.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ctool16/CreateTouchpointData_instructionMap_InstructionMap.gif deleted file mode 100644 index 0a224de7a089e057006ef87d715b646b39214352..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 920 zcmZ?wbhEHb6krfw_|CwPT{X41X-;%bXL8Ae)Y1vr)l>89XBIcluI^q`+q1Z~XHoN{ z73+4MY@52Ob;`=_S?iW;II!o~mF4iB|842(?891Ko&3<1Uq9oU5y hd1Vwh9$@Wc7iOEF_3%LGY!=QA+1;DpoNHjP1^^>8SUdm# diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/obj16/InstallableUnitPatch.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/obj16/InstallableUnitPatch.gif index 9250fecbffd185d174d53f6b7ea979f63ce222d2..57fc499b88f168cc8a6a76269c1b9e83fdef352c 100644 GIT binary patch literal 609 zcmZ?wbhEHb6krfwc*ekRCqChJeB!-~?0XqG4~xnk6qY}(YIs!D__VR}X;bI3_Wny6 z7MC?!UWao|LyKk*KaA*C&J2xJ_zy0`q*V0pezg_+PcGLemN&jCj+d5I@ z`^DJb_d9>z@A~~{%Kta({(ZZ1X?xnQTQ$G$HvfOS>;LzM|Gq!|_v88h-yhx_4Ey@> z%#Zgs|NnTtwT@v+9mDzxhD$5l|Gzu-|K0I5B@Fl1`F?$V`qC`d_xFw-ZnD^2ZMLt@ zd}oE}mQs^#<)({5q;B~6T?Zn6znfuU|G|KPszC843nK$VDuWKlR8X8Su}ZNl=}U>=^z;-LpUjaOYiZ*Z8Xm?rSxj^?dup83%9W0+LL!2~8(30f9JaY> zsxS-e5#Z-%N{w=L-JvDPFqxNcGGl6VQ1A{N)8xtAJd=}C-R^2?DySwVB_<{$JW0K; zX=tWoqU_=8<}RaRC`;*W%exp~Wj8;&g=l6)M=H4_XUAL*A5Y_lo+{h>#dXouLTRg+UR|prgqh= Vyl15*zwUCzPPZcyg@hRytO0}LFBSj* diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/obj16/ProvidedCapability.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/obj16/ProvidedCapability.gif index 30f0c48da8d4450f7e94a696c4de0a7cc41aa728..c68c40fb29a3f441e3f1437796d06beeb3de8d13 100644 GIT binary patch literal 369 zcmZ?wbhEHb6krfwSZc{|;OrBV#MQQ08$C*P=k@H#>)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH*fx*@iVG4F4|F|GUueA4sk<{kzVzH$iV!mf3%7K=GfTb5Uwy zNotBhd1gt5g1e`00E6OB7DfgJdj=f_AOLxkfvxhu`~r_Z5A${`y2O#KHvRBzAGh6( z?H18zzv)=XL_E3lv7%wUlY7b|jj8M6j~sMV+SwU@+;#B|3pXWg1uZQ#dlnW}hHeI4 zX=!yCSxrrQ=IP>W5|TWMiuxM5I=U|0Ok$i&@^X550gNJ|jE068i~>T88P1HmcJFs& Gum%7R$F^Aj literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgte-L}loH;~uRaQAn7P!5RR`@-PYj diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/obj16/RequiredCapability.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/obj16/RequiredCapability.gif index f8041d22553d3f326e3e82be501f2e9bac3794b0..c54f2b359c876b1e7ec10c25eb15d74cb8108b9d 100644 GIT binary patch literal 349 zcmZ?wbhEHb6krfwxXQqA;OrBV#MQQ08$C*P=k@H#>)BmCdH>AyS7xlgyky6X6}xX* z1EorLhcq0C?KoXG=T!URa~(_0bu2#Hx#aBBb(g2Ey|iTKjpe&klGTH*fx*@iVG4F4|F|GUueA4sk<{kzVzH$iV!mf8RR{~0iV;!hSv z1_nz89gqyjPYi5T2V(fj4|DdPQ06;kqBeQ^%$~ApwZd()&Sr*+74x~9zpSu1lDtsa zsBntcV}nNz6eiv~vElKez!({2C2a*QEj3FP7FLEH23~1tbs1SrO-tq(;%pL6uJr^TE4Ew{ zsne$TlZBCifs;W8q!VNY1B;%)Nzc`LEna{5ro#WQ&~>{h>#dXouLTRg+UR|prgqh= Vyl15*zwUCzPPZcyg@hRytO0^gFBSj* diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/obj16/RequiredPropertiesMatch.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/obj16/RequiredPropertiesMatch.gif new file mode 100644 index 0000000000000000000000000000000000000000..df696f4fcbe5b70fa6fb021037cd7832140131df GIT binary patch literal 223 zcmV<503iQINk%w1VGsZi0E8X@M`@3ZU@lv1iJEFQV|0*Zb&zX%m1}#IZ-1F{f}C@M zn|q6*eT<@gjH82+sD+fNhLx&|ny!$buz{n=q_DuQxyk*mHU6$Ox5Ci8#?=1MfBw*b z|ImN`=CJ?&|NsC0A^8LW3IHDfEC2ui01yBW000GC;P(x|AfD(sbgY@C!KQJ+n-11x zxwcyNz~Bk+5eNu~h2uj+0VW>_g;L2ZCru{w6Y*d?o`?vmJv}gJ4CF+9iWpvSW1Mv- Z(ip{u?EDzw9tTW41%-w}h>0H|06SEsXqNy0 literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ovr16/excluded.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ovr16/excluded.gif new file mode 100644 index 0000000000000000000000000000000000000000..998d595d8889dd3606abde799c6e70a126e62300 GIT binary patch literal 57 zcmZ?wbhEHbWMkl9SjfyEZWOEJobH=Y{r~@e#h)yUFPNDbbQpjDB+tOa)gr67`!WCG JIa?SQtO2R<4&nd+ literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ovr16/greedy.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ovr16/greedy.gif new file mode 100644 index 0000000000000000000000000000000000000000..0eef3817f404b2dd25c6fdde09e90564a3190a3d GIT binary patch literal 1600 zcmZ?wbhEHbWMkl9_|D8AZWOEJobH=Y{r~^}fB*h5jDpb+7)c?Z_>+b41v4{)4#?A> zJkdUyBSupEkNOoo1UO_F*m*b<92Ph*u<|OISR^bw#K5D>$8tb`;V2^`BZD;nS6UpH literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.p2.edit/icons/full/ovr16/optional.gif b/org.eclipse.cbi.p2repo.p2.edit/icons/full/ovr16/optional.gif new file mode 100644 index 0000000000000000000000000000000000000000..b58e78983214c3f3429b449e3f01b01ef129ed6d GIT binary patch literal 78 zcmZ?wbhEHbWMkl9IK;{zZWL?jm*bmIt>m13=;X!!FrfI8g^`Paok52I2taBXn1w5t Y6{OTn#BT3QzQg?GpTvhicP0jF04c5-sQ>@~ literal 0 HcmV?d00001 diff --git a/org.eclipse.cbi.p2repo.p2.edit/plugin.properties b/org.eclipse.cbi.p2repo.p2.edit/plugin.properties index 4ab3a5100..9986d1523 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/plugin.properties +++ b/org.eclipse.cbi.p2repo.p2.edit/plugin.properties @@ -7,7 +7,7 @@ # # SPDX-License-Identifier: EPL-2.0 -pluginName = CBI Repository Model Of p2 - Edit Support +pluginName = CBI p2 Repository Model Edit Support providerName = Eclipse CBI _UI_CreateChild_text = {0} @@ -19,6 +19,10 @@ _UI_CreateSibling_description = Create a new sibling of type {0} for the selecte _UI_PropertyDescriptor_description = The {0} of the {1} +# Improve performance for org.eclipse.emf.edit.provider.ItemPropertyDescriptor.ItemDelegator.convert(EDataType, Object) +_UI_Boolean_true_literal = true +_UI_Boolean_false_literal = false + _UI_IArtifactKey_type = IArtifact Key _UI_ICopyright_type = ICopyright _UI_IInstallableUnit_type = IInstallable Unit @@ -40,6 +44,9 @@ _UI_InstallableUnitFragment_type = Installable Unit Fragment _UI_License_type = License _UI_ProvidedCapability_type = Provided Capability _UI_RequiredCapability_type = Required Capability +_UI_RequiredPropertiesMatch_type = Required Properties Match +_UI_RequiredPropertiesMatch_namespace_feature = Namespace +_UI_RequiredPropertiesMatch_propertiesMatch_feature = Properties Match _UI_Requirement_type = Requirement _UI_TouchpointData_type = Touchpoint Data _UI_TouchpointInstruction_type = Touchpoint Instruction @@ -163,4 +170,4 @@ _UI_InstallableUnitFragment_host_feature = Host _UI_IRepositoryReference_location_feature = Location _UI_IRepositoryReference_type_feature = Type _UI_IRepositoryReference_options_feature = Options -_UI_IRepositoryReference_nickname_feature = Nickname +_UI_IRepositoryReference_nickname_feature = Nickname \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.p2.edit/pom.xml b/org.eclipse.cbi.p2repo.p2.edit/pom.xml index e48fd21a6..f3df2cca3 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/pom.xml +++ b/org.eclipse.cbi.p2repo.p2.edit/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.p2.edit - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactDescriptorItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactDescriptorItemProvider.java index 794bdcc2d..4dac7030f 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactDescriptorItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactDescriptorItemProvider.java @@ -123,6 +123,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/ArtifactDescriptor")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactKeyItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactKeyItemProvider.java index 0f9456c82..114bf9b04 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactKeyItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactKeyItemProvider.java @@ -118,6 +118,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/ArtifactKey")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactRepositoryItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactRepositoryItemProvider.java index a544dd25f..e27c3d09d 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactRepositoryItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactRepositoryItemProvider.java @@ -95,6 +95,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/ArtifactRepository")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactsByKeyItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactsByKeyItemProvider.java index f5bc53ba8..d92beef0b 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactsByKeyItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ArtifactsByKeyItemProvider.java @@ -110,6 +110,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/ArtifactsByKey")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/CopyrightItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/CopyrightItemProvider.java index 20a852d3c..25164d634 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/CopyrightItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/CopyrightItemProvider.java @@ -103,6 +103,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Copyright")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitFragmentItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitFragmentItemProvider.java index eded2e574..5a5497eff 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitFragmentItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitFragmentItemProvider.java @@ -55,6 +55,9 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors newChildDescriptors.add(createChildParameter(P2Package.Literals.INSTALLABLE_UNIT_FRAGMENT__HOST, P2Factory.eINSTANCE.createRequiredCapability())); + + newChildDescriptors.add(createChildParameter(P2Package.Literals.INSTALLABLE_UNIT_FRAGMENT__HOST, + P2Factory.eINSTANCE.createRequiredPropertiesMatch())); } /** @@ -120,6 +123,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/InstallableUnitFragment")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitItemProvider.java index 3f0cabdfd..fd06d9fc5 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitItemProvider.java @@ -166,6 +166,9 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT__META_REQUIREMENTS, P2Factory.eINSTANCE.createRequiredCapability())); + newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT__META_REQUIREMENTS, + P2Factory.eINSTANCE.createRequiredPropertiesMatch())); + newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT__PROVIDED_CAPABILITIES, P2Factory.eINSTANCE.createProvidedCapability())); @@ -175,6 +178,9 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT__REQUIREMENTS, P2Factory.eINSTANCE.createRequiredCapability())); + newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT__REQUIREMENTS, + P2Factory.eINSTANCE.createRequiredPropertiesMatch())); + newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT__TOUCHPOINT_DATA, P2Factory.eINSTANCE.createTouchpointData())); @@ -261,6 +267,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/InstallableUnit")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitPatchItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitPatchItemProvider.java index 788cdec31..8c8b227cb 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitPatchItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstallableUnitPatchItemProvider.java @@ -59,11 +59,17 @@ protected void collectNewChildDescriptors(Collection newChildDescriptors newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT_PATCH__LIFE_CYCLE, P2Factory.eINSTANCE.createRequiredCapability())); + newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT_PATCH__LIFE_CYCLE, + P2Factory.eINSTANCE.createRequiredPropertiesMatch())); + newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT_PATCH__APPLIES_TO, P2Factory.eINSTANCE.createRequirement())); newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT_PATCH__APPLIES_TO, P2Factory.eINSTANCE.createRequiredCapability())); + + newChildDescriptors.add(createChildParameter(P2Package.Literals.IINSTALLABLE_UNIT_PATCH__APPLIES_TO, + P2Factory.eINSTANCE.createRequiredPropertiesMatch())); } /** @@ -132,6 +138,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/InstallableUnitPatch")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstructionMapItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstructionMapItemProvider.java index e9304f9f5..807822942 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstructionMapItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/InstructionMapItemProvider.java @@ -121,6 +121,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/InstructionMap")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/LicenseItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/LicenseItemProvider.java index 3a846453a..5d1a96663 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/LicenseItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/LicenseItemProvider.java @@ -119,6 +119,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/License")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/MappingRuleItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/MappingRuleItemProvider.java index 8b3168801..c2ed5a1de 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/MappingRuleItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/MappingRuleItemProvider.java @@ -102,6 +102,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/MappingRule")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/MetadataRepositoryItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/MetadataRepositoryItemProvider.java index 468bcaf0f..4c425a97a 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/MetadataRepositoryItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/MetadataRepositoryItemProvider.java @@ -105,6 +105,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/MetadataRepository")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/P2ItemProviderAdapterFactory.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/P2ItemProviderAdapterFactory.java index 08ac70192..9e838348d 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/P2ItemProviderAdapterFactory.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/P2ItemProviderAdapterFactory.java @@ -587,6 +587,31 @@ public Adapter createRequirementAdapter() { return requirementItemProvider; } + /** + * This keeps track of the one adapter used for all {@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch} instances. + * + * + * @since 1.1 + * @generated + */ + protected RequiredPropertiesMatchItemProvider requiredPropertiesMatchItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch}. + * + * + * @since 1.1 + * @generated + */ + @Override + public Adapter createRequiredPropertiesMatchAdapter() { + if (requiredPropertiesMatchItemProvider == null) { + requiredPropertiesMatchItemProvider = new RequiredPropertiesMatchItemProvider(this); + } + + return requiredPropertiesMatchItemProvider; + } + /** * This creates an adapter for a {@link org.eclipse.cbi.p2repo.p2.RequirementChange}. * @@ -736,6 +761,8 @@ public void dispose() { requiredCapabilityItemProvider.dispose(); if (requirementItemProvider != null) requirementItemProvider.dispose(); + if (requiredPropertiesMatchItemProvider != null) + requiredPropertiesMatchItemProvider.dispose(); if (requirementChangeItemProvider != null) requirementChangeItemProvider.dispose(); if (simpleArtifactRepositoryItemProvider != null) diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ProcessingStepDescriptorItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ProcessingStepDescriptorItemProvider.java index 26e4fda02..533f67168 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ProcessingStepDescriptorItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ProcessingStepDescriptorItemProvider.java @@ -118,6 +118,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/ProcessingStepDescriptor")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/PropertyItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/PropertyItemProvider.java index 2c41baed6..232ebe201 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/PropertyItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/PropertyItemProvider.java @@ -102,6 +102,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Property")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ProvidedCapabilityItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ProvidedCapabilityItemProvider.java index 549e53d67..d0c123bba 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ProvidedCapabilityItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/ProvidedCapabilityItemProvider.java @@ -118,6 +118,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/ProvidedCapability")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RepositoryItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RepositoryItemProvider.java index b6a2b8f7c..dc374881a 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RepositoryItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RepositoryItemProvider.java @@ -205,6 +205,16 @@ protected EStructuralFeature getChildFeature(Object object, Object child) { return super.getChildFeature(object, child); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RepositoryReferenceItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RepositoryReferenceItemProvider.java index 4c9584874..8063521c1 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RepositoryReferenceItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RepositoryReferenceItemProvider.java @@ -136,6 +136,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/RepositoryReference")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequiredCapabilityItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequiredCapabilityItemProvider.java index 5657f0bdf..5ffd5cf95 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequiredCapabilityItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequiredCapabilityItemProvider.java @@ -110,6 +110,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/RequiredCapability")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * @@ -132,13 +142,12 @@ public List getPropertyDescriptors(Object object) { * This returns the label text for the adapted class. * * - * @generated + * @generated NOT */ @Override public String getText(Object object) { - String label = ((RequiredCapability) object).getName(); - return label == null || label.length() == 0 ? getString("_UI_RequiredCapability_type") - : getString("_UI_RequiredCapability_type") + " " + label; + RequiredCapability requiredCapability = (RequiredCapability) object; + return requiredCapability.toString(); } /** diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequiredPropertiesMatchItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequiredPropertiesMatchItemProvider.java new file mode 100644 index 000000000..7b6b5fbcf --- /dev/null +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequiredPropertiesMatchItemProvider.java @@ -0,0 +1,158 @@ +/** + * Copyright (c) 2006-2016, Cloudsmith Inc. and others + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + */ +package org.eclipse.cbi.p2repo.p2.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.cbi.p2repo.p2.P2Package; +import org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch; +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch} object. + * + * + * @since 1.1 + * @generated + */ +public class RequiredPropertiesMatchItemProvider extends RequirementItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public RequiredPropertiesMatchItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addNamespacePropertyDescriptor(object); + addPropertiesMatchPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Namespace feature. + * + * + * @generated + */ + protected void addNamespacePropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_RequiredPropertiesMatch_namespace_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_RequiredPropertiesMatch_namespace_feature", + "_UI_RequiredPropertiesMatch_type"), + P2Package.Literals.REQUIRED_PROPERTIES_MATCH__NAMESPACE, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Properties Match feature. + * + * + * @generated + */ + protected void addPropertiesMatchPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_RequiredPropertiesMatch_propertiesMatch_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_RequiredPropertiesMatch_propertiesMatch_feature", + "_UI_RequiredPropertiesMatch_type"), + P2Package.Literals.REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This returns RequiredPropertiesMatch.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/RequiredPropertiesMatch")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated NOT + */ + @Override + public String getText(Object object) { + RequiredPropertiesMatch requiredPropertiesMatch = (RequiredPropertiesMatch) object; + return requiredPropertiesMatch.toString(); + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(RequiredPropertiesMatch.class)) { + case P2Package.REQUIRED_PROPERTIES_MATCH__NAMESPACE: + case P2Package.REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + +} diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequirementChangeItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequirementChangeItemProvider.java index 8a3226fe4..823953a05 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequirementChangeItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequirementChangeItemProvider.java @@ -128,6 +128,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/RequirementChange")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequirementItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequirementItemProvider.java index 06ad184ad..e67668383 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequirementItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/RequirementItemProvider.java @@ -10,6 +10,8 @@ */ package org.eclipse.cbi.p2repo.p2.provider; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.List; @@ -20,6 +22,7 @@ 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.ComposedImage; import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; import org.eclipse.emf.edit.provider.IItemLabelProvider; import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; @@ -169,6 +172,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/Requirement")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * @@ -208,7 +221,8 @@ public ResourceLocator getResourceLocator() { */ @Override public String getText(Object object) { - IMatchExpression labelValue = ((Requirement) object).getFilter(); + Requirement requirement = (Requirement) object; + IMatchExpression labelValue = requirement.getFilter(); String label = labelValue == null ? null : P2Utils.filterToString(labelValue); return label == null || label.length() == 0 ? getString("_UI_Requirement_type") : getString("_UI_Requirement_type") + " " + label; @@ -238,4 +252,42 @@ public void notifyChanged(Notification notification) { super.notifyChanged(notification); } + @Override + protected Object overlayImage(Object object, Object image) { + Requirement requirement = (Requirement) object; + return getImage(super.overlayImage(object, image), requirement.getMin(), requirement.getMax(), + requirement.isGreedy()); + } + + public static Object getImage(Object baseImage, int min, int max, boolean greedy) { + if (max == 0) { + List images = new ArrayList(2); + images.add(baseImage); + images.add(P2EditPlugin.INSTANCE.getImage("full/ovr16/excluded")); + return new DecoratedImage(images); + } + + if (min == 0) { + List images = new ArrayList(2); + images.add(baseImage); + images.add(P2EditPlugin.INSTANCE.getImage(greedy ? "full/ovr16/greedy" : "full/ovr16/optional")); //$NON-NLS-1$ //$NON-NLS-2$ + return new DecoratedImage(images); + } + + return baseImage; + } + + private static final class DecoratedImage extends ComposedImage { + private DecoratedImage(Collection images) { + super(images); + } + + @Override + public List getDrawPoints(Size size) { + Point point = new Point(); + point.x = size.width - 5; + return Arrays.asList(new Point[] { new Point(), point }); + } + } + } diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/SimpleArtifactDescriptorItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/SimpleArtifactDescriptorItemProvider.java index 966b97ff5..b1b910b4e 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/SimpleArtifactDescriptorItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/SimpleArtifactDescriptorItemProvider.java @@ -117,6 +117,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/SimpleArtifactDescriptor")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/SimpleArtifactRepositoryItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/SimpleArtifactRepositoryItemProvider.java index cb8c797fb..a363695a0 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/SimpleArtifactRepositoryItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/SimpleArtifactRepositoryItemProvider.java @@ -95,6 +95,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/SimpleArtifactRepository")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointDataItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointDataItemProvider.java index c7112ad33..0974dbddb 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointDataItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointDataItemProvider.java @@ -119,6 +119,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/TouchpointData")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointInstructionItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointInstructionItemProvider.java index 0a2a340ff..4e3eeaeac 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointInstructionItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointInstructionItemProvider.java @@ -102,6 +102,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/TouchpointInstruction")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointTypeItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointTypeItemProvider.java index 7b50cda04..3012caeed 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointTypeItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/TouchpointTypeItemProvider.java @@ -102,6 +102,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/TouchpointType")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/UpdateDescriptorItemProvider.java b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/UpdateDescriptorItemProvider.java index a81563c66..070a35016 100644 --- a/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/UpdateDescriptorItemProvider.java +++ b/org.eclipse.cbi.p2repo.p2.edit/src/org/eclipse/cbi/p2repo/p2/provider/UpdateDescriptorItemProvider.java @@ -118,6 +118,16 @@ public Object getImage(Object object) { return overlayImage(object, getResourceLocator().getImage("full/obj16/UpdateDescriptor")); } + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + /** * This returns the property descriptors for the adapted class. * diff --git a/org.eclipse.cbi.p2repo.p2.maven.indexer.feature/feature.xml b/org.eclipse.cbi.p2repo.p2.maven.indexer.feature/feature.xml index 6c2c6ac20..bae036bf3 100644 --- a/org.eclipse.cbi.p2repo.p2.maven.indexer.feature/feature.xml +++ b/org.eclipse.cbi.p2repo.p2.maven.indexer.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.cbi.p2repo.p2.maven.indexer.feature/pom.xml b/org.eclipse.cbi.p2repo.p2.maven.indexer.feature/pom.xml index 986c538de..ccbd33554 100644 --- a/org.eclipse.cbi.p2repo.p2.maven.indexer.feature/pom.xml +++ b/org.eclipse.cbi.p2repo.p2.maven.indexer.feature/pom.xml @@ -5,14 +5,13 @@ org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT org.eclipse.cbi.p2repo.p2.maven.indexer.feature - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-feature - - + org.eclipse.tycho @@ -39,20 +38,6 @@ - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attach-p2-metadata - package - - p2-metadata - - - - diff --git a/org.eclipse.cbi.p2repo.p2.maven.indexer/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.p2.maven.indexer/META-INF/MANIFEST.MF index 7791986dc..fad5ba1a0 100644 --- a/org.eclipse.cbi.p2repo.p2.maven.indexer/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.p2.maven.indexer/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.cbi.p2repo.p2.maven.indexer;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.cbi.p2repo.p2.maven, org.eclipse.core.runtime, diff --git a/org.eclipse.cbi.p2repo.p2.maven.indexer/about.html b/org.eclipse.cbi.p2repo.p2.maven.indexer/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.p2.maven.indexer/about.html +++ b/org.eclipse.cbi.p2repo.p2.maven.indexer/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.p2.maven.indexer/plugin.properties b/org.eclipse.cbi.p2repo.p2.maven.indexer/plugin.properties index c8706c263..5dcad7c2e 100644 --- a/org.eclipse.cbi.p2repo.p2.maven.indexer/plugin.properties +++ b/org.eclipse.cbi.p2repo.p2.maven.indexer/plugin.properties @@ -7,5 +7,5 @@ # # SPDX-License-Identifier: EPL-2.0 -pluginName = CBI and p2 - Nexus Indexer support +pluginName = CBI Nexus Indexer support providerName = Eclipse CBI diff --git a/org.eclipse.cbi.p2repo.p2.maven.indexer/pom.xml b/org.eclipse.cbi.p2repo.p2.maven.indexer/pom.xml index 60144d522..6ba8efee2 100644 --- a/org.eclipse.cbi.p2repo.p2.maven.indexer/pom.xml +++ b/org.eclipse.cbi.p2repo.p2.maven.indexer/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.p2.maven.indexer - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.p2.maven/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.p2.maven/META-INF/MANIFEST.MF index ab2b9864e..27c355841 100644 --- a/org.eclipse.cbi.p2repo.p2.maven/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.p2.maven/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cbi.p2repo.p2.maven;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/org.eclipse.cbi.p2repo.p2.maven/about.html b/org.eclipse.cbi.p2repo.p2.maven/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.p2.maven/about.html +++ b/org.eclipse.cbi.p2repo.p2.maven/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.p2.maven/pom.xml b/org.eclipse.cbi.p2repo.p2.maven/pom.xml index 25795f3dd..d7507cd11 100644 --- a/org.eclipse.cbi.p2repo.p2.maven/pom.xml +++ b/org.eclipse.cbi.p2repo.p2.maven/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.p2.maven - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.p2.tests/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.p2.tests/META-INF/MANIFEST.MF index 259f7ba6d..92b072060 100644 --- a/org.eclipse.cbi.p2repo.p2.tests/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.p2.tests/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.cbi.p2repo.p2.tests;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-RequiredExecutionEnvironment: JavaSE-11 diff --git a/org.eclipse.cbi.p2repo.p2.tests/about.html b/org.eclipse.cbi.p2repo.p2.tests/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.p2.tests/about.html +++ b/org.eclipse.cbi.p2repo.p2.tests/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.p2.tests/pom.xml b/org.eclipse.cbi.p2repo.p2.tests/pom.xml index 7162f071f..41600582e 100644 --- a/org.eclipse.cbi.p2repo.p2.tests/pom.xml +++ b/org.eclipse.cbi.p2repo.p2.tests/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.p2.tests - 1.0.400-SNAPSHOT - eclipse-plugin + 1.1.0-SNAPSHOT + eclipse-test-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.p2/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.p2/META-INF/MANIFEST.MF index 65d1a6602..3ecfb94e4 100644 --- a/org.eclipse.cbi.p2repo.p2/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.p2/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.cbi.p2repo.p2;singleton:=true -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-ClassPath: . Bundle-Vendor: %providerName Bundle-Localization: plugin diff --git a/org.eclipse.cbi.p2repo.p2/about.html b/org.eclipse.cbi.p2repo.p2/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.p2/about.html +++ b/org.eclipse.cbi.p2repo.p2/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.p2/model/p2.ecore b/org.eclipse.cbi.p2repo.p2/model/p2.ecore index 590b92c35..4af7438fd 100644 --- a/org.eclipse.cbi.p2repo.p2/model/p2.ecore +++ b/org.eclipse.cbi.p2repo.p2/model/p2.ecore @@ -205,11 +205,8 @@ eType="#//IArtifactKey" containment="true"/> - - - - - + - - - - - + @@ -495,6 +488,13 @@ + + +
+ + + + + + +
+ + + + +
+ + diff --git a/org.eclipse.cbi.p2repo.p2/model/p2.genmodel b/org.eclipse.cbi.p2repo.p2/model/p2.genmodel index 0c68dc604..b31e99cad 100644 --- a/org.eclipse.cbi.p2repo.p2/model/p2.genmodel +++ b/org.eclipse.cbi.p2repo.p2/model/p2.genmodel @@ -1,8 +1,9 @@ @@ -14,9 +15,11 @@ + + @@ -441,6 +444,10 @@ + + + + diff --git a/org.eclipse.cbi.p2repo.p2/plugin.properties b/org.eclipse.cbi.p2repo.p2/plugin.properties index eba82b80b..a6b1310fa 100644 --- a/org.eclipse.cbi.p2repo.p2/plugin.properties +++ b/org.eclipse.cbi.p2repo.p2/plugin.properties @@ -7,7 +7,7 @@ # # SPDX-License-Identifier: EPL-2.0 -pluginName = CBI Repository Model Of p2 +pluginName = CBI p2 Repository Model providerName = Eclipse CBI extension-point.name = Repository Loader diff --git a/org.eclipse.cbi.p2repo.p2/pom.xml b/org.eclipse.cbi.p2repo.p2/pom.xml index c331005c2..e07c61e3a 100644 --- a/org.eclipse.cbi.p2repo.p2/pom.xml +++ b/org.eclipse.cbi.p2repo.p2/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.p2 - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/P2Factory.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/P2Factory.java index b04fc01cb..010dfbf2f 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/P2Factory.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/P2Factory.java @@ -171,6 +171,16 @@ public interface P2Factory extends EFactory { */ Requirement createRequirement(); + /** + * Returns a new object of class 'Required Properties Match'. + * + * + * @return a new object of class 'Required Properties Match'. + * @since 1.1 + * @generated + */ + RequiredPropertiesMatch createRequiredPropertiesMatch(); + /** * Returns a new object of class 'Requirement Change'. * diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/P2Package.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/P2Package.java index 4b0b09df5..1e4ca2556 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/P2Package.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/P2Package.java @@ -841,6 +841,35 @@ interface Literals { */ EClass REQUIREMENT = eINSTANCE.getRequirement(); + /** + * The meta object literal for the '{@link org.eclipse.cbi.p2repo.p2.impl.RequiredPropertiesMatchImpl Required Properties Match}' class. + * + * + * @see org.eclipse.cbi.p2repo.p2.impl.RequiredPropertiesMatchImpl + * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getRequiredPropertiesMatch() + * @since 1.1 + * @generated + */ + EClass REQUIRED_PROPERTIES_MATCH = eINSTANCE.getRequiredPropertiesMatch(); + + /** + * The meta object literal for the 'Namespace' attribute feature. + * + * + * @since 1.1 + * @generated + */ + EAttribute REQUIRED_PROPERTIES_MATCH__NAMESPACE = eINSTANCE.getRequiredPropertiesMatch_Namespace(); + + /** + * The meta object literal for the 'Properties Match' attribute feature. + * + * + * @since 1.1 + * @generated + */ + EAttribute REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH = eINSTANCE.getRequiredPropertiesMatch_PropertiesMatch(); + /** * The meta object literal for the '{@link org.eclipse.cbi.p2repo.p2.impl.RequirementChangeImpl Requirement Change}' class. * @@ -1281,6 +1310,17 @@ interface Literals { */ EDataType IARTIFACT_REQUEST_ARRAY = eINSTANCE.getIArtifactRequestArray(); + /** + * The meta object literal for the 'IFilter Expression' data type. + * + * + * @see org.eclipse.equinox.p2.metadata.expression.IFilterExpression + * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIFilterExpression() + * @since 1.1 + * @generated + */ + EDataType IFILTER_EXPRESSION = eINSTANCE.getIFilterExpression(); + /** * The meta object literal for the 'ITouchpoint Data Array' data type. * @@ -1406,6 +1446,17 @@ interface Literals { */ EDataType FILE = eINSTANCE.getFile(); + /** + * The meta object literal for the 'Filter' data type. + * + * + * @see org.eclipse.equinox.p2.metadata.expression.IMatchExpression + * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getFilter() + * @since 1.1 + * @generated + */ + EDataType FILTER = eINSTANCE.getFilter(); + /** * The meta object literal for the 'IArtifact Descriptor Array' data type. * @@ -2073,7 +2124,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getRequirementChange() * @generated */ - int REQUIREMENT_CHANGE = 44; + int REQUIREMENT_CHANGE = 45; /** * The meta object id for the '{@link org.eclipse.cbi.p2repo.p2.impl.TouchpointDataImpl Touchpoint Data}' class. @@ -2083,7 +2134,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getTouchpointData() * @generated */ - int TOUCHPOINT_DATA = 47; + int TOUCHPOINT_DATA = 48; /** * The meta object id for the '{@link org.eclipse.cbi.p2repo.p2.impl.TouchpointInstructionImpl Touchpoint Instruction}' class. @@ -2093,7 +2144,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getTouchpointInstruction() * @generated */ - int TOUCHPOINT_INSTRUCTION = 48; + int TOUCHPOINT_INSTRUCTION = 49; /** * The meta object id for the '{@link org.eclipse.cbi.p2repo.p2.impl.TouchpointTypeImpl Touchpoint Type}' class. @@ -2103,7 +2154,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getTouchpointType() * @generated */ - int TOUCHPOINT_TYPE = 49; + int TOUCHPOINT_TYPE = 50; /** * The meta object id for the '{@link org.eclipse.cbi.p2repo.p2.impl.UpdateDescriptorImpl Update Descriptor}' class. @@ -2113,7 +2164,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getUpdateDescriptor() * @generated */ - int UPDATE_DESCRIPTOR = 50; + int UPDATE_DESCRIPTOR = 51; /** * The meta object id for the '{@link org.eclipse.cbi.p2repo.p2.impl.PropertyImpl Property}' class. @@ -4654,6 +4705,101 @@ interface Literals { */ int REQUIRED_CAPABILITY_FEATURE_COUNT = REQUIREMENT_FEATURE_COUNT + 3; + /** + * The meta object id for the '{@link org.eclipse.cbi.p2repo.p2.impl.RequiredPropertiesMatchImpl Required Properties Match}' class. + * + * + * @see org.eclipse.cbi.p2repo.p2.impl.RequiredPropertiesMatchImpl + * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getRequiredPropertiesMatch() + * @since 1.1 + * @generated + */ + int REQUIRED_PROPERTIES_MATCH = 44; + + /** + * The feature id for the 'Filter' attribute. + * + * + * @generated + * @ordered + */ + int REQUIRED_PROPERTIES_MATCH__FILTER = REQUIREMENT__FILTER; + + /** + * The feature id for the 'Max' attribute. + * + * + * @generated + * @ordered + */ + int REQUIRED_PROPERTIES_MATCH__MAX = REQUIREMENT__MAX; + + /** + * The feature id for the 'Min' attribute. + * + * + * @generated + * @ordered + */ + int REQUIRED_PROPERTIES_MATCH__MIN = REQUIREMENT__MIN; + + /** + * The feature id for the 'Matches' attribute. + * + * + * @generated + * @ordered + */ + int REQUIRED_PROPERTIES_MATCH__MATCHES = REQUIREMENT__MATCHES; + + /** + * The feature id for the 'Greedy' attribute. + * + * + * @generated + * @ordered + */ + int REQUIRED_PROPERTIES_MATCH__GREEDY = REQUIREMENT__GREEDY; + + /** + * The feature id for the 'Description' attribute. + * + * + * @generated + * @ordered + */ + int REQUIRED_PROPERTIES_MATCH__DESCRIPTION = REQUIREMENT__DESCRIPTION; + + /** + * The feature id for the 'Namespace' attribute. + * + * + * @since 1.1 + * @generated + * @ordered + */ + int REQUIRED_PROPERTIES_MATCH__NAMESPACE = REQUIREMENT_FEATURE_COUNT + 0; + + /** + * The feature id for the 'Properties Match' attribute. + * + * + * @since 1.1 + * @generated + * @ordered + */ + int REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH = REQUIREMENT_FEATURE_COUNT + 1; + + /** + * The number of structural features of the 'Required Properties Match' class. + * + * + * @since 1.1 + * @generated + * @ordered + */ + int REQUIRED_PROPERTIES_MATCH_FEATURE_COUNT = REQUIREMENT_FEATURE_COUNT + 2; + /** * The feature id for the 'Apply On' containment reference. * @@ -4689,7 +4835,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getSimpleArtifactRepository() * @generated */ - int SIMPLE_ARTIFACT_REPOSITORY = 45; + int SIMPLE_ARTIFACT_REPOSITORY = 46; /** * The feature id for the 'Location' attribute. @@ -4807,7 +4953,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getSimpleArtifactDescriptor() * @generated */ - int SIMPLE_ARTIFACT_DESCRIPTOR = 46; + int SIMPLE_ARTIFACT_DESCRIPTOR = 47; /** * The feature id for the 'Artifact Key' reference. @@ -4970,7 +5116,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getVersion() * @generated */ - int VERSION = 77; + int VERSION = 80; /** * The meta object id for the 'Version Range' data type. @@ -4980,7 +5126,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getVersionRange() * @generated */ - int VERSION_RANGE = 78; + int VERSION_RANGE = 81; /** * The meta object id for the 'IInstallable Unit Array' data type. @@ -4989,7 +5135,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIInstallableUnitArray() * @generated */ - int IINSTALLABLE_UNIT_ARRAY = 57; + int IINSTALLABLE_UNIT_ARRAY = 60; /** * The meta object id for the 'Collection' data type. @@ -4999,7 +5145,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getCollection() * @generated */ - int COLLECTION = 51; + int COLLECTION = 52; /** * The meta object id for the 'IProvided Capability Array' data type. @@ -5008,7 +5154,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIProvidedCapabilityArray() * @generated */ - int IPROVIDED_CAPABILITY_ARRAY = 63; + int IPROVIDED_CAPABILITY_ARRAY = 66; /** * The meta object id for the 'IInstallable Unit Fragment Array' data type. @@ -5017,7 +5163,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIInstallableUnitFragmentArray() * @generated */ - int IINSTALLABLE_UNIT_FRAGMENT_ARRAY = 58; + int IINSTALLABLE_UNIT_FRAGMENT_ARRAY = 61; /** * The meta object id for the 'IArtifact Key Array' data type. @@ -5026,7 +5172,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIArtifactKeyArray() * @generated */ - int IARTIFACT_KEY_ARRAY = 55; + int IARTIFACT_KEY_ARRAY = 57; /** * The meta object id for the 'IArtifact Request Array' data type. @@ -5035,7 +5181,18 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIArtifactRequestArray() * @generated */ - int IARTIFACT_REQUEST_ARRAY = 56; + int IARTIFACT_REQUEST_ARRAY = 58; + + /** + * The meta object id for the 'IFilter Expression' data type. + * + * + * @see org.eclipse.equinox.p2.metadata.expression.IFilterExpression + * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIFilterExpression() + * @since 1.1 + * @generated + */ + int IFILTER_EXPRESSION = 59; /** * The meta object id for the 'ITouchpoint Data Array' data type. @@ -5044,7 +5201,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getITouchpointDataArray() * @generated */ - int ITOUCHPOINT_DATA_ARRAY = 71; + int ITOUCHPOINT_DATA_ARRAY = 74; /** * The meta object id for the 'IRequirement Array Array' data type. @@ -5053,7 +5210,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIRequirementArrayArray() * @generated */ - int IREQUIREMENT_ARRAY_ARRAY = 65; + int IREQUIREMENT_ARRAY_ARRAY = 68; /** * The meta object id for the 'IPool' data type. @@ -5063,7 +5220,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIPool() * @generated */ - int IPOOL = 66; + int IPOOL = 69; /** * The meta object id for the 'IProcessing Descriptor Array' data type. @@ -5072,7 +5229,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIProcessingDescriptorArray() * @generated */ - int IPROCESSING_DESCRIPTOR_ARRAY = 67; + int IPROCESSING_DESCRIPTOR_ARRAY = 70; /** * The meta object id for the 'String Array' data type. @@ -5081,7 +5238,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getStringArray() * @generated */ - int STRING_ARRAY = 74; + int STRING_ARRAY = 77; /** * The meta object id for the 'Untyped Map' data type. @@ -5091,7 +5248,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getUntypedMap() * @generated */ - int UNTYPED_MAP = 75; + int UNTYPED_MAP = 78; /** * The meta object id for the 'Map' data type. @@ -5101,7 +5258,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getMap() * @generated */ - int MAP = 72; + int MAP = 75; /** * The meta object id for the 'Output Stream' data type. @@ -5111,7 +5268,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getOutputStream() * @generated */ - int OUTPUT_STREAM = 73; + int OUTPUT_STREAM = 76; /** * The meta object id for the 'ILicense Array' data type. @@ -5120,7 +5277,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getILicenseArray() * @generated */ - int ILICENSE_ARRAY = 59; + int ILICENSE_ARRAY = 62; /** * The meta object id for the 'IQuery Result' data type. @@ -5130,7 +5287,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIQueryResult() * @generated */ - int IQUERY_RESULT = 62; + int IQUERY_RESULT = 65; /** * The meta object id for the 'IQuery' data type. @@ -5140,7 +5297,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIQuery() * @generated */ - int IQUERY = 61; + int IQUERY = 64; /** * The meta object id for the 'Collector' data type. @@ -5150,7 +5307,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getCollector() * @generated */ - int COLLECTOR = 52; + int COLLECTOR = 53; /** * The meta object id for the 'File' data type. @@ -5160,7 +5317,18 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getFile() * @generated */ - int FILE = 53; + int FILE = 54; + + /** + * The meta object id for the 'Filter' data type. + * + * + * @see org.eclipse.equinox.p2.metadata.expression.IMatchExpression + * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getFilter() + * @since 1.1 + * @generated + */ + int FILTER = 55; /** * The meta object id for the 'IArtifact Descriptor Array' data type. @@ -5169,7 +5337,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIArtifactDescriptorArray() * @generated */ - int IARTIFACT_DESCRIPTOR_ARRAY = 54; + int IARTIFACT_DESCRIPTOR_ARRAY = 56; /** * The meta object id for the 'IProgress Monitor' data type. @@ -5179,7 +5347,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIProgressMonitor() * @generated */ - int IPROGRESS_MONITOR = 68; + int IPROGRESS_MONITOR = 71; /** * The meta object id for the 'IRunnable With Progress' data type. @@ -5189,7 +5357,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIRunnableWithProgress() * @generated */ - int IRUNNABLE_WITH_PROGRESS = 69; + int IRUNNABLE_WITH_PROGRESS = 72; /** * The meta object id for the 'IStatus' data type. @@ -5199,7 +5367,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIStatus() * @generated */ - int ISTATUS = 70; + int ISTATUS = 73; /** * The meta object id for the 'IMatch Expression' data type. @@ -5209,7 +5377,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIMatchExpression() * @generated */ - int IMATCH_EXPRESSION = 60; + int IMATCH_EXPRESSION = 63; /** * The meta object id for the 'IProvisioning Agent' data type. @@ -5219,7 +5387,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getIProvisioningAgent() * @generated */ - int IPROVISIONING_AGENT = 64; + int IPROVISIONING_AGENT = 67; /** * The meta object id for the 'URI' data type. @@ -5229,7 +5397,7 @@ interface Literals { * @see org.eclipse.cbi.p2repo.p2.impl.P2PackageImpl#getURI() * @generated */ - int URI = 76; + int URI = 79; /** * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.p2.ArtifactDescriptor Artifact Descriptor}'. @@ -5382,6 +5550,20 @@ interface Literals { */ EDataType getFile(); + /** + * Returns the meta object for data type '{@link org.eclipse.equinox.p2.metadata.expression.IMatchExpression Filter}'. + * + * + * + * @since 1.1 + * + * @return the meta object for data type 'Filter'. + * @see org.eclipse.equinox.p2.metadata.expression.IMatchExpression + * @model instanceClass="org.eclipse.equinox.p2.metadata.expression.IMatchExpression<org.eclipse.equinox.p2.metadata.IInstallableUnit>" + * @generated + */ + EDataType getFilter(); + /** * Returns the meta object for class '{@link org.eclipse.core.runtime.IAdaptable IAdaptable}'. * @@ -5500,6 +5682,20 @@ interface Literals { */ EDataType getIArtifactRequestArray(); + /** + * Returns the meta object for data type '{@link org.eclipse.equinox.p2.metadata.expression.IFilterExpression IFilter Expression}'. + * + * + * + * @since 1.1 + * + * @return the meta object for data type 'IFilter Expression'. + * @see org.eclipse.equinox.p2.metadata.expression.IFilterExpression + * @model instanceClass="org.eclipse.equinox.p2.metadata.expression.IFilterExpression" + * @generated + */ + EDataType getIFilterExpression(); + /** * Returns the meta object for class '{@link org.eclipse.equinox.p2.metadata.ICopyright ICopyright}'. * @@ -6823,6 +7019,41 @@ interface Literals { */ EClass getRequirement(); + /** + * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch Required Properties Match}'. + * + * + * @return the meta object for class 'Required Properties Match'. + * @see org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch + * @since 1.1 + * @generated + */ + EClass getRequiredPropertiesMatch(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch#getNamespace Namespace}'. + * + * + * @return the meta object for the attribute 'Namespace'. + * @see org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch#getNamespace() + * @see #getRequiredPropertiesMatch() + * @since 1.1 + * @generated + */ + EAttribute getRequiredPropertiesMatch_Namespace(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch#getPropertiesMatch Properties Match}'. + * + * + * @return the meta object for the attribute 'Properties Match'. + * @see org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch#getPropertiesMatch() + * @see #getRequiredPropertiesMatch() + * @since 1.1 + * @generated + */ + EAttribute getRequiredPropertiesMatch_PropertiesMatch(); + /** * Returns the meta object for class '{@link org.eclipse.cbi.p2repo.p2.RequirementChange Requirement Change}'. * diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/RequiredPropertiesMatch.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/RequiredPropertiesMatch.java new file mode 100644 index 000000000..1c8aead45 --- /dev/null +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/RequiredPropertiesMatch.java @@ -0,0 +1,82 @@ +/** + * Copyright (c) 2006-2016, Cloudsmith Inc. and others + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + */ +package org.eclipse.cbi.p2repo.p2; + +import org.eclipse.equinox.p2.metadata.expression.IFilterExpression; + +/** + * + * A representation of the model object 'Required Properties Match'. + * + * + * + * @since 1.1 + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch#getNamespace Namespace}
  • + *
  • {@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch#getPropertiesMatch Properties Match}
  • + *
+ * + * @see org.eclipse.cbi.p2repo.p2.P2Package#getRequiredPropertiesMatch() + * @model + * @generated + */ +public interface RequiredPropertiesMatch extends Requirement { + /** + * Returns the value of the 'Namespace' attribute. + * + * + * @return the value of the 'Namespace' attribute. + * @see #setNamespace(String) + * @see org.eclipse.cbi.p2repo.p2.P2Package#getRequiredPropertiesMatch_Namespace() + * @model + * @generated + */ + String getNamespace(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch#getNamespace Namespace}' attribute. + * + * + * @param value the new value of the 'Namespace' attribute. + * @see #getNamespace() + * @generated + */ + void setNamespace(String value); + + /** + * Returns the value of the 'Properties Match' attribute. + * + * + * @return the value of the 'Properties Match' attribute. + * @see #setPropertiesMatch(IFilterExpression) + * @see org.eclipse.cbi.p2repo.p2.P2Package#getRequiredPropertiesMatch_PropertiesMatch() + * @model dataType="org.eclipse.cbi.p2repo.p2.IFilterExpression" + * @generated + */ + IFilterExpression getPropertiesMatch(); + + /** + * Sets the value of the '{@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch#getPropertiesMatch Properties Match}' attribute. + * + * + * @param value the new value of the 'Properties Match' attribute. + * @see #getPropertiesMatch() + * @generated + */ + void setPropertiesMatch(IFilterExpression value); + +} // RequiredPropertiesMatch diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/MetadataRepositoryImpl.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/MetadataRepositoryImpl.java index 3fe4ba9b0..6218e5804 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/MetadataRepositoryImpl.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/MetadataRepositoryImpl.java @@ -33,12 +33,15 @@ import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.util.EObjectContainmentEList; import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.equinox.internal.p2.director.QueryableArray; +import org.eclipse.equinox.internal.p2.metadata.TranslationSupport; import org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepository; import org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository; import org.eclipse.equinox.p2.core.IPool; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.query.IQuery; import org.eclipse.equinox.p2.query.IQueryResult; +import org.eclipse.equinox.p2.query.IQueryable; import org.eclipse.equinox.p2.repository.IRepositoryReference; import org.eclipse.equinox.p2.repository.IRunnableWithProgress; import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository; @@ -93,6 +96,10 @@ public class MetadataRepositoryImpl extends RepositoryImpl imp */ protected EList references; + private IQueryable queryable; + + private TranslationSupport translationSupport; + /** * * @@ -289,13 +296,22 @@ public IStatus executeBatch(IRunnableWithProgress runnable, IProgressMonitor mon /** * * - * @generated + * @generated NOT */ @Override public EList getInstallableUnits() { if (installableUnits == null) { installableUnits = new EObjectContainmentEList.Resolving<>(IInstallableUnit.class, this, - P2Package.METADATA_REPOSITORY__INSTALLABLE_UNITS); + P2Package.METADATA_REPOSITORY__INSTALLABLE_UNITS) { + private static final long serialVersionUID = 1L; + + @Override + protected void didChange() { + queryable = null; + translationSupport = null; + super.didChange(); + } + }; } return installableUnits; } @@ -332,14 +348,23 @@ public URI getSafeLocation() { return location != null ? location : getLocationFromProxy(); } + public TranslationSupport getTranslationSupport() { + if (translationSupport == null) { + translationSupport = new TranslationSupport(this); + } + return translationSupport; + } + /** - * - * * @generated NOT */ @Override public IQueryResult query(IQuery query, IProgressMonitor progress) { - return query.perform(getInstallableUnits().iterator()); + if (queryable == null) { + EList installableUnits = getInstallableUnits(); + queryable = new QueryableArray(installableUnits.toArray(new IInstallableUnit[installableUnits.size()])); + } + return queryable.query(query, progress); } /** diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/P2FactoryImpl.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/P2FactoryImpl.java index c33d0b6d2..ae859b8ed 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/P2FactoryImpl.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/P2FactoryImpl.java @@ -13,7 +13,9 @@ //import java.net.URI; import java.io.File; import java.io.OutputStream; +import java.util.Arrays; import java.util.Collection; +import java.util.List; import java.util.Map; import org.eclipse.cbi.p2repo.p2.ArtifactDescriptor; @@ -32,6 +34,7 @@ import org.eclipse.cbi.p2repo.p2.ProvidedCapability; import org.eclipse.cbi.p2repo.p2.RepositoryReference; import org.eclipse.cbi.p2repo.p2.RequiredCapability; +import org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch; import org.eclipse.cbi.p2repo.p2.Requirement; import org.eclipse.cbi.p2repo.p2.RequirementChange; import org.eclipse.cbi.p2repo.p2.SimpleArtifactDescriptor; @@ -61,6 +64,10 @@ import org.eclipse.equinox.p2.metadata.ITouchpointInstruction; import org.eclipse.equinox.p2.metadata.Version; import org.eclipse.equinox.p2.metadata.VersionRange; +import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil; +import org.eclipse.equinox.p2.metadata.expression.IExpression; +import org.eclipse.equinox.p2.metadata.expression.IExpressionFactory; +import org.eclipse.equinox.p2.metadata.expression.IFilterExpression; import org.eclipse.equinox.p2.metadata.expression.IMatchExpression; import org.eclipse.equinox.p2.query.IQueryResult; import org.eclipse.equinox.p2.repository.IRunnableWithProgress; @@ -134,6 +141,27 @@ public String convertFileToString(EDataType eDataType, Object instanceValue) { return super.convertToString(eDataType, instanceValue); } + /** + * + * + * @since 1.1 + * @generated NOT + */ + public IMatchExpression createFilterFromString(EDataType eDataType, String initialValue) { + return initialValue == null ? null + : org.eclipse.equinox.internal.p2.metadata.InstallableUnit.parseFilter(initialValue); + } + + /** + * + * + * @since 1.1 + * @generated NOT + */ + public String convertFilterToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : ((IMatchExpression) instanceValue).getParameters()[0].toString(); + } + /** * * @@ -161,6 +189,26 @@ public String convertIArtifactRequestArrayToString(EDataType eDataType, Object i return super.convertToString(instanceValue); } + /** + * + * + * @since 1.1 + * @generated NOT + */ + public IFilterExpression createIFilterExpressionFromString(EDataType eDataType, String initialValue) { + return initialValue == null ? null : ExpressionUtil.parseLDAP(initialValue); + } + + /** + * + * + * @since 1.1 + * @generated NOT + */ + public String convertIFilterExpressionToString(EDataType eDataType, Object instanceValue) { + return super.convertToString(eDataType, instanceValue); + } + /** * * @@ -189,12 +237,24 @@ public String convertILicenseArrayToString(EDataType eDataType, Object instanceV } /** - * - * * @generated NOT */ public String convertIMatchExpressionToString(EDataType eDataType, Object instanceValue) { - return instanceValue != null ? instanceValue.toString() : null; + if (instanceValue == null) { + return null; + } + + IMatchExpression match = (IMatchExpression) instanceValue; + IExpression operand = ExpressionUtil.getOperand(match); + Object[] parameters = match.getParameters(); + IExpression[] expressions = new IExpression[parameters.length + 1]; + expressions[0] = operand; + IExpressionFactory factory = ExpressionUtil.getFactory(); + for (int i = 0; i < parameters.length; ++i) { + expressions[i + 1] = factory.constant(parameters[i]); + } + + return factory.array(expressions).toString(); } /** @@ -308,12 +368,16 @@ public String convertToString(EDataType eDataType, Object instanceValue) { return convertCollectionToString(eDataType, instanceValue); case P2Package.FILE: return convertFileToString(eDataType, instanceValue); + case P2Package.FILTER: + return convertFilterToString(eDataType, instanceValue); case P2Package.IARTIFACT_DESCRIPTOR_ARRAY: return convertIArtifactDescriptorArrayToString(eDataType, instanceValue); case P2Package.IARTIFACT_KEY_ARRAY: return convertIArtifactKeyArrayToString(eDataType, instanceValue); case P2Package.IARTIFACT_REQUEST_ARRAY: return convertIArtifactRequestArrayToString(eDataType, instanceValue); + case P2Package.IFILTER_EXPRESSION: + return convertIFilterExpressionToString(eDataType, instanceValue); case P2Package.IINSTALLABLE_UNIT_ARRAY: return convertIInstallableUnitArrayToString(eDataType, instanceValue); case P2Package.IINSTALLABLE_UNIT_FRAGMENT_ARRAY: @@ -440,6 +504,8 @@ public EObject create(EClass eClass) { return (EObject) createRequiredCapability(); case P2Package.REQUIREMENT: return (EObject) createRequirement(); + case P2Package.REQUIRED_PROPERTIES_MATCH: + return (EObject) createRequiredPropertiesMatch(); case P2Package.REQUIREMENT_CHANGE: return (EObject) createRequirementChange(); case P2Package.SIMPLE_ARTIFACT_REPOSITORY: @@ -543,12 +609,16 @@ public Object createFromString(EDataType eDataType, String initialValue) { return createCollectionFromString(eDataType, initialValue); case P2Package.FILE: return createFileFromString(eDataType, initialValue); + case P2Package.FILTER: + return createFilterFromString(eDataType, initialValue); case P2Package.IARTIFACT_DESCRIPTOR_ARRAY: return createIArtifactDescriptorArrayFromString(eDataType, initialValue); case P2Package.IARTIFACT_KEY_ARRAY: return createIArtifactKeyArrayFromString(eDataType, initialValue); case P2Package.IARTIFACT_REQUEST_ARRAY: return createIArtifactRequestArrayFromString(eDataType, initialValue); + case P2Package.IFILTER_EXPRESSION: + return createIFilterExpressionFromString(eDataType, initialValue); case P2Package.IINSTALLABLE_UNIT_ARRAY: return createIInstallableUnitArrayFromString(eDataType, initialValue); case P2Package.IINSTALLABLE_UNIT_FRAGMENT_ARRAY: @@ -649,12 +719,16 @@ public ILicense[] createILicenseArrayFromString(EDataType eDataType, String init } /** - * - * * @generated NOT */ public IMatchExpression createIMatchExpressionFromString(EDataType eDataType, String initialValue) { - throw new UnsupportedOperationException(); + if (initialValue == null) { + return null; + } + + List expressions = Arrays.asList(ExpressionUtil.getOperands(ExpressionUtil.parse(initialValue))); + IExpressionFactory factory = ExpressionUtil.getFactory(); + return factory.matchExpression(expressions.get(0), expressions.subList(1, expressions.size()).toArray()); } /** @@ -903,6 +977,18 @@ public Requirement createRequirement() { return requirement; } + /** + * + * + * @since 1.1 + * @generated + */ + @Override + public RequiredPropertiesMatch createRequiredPropertiesMatch() { + RequiredPropertiesMatchImpl requiredPropertiesMatch = new RequiredPropertiesMatchImpl(); + return requiredPropertiesMatch; + } + /** * * diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/P2PackageImpl.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/P2PackageImpl.java index 06ca7236b..fa9a9b392 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/P2PackageImpl.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/P2PackageImpl.java @@ -32,6 +32,7 @@ import org.eclipse.cbi.p2repo.p2.Repository; import org.eclipse.cbi.p2repo.p2.RepositoryReference; import org.eclipse.cbi.p2repo.p2.RequiredCapability; +import org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch; import org.eclipse.cbi.p2repo.p2.Requirement; import org.eclipse.cbi.p2repo.p2.RequirementChange; import org.eclipse.cbi.p2repo.p2.SimpleArtifactDescriptor; @@ -72,6 +73,7 @@ import org.eclipse.equinox.p2.metadata.IVersionedId; import org.eclipse.equinox.p2.metadata.Version; import org.eclipse.equinox.p2.metadata.VersionRange; +import org.eclipse.equinox.p2.metadata.expression.IFilterExpression; import org.eclipse.equinox.p2.metadata.expression.IMatchExpression; import org.eclipse.equinox.p2.query.Collector; import org.eclipse.equinox.p2.query.IQuery; @@ -325,6 +327,14 @@ public class P2PackageImpl extends EPackageImpl implements P2Package { */ private EClass requirementEClass = null; + /** + * + * + * @since 1.1 + * @generated + */ + private EClass requiredPropertiesMatchEClass = null; + /** * * @@ -507,6 +517,14 @@ public class P2PackageImpl extends EPackageImpl implements P2Package { */ private EDataType iArtifactRequestArrayEDataType = null; + /** + * + * + * @since 1.1 + * @generated + */ + private EDataType iFilterExpressionEDataType = null; + /** * * @@ -598,6 +616,14 @@ public class P2PackageImpl extends EPackageImpl implements P2Package { */ private EDataType fileEDataType = null; + /** + * + * + * @since 1.1 + * @generated + */ + private EDataType filterEDataType = null; + /** * * @@ -907,6 +933,10 @@ public void createPackageContents() { requirementEClass = createEClass(REQUIREMENT); + requiredPropertiesMatchEClass = createEClass(REQUIRED_PROPERTIES_MATCH); + createEAttribute(requiredPropertiesMatchEClass, REQUIRED_PROPERTIES_MATCH__NAMESPACE); + createEAttribute(requiredPropertiesMatchEClass, REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH); + requirementChangeEClass = createEClass(REQUIREMENT_CHANGE); simpleArtifactRepositoryEClass = createEClass(SIMPLE_ARTIFACT_REPOSITORY); @@ -928,9 +958,11 @@ public void createPackageContents() { collectionEDataType = createEDataType(COLLECTION); collectorEDataType = createEDataType(COLLECTOR); fileEDataType = createEDataType(FILE); + filterEDataType = createEDataType(FILTER); iArtifactDescriptorArrayEDataType = createEDataType(IARTIFACT_DESCRIPTOR_ARRAY); iArtifactKeyArrayEDataType = createEDataType(IARTIFACT_KEY_ARRAY); iArtifactRequestArrayEDataType = createEDataType(IARTIFACT_REQUEST_ARRAY); + iFilterExpressionEDataType = createEDataType(IFILTER_EXPRESSION); iInstallableUnitArrayEDataType = createEDataType(IINSTALLABLE_UNIT_ARRAY); iInstallableUnitFragmentArrayEDataType = createEDataType(IINSTALLABLE_UNIT_FRAGMENT_ARRAY); iLicenseArrayEDataType = createEDataType(ILICENSE_ARRAY); @@ -1095,6 +1127,17 @@ public EDataType getFile() { return fileEDataType; } + /** + * + * + * @since 1.1 + * @generated + */ + @Override + public EDataType getFilter() { + return filterEDataType; + } + /** * * @@ -1205,6 +1248,17 @@ public EDataType getIArtifactRequestArray() { return iArtifactRequestArrayEDataType; } + /** + * + * + * @since 1.1 + * @generated + */ + @Override + public EDataType getIFilterExpression() { + return iFilterExpressionEDataType; + } + /** * * @@ -2425,6 +2479,39 @@ public EClass getRequirement() { return requirementEClass; } + /** + * + * + * @since 1.1 + * @generated + */ + @Override + public EClass getRequiredPropertiesMatch() { + return requiredPropertiesMatchEClass; + } + + /** + * + * + * @since 1.1 + * @generated + */ + @Override + public EAttribute getRequiredPropertiesMatch_Namespace() { + return (EAttribute) requiredPropertiesMatchEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @since 1.1 + * @generated + */ + @Override + public EAttribute getRequiredPropertiesMatch_PropertiesMatch() { + return (EAttribute) requiredPropertiesMatchEClass.getEStructuralFeatures().get(1); + } + /** * * @@ -2667,6 +2754,7 @@ public void initializePackageContents() { requiredCapabilityEClass.getESuperTypes().add(this.getRequirement()); requiredCapabilityEClass.getESuperTypes().add(this.getIRequiredCapability()); requirementEClass.getESuperTypes().add(this.getIRequirement()); + requiredPropertiesMatchEClass.getESuperTypes().add(this.getRequirement()); requirementChangeEClass.getESuperTypes().add(this.getIRequirementChange()); simpleArtifactRepositoryEClass.getESuperTypes().add(this.getArtifactRepository()); simpleArtifactRepositoryEClass.getESuperTypes().add(this.getIFileArtifactRepository()); @@ -2887,11 +2975,8 @@ public void initializePackageContents() { initEReference(getIInstallableUnit_Copyright(), this.getICopyright(), null, "copyright", null, 0, 1, IInstallableUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - g1 = createEGenericType(this.getIMatchExpression()); - g2 = createEGenericType(this.getIInstallableUnit()); - g1.getETypeArguments().add(g2); - initEAttribute(getIInstallableUnit_Filter(), g1, "filter", "", 0, 1, IInstallableUnit.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getIInstallableUnit_Filter(), this.getFilter(), "filter", "", 0, 1, IInstallableUnit.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEReference(getIInstallableUnit_Fragments(), this.getIInstallableUnitFragment(), null, "fragments", null, 0, -1, IInstallableUnit.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); @@ -3134,11 +3219,8 @@ public void initializePackageContents() { initEClass(iRequirementEClass, IRequirement.class, "IRequirement", IS_ABSTRACT, IS_INTERFACE, !IS_GENERATED_INSTANCE_CLASS); - g1 = createEGenericType(this.getIMatchExpression()); - g2 = createEGenericType(this.getIInstallableUnit()); - g1.getETypeArguments().add(g2); - initEAttribute(getIRequirement_Filter(), g1, "filter", null, 0, 1, IRequirement.class, !IS_TRANSIENT, - !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getIRequirement_Filter(), this.getFilter(), "filter", null, 0, 1, IRequirement.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getIRequirement_Max(), theXMLTypePackage.getInt(), "max", null, 0, 1, IRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); initEAttribute(getIRequirement_Min(), theXMLTypePackage.getInt(), "min", null, 0, 1, IRequirement.class, @@ -3295,6 +3377,15 @@ public void initializePackageContents() { initEClass(requirementEClass, Requirement.class, "Requirement", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEClass(requiredPropertiesMatchEClass, RequiredPropertiesMatch.class, "RequiredPropertiesMatch", + !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getRequiredPropertiesMatch_Namespace(), ecorePackage.getEString(), "namespace", null, 0, 1, + RequiredPropertiesMatch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getRequiredPropertiesMatch_PropertiesMatch(), this.getIFilterExpression(), "propertiesMatch", + null, 0, 1, RequiredPropertiesMatch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, + !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEClass(requirementChangeEClass, RequirementChange.class, "RequirementChange", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); @@ -3343,12 +3434,16 @@ public void initializePackageContents() { !IS_GENERATED_INSTANCE_CLASS); initEDataType(collectorEDataType, Collector.class, "Collector", !IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(fileEDataType, File.class, "File", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(filterEDataType, IMatchExpression.class, "Filter", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS, + "org.eclipse.equinox.p2.metadata.expression.IMatchExpression"); initEDataType(iArtifactDescriptorArrayEDataType, IArtifactDescriptor[].class, "IArtifactDescriptorArray", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(iArtifactKeyArrayEDataType, IArtifactKey[].class, "IArtifactKeyArray", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(iArtifactRequestArrayEDataType, IArtifactRequest[].class, "IArtifactRequestArray", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); + initEDataType(iFilterExpressionEDataType, IFilterExpression.class, "IFilterExpression", IS_SERIALIZABLE, + !IS_GENERATED_INSTANCE_CLASS); initEDataType(iInstallableUnitArrayEDataType, IInstallableUnit[].class, "IInstallableUnitArray", IS_SERIALIZABLE, !IS_GENERATED_INSTANCE_CLASS); initEDataType(iInstallableUnitFragmentArrayEDataType, IInstallableUnitFragment[].class, diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/RequiredPropertiesMatchImpl.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/RequiredPropertiesMatchImpl.java new file mode 100644 index 000000000..73906a4f5 --- /dev/null +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/RequiredPropertiesMatchImpl.java @@ -0,0 +1,262 @@ +/** + * Copyright (c) 2006-2016, Cloudsmith Inc. and others + * + * This program and the accompanying materials + * are made available under the terms of the Eclipse Public License 2.0 + * which accompanies this distribution, and is available at + * https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + */ +package org.eclipse.cbi.p2repo.p2.impl; + +import org.eclipse.cbi.p2repo.p2.P2Package; +import org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.equinox.p2.metadata.IInstallableUnit; +import org.eclipse.equinox.p2.metadata.expression.IFilterExpression; +import org.eclipse.equinox.p2.metadata.expression.IMatchExpression; + +/** + * + * An implementation of the model object 'Required Properties Match'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link org.eclipse.cbi.p2repo.p2.impl.RequiredPropertiesMatchImpl#getNamespace Namespace}
  • + *
  • {@link org.eclipse.cbi.p2repo.p2.impl.RequiredPropertiesMatchImpl#getPropertiesMatch Properties Match}
  • + *
+ * + * @since 1.1 + * @generated + */ +public class RequiredPropertiesMatchImpl extends RequirementImpl implements RequiredPropertiesMatch { + /** + * The default value of the '{@link #getNamespace() Namespace}' attribute. + * + * + * @see #getNamespace() + * @generated + * @ordered + */ + protected static final String NAMESPACE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getNamespace() Namespace}' attribute. + * + * + * @see #getNamespace() + * @generated + * @ordered + */ + protected String namespace = NAMESPACE_EDEFAULT; + + /** + * The default value of the '{@link #getPropertiesMatch() Properties Match}' attribute. + * + * + * @see #getPropertiesMatch() + * @generated + * @ordered + */ + protected static final IFilterExpression PROPERTIES_MATCH_EDEFAULT = null; + + /** + * The cached value of the '{@link #getPropertiesMatch() Properties Match}' attribute. + * + * + * @see #getPropertiesMatch() + * @generated + * @ordered + */ + protected IFilterExpression propertiesMatch = PROPERTIES_MATCH_EDEFAULT; + + private boolean matchesDirty = true; + + /** + * + * + * @generated + */ + protected RequiredPropertiesMatchImpl() { + super(); + } + + synchronized private void computeMatches() { + if (matchesDirty) { + org.eclipse.equinox.internal.p2.metadata.RequiredPropertiesMatch rpm = new org.eclipse.equinox.internal.p2.metadata.RequiredPropertiesMatch( + namespace, getPropertiesMatch(), getFilter(), getMin(), getMax(), isGreedy(), getDescription()); + super.setMatches(rpm.getMatches()); + } + + matchesDirty = false; + } + + @Override + public IMatchExpression getMatches() { + if (matchesDirty) + computeMatches(); + + return matches; + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return P2Package.Literals.REQUIRED_PROPERTIES_MATCH; + } + + /** + * + * + * @generated + */ + @Override + public String getNamespace() { + return namespace; + } + + @Override + public void setNamespace(String newNamespace) { + matchesDirty = true; + setNamespaceGen(newNamespace); + } + + /** + * + * + * @generated + */ + public void setNamespaceGen(String newNamespace) { + String oldNamespace = namespace; + namespace = newNamespace; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, P2Package.REQUIRED_PROPERTIES_MATCH__NAMESPACE, + oldNamespace, namespace)); + } + + /** + * + * + * @generated + */ + @Override + public IFilterExpression getPropertiesMatch() { + return propertiesMatch; + } + + @Override + public void setPropertiesMatch(IFilterExpression newPropertiesMatch) { + setPropertiesMatchGen(newPropertiesMatch); + matchesDirty = true; + } + + /** + * + * + * @generated + */ + public void setPropertiesMatchGen(IFilterExpression newPropertiesMatch) { + IFilterExpression oldPropertiesMatch = propertiesMatch; + propertiesMatch = newPropertiesMatch; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, P2Package.REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH, + oldPropertiesMatch, propertiesMatch)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case P2Package.REQUIRED_PROPERTIES_MATCH__NAMESPACE: + return getNamespace(); + case P2Package.REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH: + return getPropertiesMatch(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case P2Package.REQUIRED_PROPERTIES_MATCH__NAMESPACE: + setNamespace((String) newValue); + return; + case P2Package.REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH: + setPropertiesMatch((IFilterExpression) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case P2Package.REQUIRED_PROPERTIES_MATCH__NAMESPACE: + setNamespace(NAMESPACE_EDEFAULT); + return; + case P2Package.REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH: + setPropertiesMatch(PROPERTIES_MATCH_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case P2Package.REQUIRED_PROPERTIES_MATCH__NAMESPACE: + return NAMESPACE_EDEFAULT == null ? namespace != null : !NAMESPACE_EDEFAULT.equals(namespace); + case P2Package.REQUIRED_PROPERTIES_MATCH__PROPERTIES_MATCH: + return PROPERTIES_MATCH_EDEFAULT == null ? propertiesMatch != null + : !PROPERTIES_MATCH_EDEFAULT.equals(propertiesMatch); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated NOT + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(); + result.append(namespace); + result.append("; "); + result.append(propertiesMatch); + return result.toString(); + } + +} // RequiredPropertiesMatchImpl diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/TouchpointInstructionImpl.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/TouchpointInstructionImpl.java index c30446975..db13e41a2 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/TouchpointInstructionImpl.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/impl/TouchpointInstructionImpl.java @@ -248,20 +248,14 @@ public void setImportAttribute(String newImportAttribute) { /** * * - * @generated + * @generated NOT */ @Override public String toString() { if (eIsProxy()) return super.toString(); - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (body: "); - result.append(body); - result.append(", importAttribute: "); - result.append(importAttribute); - result.append(')'); - return result.toString(); + return "Instruction[" + body + ',' + importAttribute + ']'; } } // TouchpointInstructionImpl diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2AdapterFactory.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2AdapterFactory.java index c9b0b883a..b9b2b3b43 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2AdapterFactory.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2AdapterFactory.java @@ -28,6 +28,7 @@ import org.eclipse.cbi.p2repo.p2.Repository; import org.eclipse.cbi.p2repo.p2.RepositoryReference; import org.eclipse.cbi.p2repo.p2.RequiredCapability; +import org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch; import org.eclipse.cbi.p2repo.p2.Requirement; import org.eclipse.cbi.p2repo.p2.RequirementChange; import org.eclipse.cbi.p2repo.p2.SimpleArtifactDescriptor; @@ -310,6 +311,11 @@ public Adapter caseRequirement(Requirement object) { return createRequirementAdapter(); } + @Override + public Adapter caseRequiredPropertiesMatch(RequiredPropertiesMatch object) { + return createRequiredPropertiesMatchAdapter(); + } + @Override public Adapter caseRequirementChange(RequirementChange object) { return createRequirementChangeAdapter(); @@ -915,6 +921,21 @@ public Adapter createRequirementAdapter() { return null; } + /** + * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch Required Properties Match}'. + * + * 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.cbi.p2repo.p2.RequiredPropertiesMatch + * @since 1.1 + * @generated + */ + public Adapter createRequiredPropertiesMatchAdapter() { + return null; + } + /** * Creates a new adapter for an object of class '{@link org.eclipse.cbi.p2repo.p2.RequirementChange Requirement Change}'. * diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2Bridge.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2Bridge.java index 5a1a8a10f..e8fa8b32f 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2Bridge.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2Bridge.java @@ -51,6 +51,7 @@ import org.eclipse.cbi.p2repo.p2.impl.ProvidedCapabilityImpl; import org.eclipse.cbi.p2repo.p2.impl.RepositoryImpl; import org.eclipse.cbi.p2repo.p2.impl.RequiredCapabilityImpl; +import org.eclipse.cbi.p2repo.p2.impl.RequiredPropertiesMatchImpl; import org.eclipse.cbi.p2repo.p2.impl.RequirementChangeImpl; import org.eclipse.cbi.p2repo.p2.impl.RequirementImpl; import org.eclipse.cbi.p2repo.p2.impl.SimpleArtifactDescriptorImpl; @@ -69,6 +70,7 @@ import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactDescriptor; import org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository; import org.eclipse.equinox.internal.p2.metadata.IRequiredCapability; +import org.eclipse.equinox.internal.p2.metadata.RequiredPropertiesMatch; import org.eclipse.equinox.p2.metadata.IArtifactKey; import org.eclipse.equinox.p2.metadata.ICopyright; import org.eclipse.equinox.p2.metadata.IInstallableUnit; @@ -83,6 +85,7 @@ import org.eclipse.equinox.p2.metadata.ITouchpointType; import org.eclipse.equinox.p2.metadata.IUpdateDescriptor; import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil; +import org.eclipse.equinox.p2.metadata.expression.IMatchExpression; import org.eclipse.equinox.p2.query.ExpressionMatchQuery; import org.eclipse.equinox.p2.query.IQuery; import org.eclipse.equinox.p2.query.IQueryResult; @@ -463,6 +466,13 @@ public static Requirement importToModel(IRequirement req) { mrc.setRange(rc.getRange()); mreq = mrc; + } else if (RequiredPropertiesMatch.isPropertiesMatchRequirement(req.getMatches())) { + IMatchExpression matches = req.getMatches(); + RequiredPropertiesMatchImpl rpm = (RequiredPropertiesMatchImpl) P2Factory.eINSTANCE + .createRequiredPropertiesMatch(); + rpm.setNamespace(RequiredPropertiesMatch.extractNamespace(matches)); + rpm.setPropertiesMatch(RequiredPropertiesMatch.extractPropertiesMatch(matches)); + mreq = rpm; } else { mreq = (RequirementImpl) P2Factory.eINSTANCE.createRequirement(); mreq.setMatches(req.getMatches()); diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2Switch.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2Switch.java index a01ad5904..4687c166d 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2Switch.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/P2Switch.java @@ -28,6 +28,7 @@ import org.eclipse.cbi.p2repo.p2.Repository; import org.eclipse.cbi.p2repo.p2.RepositoryReference; import org.eclipse.cbi.p2repo.p2.RequiredCapability; +import org.eclipse.cbi.p2repo.p2.RequiredPropertiesMatch; import org.eclipse.cbi.p2repo.p2.Requirement; import org.eclipse.cbi.p2repo.p2.RequirementChange; import org.eclipse.cbi.p2repo.p2.SimpleArtifactDescriptor; @@ -670,6 +671,22 @@ public T1 caseRequirement(Requirement object) { return null; } + /** + * Returns the result of interpreting the object as an instance of 'Required Properties Match'. + * + * 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 'Required Properties Match'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @since 1.1 + * @generated + */ + public T1 caseRequiredPropertiesMatch(RequiredPropertiesMatch object) { + return null; + } + /** * Returns the result of interpreting the object as an instance of 'Requirement Change'. * @@ -1212,6 +1229,17 @@ protected T1 doSwitch(int classifierID, EObject theEObject) { result = defaultCase(theEObject); return result; } + case P2Package.REQUIRED_PROPERTIES_MATCH: { + RequiredPropertiesMatch requiredPropertiesMatch = (RequiredPropertiesMatch) theEObject; + T1 result = caseRequiredPropertiesMatch(requiredPropertiesMatch); + if (result == null) + result = caseRequirement(requiredPropertiesMatch); + if (result == null) + result = caseIRequirement(requiredPropertiesMatch); + if (result == null) + result = defaultCase(theEObject); + return result; + } case P2Package.REQUIREMENT_CHANGE: { RequirementChange requirementChange = (RequirementChange) theEObject; T1 result = caseRequirementChange(requirementChange); diff --git a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/RepositoryTranslationSupport.java b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/RepositoryTranslationSupport.java index 5c8374a73..2be7ce7b3 100644 --- a/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/RepositoryTranslationSupport.java +++ b/org.eclipse.cbi.p2repo.p2/src/org/eclipse/cbi/p2repo/p2/util/RepositoryTranslationSupport.java @@ -11,6 +11,7 @@ package org.eclipse.cbi.p2repo.p2.util; +import org.eclipse.cbi.p2repo.p2.impl.MetadataRepositoryImpl; import org.eclipse.equinox.internal.p2.metadata.TranslationSupport; import org.eclipse.equinox.p2.metadata.IInstallableUnit; import org.eclipse.equinox.p2.query.IQueryable; @@ -22,6 +23,9 @@ public class RepositoryTranslationSupport extends TranslationSupport { public static TranslationSupport getInstance(IQueryable mdr) { + if (mdr instanceof MetadataRepositoryImpl) { + return ((MetadataRepositoryImpl) mdr).getTranslationSupport(); + } return new RepositoryTranslationSupport(mdr); } diff --git a/org.eclipse.cbi.p2repo.releng.parent/.gitignore b/org.eclipse.cbi.p2repo.releng.parent/.gitignore new file mode 100644 index 000000000..d14520c97 --- /dev/null +++ b/org.eclipse.cbi.p2repo.releng.parent/.gitignore @@ -0,0 +1 @@ +/repository/ diff --git a/org.eclipse.cbi.p2repo.releng.parent/pom.xml b/org.eclipse.cbi.p2repo.releng.parent/pom.xml index f43d62a99..7e75c89f3 100644 --- a/org.eclipse.cbi.p2repo.releng.parent/pom.xml +++ b/org.eclipse.cbi.p2repo.releng.parent/pom.xml @@ -16,11 +16,15 @@ 4.0.0 org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT pom ../org.eclipse.cbi.p2repo.aggregator + ../org.eclipse.cbi.p2repo.aggregator.analyzer + ../org.eclipse.cbi.p2repo.aggregator.analyzer.edit + ../org.eclipse.cbi.p2repo.aggregator.analyzer.editor + ../org.eclipse.cbi.p2repo.aggregator.analyzer.editor.feature ../org.eclipse.cbi.p2repo.aggregator.edit ../org.eclipse.cbi.p2repo.aggregator.editor ../org.eclipse.cbi.p2repo.aggregator.editor.feature @@ -48,12 +52,8 @@ true yyyyMMdd-HHmm - ${maven.build.timestamp} - I - ${buildType}${buildTimestamp} - http://download.eclipse.org/cbi/updates/aggregator/ide/4.8/ - - 2.3.0 + http://download.eclipse.org/cbi/updates/aggregator/ide/4.13/ + 2.7.3 1.3.1 -warn:-deprecation,raw,unchecked,discouraged - error + warning warn - 4.22 + 4.25 - false - - ${code.ignoredWarnings} - -verbose - -enableJavadoc - -encoding - ${project.build.sourceEncoding} - -proceedOnError - - BREE - - xml - ${project.build.directory}/compilelogs - true - - **/package.html - - - - - - org.eclipse.tycho - tycho-packaging-plugin - ${tycho-version} - - - org.eclipse.tycho.extras - tycho-buildtimestamp-jgit - ${tycho-version} - - - org.eclipse.tycho.extras - tycho-sourceref-jgit - ${tycho-version} - - - - false - yyyyMMdd-HHmm - jgit - - pom.xml - - ${dirtyWorkingTree} - - true - - - false - - - - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - - org.eclipse.tycho - tycho-source-plugin - ${tycho-version} - - true - false - - false - - - - - org.eclipse.tycho - tycho-p2-director-plugin - ${tycho-version} - - - org.eclipse.tycho - tycho-p2-repository-plugin - ${tycho-version} - - - org.eclipse.tycho.extras - tycho-source-feature-plugin - ${tycho-version} - - - false - - false - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - ${comparatorMode} - all - - - ${comparator.repo} - - - - - - org.apache.maven.plugins - maven-resources-plugin - 2.7 - - - - - eclipse-sign - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - true - - org.eclipse.cbi.maven.plugins eclipse-jarsigner-plugin @@ -261,59 +116,44 @@ ${defaultSigning-excludeInnerJars} - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - p2-metadata - - p2-metadata - - verify - - - - false - - + + + promote + + + promote + !false + + + + promotion + + + - eclipse-pack + about-mappings + + + about.mappings + + - - - org.eclipse.tycho - target-platform-configuration - ${tycho-version} - - false - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - p2-metadata - - p2-metadata - - package - - - - false - - - + + + . + true + + about.mappings + + + + eclipse @@ -354,29 +194,120 @@ + org.eclipse.tycho tycho-p2-director-plugin ${tycho-version} + org.eclipse.tycho tycho-p2-repository-plugin ${tycho-version} + - org.eclipse.tycho.extras - tycho-source-feature-plugin + org.eclipse.tycho + tycho-compiler-plugin ${tycho-version} + + false + + ${code.ignoredWarnings} + -verbose + -enableJavadoc + -encoding + ${project.build.sourceEncoding} + -proceedOnError + + BREE + + xml + ${project.build.directory}/compilelogs + true + + **/package.html + + + + + + org.eclipse.tycho + tycho-packaging-plugin + ${tycho-version} + + + org.eclipse.tycho.extras + tycho-buildtimestamp-jgit + ${tycho-version} + + + org.eclipse.tycho.extras + tycho-sourceref-jgit + ${tycho-version} + + + + false + 'v'yyyyMMdd-HHmm + jgit + + pom.xml + + ${dirtyWorkingTree} + + true + false - false + + + org.eclipse.tycho + target-platform-configuration + ${tycho-version} + + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + ${comparatorMode} + all + + + ${comparator.repo} + + + + + + + org.apache.maven.plugins + maven-resources-plugin + 2.7 + + org.eclipse.tycho @@ -384,6 +315,7 @@ ${tycho-version} true + org.eclipse.tycho tycho-p2-publisher-plugin @@ -392,6 +324,7 @@ true + org.eclipse.tycho target-platform-configuration @@ -401,8 +334,7 @@ org.eclipse.cbi org.eclipse.cbi.p2repo.aggregator.prereqs - 1.0.400-SNAPSHOT - + 1.1.0-SNAPSHOT @@ -432,8 +364,10 @@ aarch64 + false + org.eclipse.tycho tycho-source-plugin @@ -451,6 +385,31 @@ + + + org.eclipse.tycho + tycho-p2-plugin + ${tycho-version} + + + default-p2-metadata-default + + false + + + + attach-p2-metadata + package + + p2-metadata + + + + + false + + + diff --git a/org.eclipse.cbi.p2repo.releng.parent/promotion/pom.xml b/org.eclipse.cbi.p2repo.releng.parent/promotion/pom.xml new file mode 100644 index 000000000..16934de6b --- /dev/null +++ b/org.eclipse.cbi.p2repo.releng.parent/promotion/pom.xml @@ -0,0 +1,148 @@ + + + + 4.0.0 + + + org.eclipse.cbi + org.eclipse.cbi.p2repo.releng.parent + 1.1.0-SNAPSHOT + .. + + + org.eclipse.cbi + org.eclipse.cbi.promote + 1.1.0-SNAPSHOTT + pom + + + https://download.eclipse.org/releases/2022-03 + https://download.eclipse.org/justj/tools/updates/nightly/latest + cbi/updates/p2-aggregator + genie.cbi + -remote ${org.eclipse.storage.user}@projects-storage.eclipse.org:/home/data/httpd/download.eclipse.org/${org.eclipse.download.location.relative} + test/ + yyyyMMddHHmm + http://www.example.com/ + unknown + nightly + + + + + + org.eclipse.tycho.extras + tycho-eclipserun-plugin + ${tycho-version} + + JavaSE-11 + + + org.eclipse.justj.p2 + eclipse-plugin + + + org.apache.felix.scr + eclipse-plugin + + + + + eclipse.repo + p2 + ${eclipse.repo} + + + justj.tools.repo + p2 + ${justj.tools.repo} + + + + + + promote-tools + + eclipse-run + + generate-sources + + + + -consoleLog + -application org.eclipse.justj.p2.manager + -data @None + -nosplash + ${org.eclipse.justj.p2.manager.args} + -retain 5 + -label "CBI p2 Aggregator Tools" + -build-url ${org.eclipse.justj.p2.manager.build.url} + -root ${project.build.directory}/cbi-p2-sync + -relative ${org.eclipse.justj.p2.manager.relative}tools + -target-url https://download.eclipse.org/${org.eclipse.download.location.relative} + -promote ${project.basedir}/../../org.eclipse.cbi.p2repo.site.eclipse/target/repository + -timestamp ${build.timestamp} + -type ${build.type} + -version-iu org.eclipse.cbi.p2repo.aggregator.editor.feature + -iu-filter-pattern org\.eclipse\.cbi\.p2repo\.?.* + -commit https://github.com/eclipse-cbi/p2repo-aggregator/commit/${git.commit} + -breadcrumb "CBI p2 Aggregator https://projects.eclipse.org/projects/technology.cbi" + -favicon https://raw.githubusercontent.com/merks/p2repo-aggregator/issue-3/favicon.ico + -title-image https://www.eclipse.org/org/workinggroups/assets/images/wg_eclipse_ide.svg + -body-image https://raw.githubusercontent.com/merks/p2repo-aggregator/issue-3/cbi.svg + + + + + promote-products + + eclipse-run + + generate-sources + + + + -consoleLog + -application org.eclipse.justj.p2.manager + -data @None + -nosplash + ${org.eclipse.justj.p2.manager.args} + -retain 5 + -label "CBI p2 Aggregator Products" + -build-url ${org.eclipse.justj.p2.manager.build.url} + -root ${project.build.directory}/cbi-p2-sync + -relative ${org.eclipse.justj.p2.manager.relative}products + -target-url https://download.eclipse.org/${org.eclipse.download.location.relative} + -promote ${project.basedir}/../../org.eclipse.cbi.p2repo.cli.product/target/repository + -promote-products ${project.basedir}/../../org.eclipse.cbi.p2repo.cli.product/target/products + -timestamp ${build.timestamp} + -type ${build.type} + -version-iu org.eclipse.cbi.p2repo.cli.product.feature + -iu-filter-pattern org\.eclipse\.cbi\.p2repo\.?.* + -commit https://github.com/eclipse-cbi/p2repo-aggregator/commit/${git.commit} + -breadcrumb "CBI p2 Aggregator https://projects.eclipse.org/projects/technology.cbi" + -favicon https://raw.githubusercontent.com/merks/p2repo-aggregator/issue-3/favicon.ico + -title-image https://www.eclipse.org/org/workinggroups/assets/images/wg_eclipse_ide.svg + -body-image https://raw.githubusercontent.com/merks/p2repo-aggregator/issue-3/cbi.svg + + + + + + + + + + diff --git a/org.eclipse.cbi.p2repo.releng.target/org.eclipse.cbi.p2repo.aggregator.prereqs.target b/org.eclipse.cbi.p2repo.releng.target/org.eclipse.cbi.p2repo.aggregator.prereqs.target index dee55fab9..571cd9bee 100644 --- a/org.eclipse.cbi.p2repo.releng.target/org.eclipse.cbi.p2repo.aggregator.prereqs.target +++ b/org.eclipse.cbi.p2repo.releng.target/org.eclipse.cbi.p2repo.aggregator.prereqs.target @@ -1,18 +1,24 @@ - + + + + + + + - - + + diff --git a/org.eclipse.cbi.p2repo.releng.target/pom.xml b/org.eclipse.cbi.p2repo.releng.target/pom.xml index e5f3197f3..eb62689c1 100644 --- a/org.eclipse.cbi.p2repo.releng.target/pom.xml +++ b/org.eclipse.cbi.p2repo.releng.target/pom.xml @@ -1,18 +1,18 @@ - 4.0.0 - - org.eclipse.cbi - org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT - ../org.eclipse.cbi.p2repo.releng.parent - + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" + xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + 4.0.0 + + org.eclipse.cbi + org.eclipse.cbi.p2repo.releng.parent + 1.1.0-SNAPSHOT + ../org.eclipse.cbi.p2repo.releng.parent + - eclipse-target-definition - org.eclipse.cbi.p2repo.aggregator.prereqs - org.eclipse.cbi.p2repo.aggregator.prereqs - org.eclipse.cbi - 1.0.400-SNAPSHOT + eclipse-target-definition + org.eclipse.cbi.p2repo.aggregator.prereqs + org.eclipse.cbi.p2repo.aggregator.prereqs + org.eclipse.cbi + 1.1.0-SNAPSHOT diff --git a/org.eclipse.cbi.p2repo.site.eclipse/category.xml b/org.eclipse.cbi.p2repo.site.eclipse/category.xml index d97e94858..46ab05019 100644 --- a/org.eclipse.cbi.p2repo.site.eclipse/category.xml +++ b/org.eclipse.cbi.p2repo.site.eclipse/category.xml @@ -21,6 +21,12 @@ + + + + + + diff --git a/org.eclipse.cbi.p2repo.site.eclipse/pom.xml b/org.eclipse.cbi.p2repo.site.eclipse/pom.xml index 24550fb00..8d2c11417 100644 --- a/org.eclipse.cbi.p2repo.site.eclipse/pom.xml +++ b/org.eclipse.cbi.p2repo.site.eclipse/pom.xml @@ -4,15 +4,16 @@ org.eclipse.cbi.p2repo.site.eclipse org.eclipse.cbi - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-repository org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT ../org.eclipse.cbi.p2repo.releng.parent + @@ -20,9 +21,10 @@ target-platform-configuration ${tycho-version} - true + false + org.eclipse.tycho tycho-p2-repository-plugin diff --git a/org.eclipse.cbi.p2repo.tests.feature/.settings/org.eclipse.core.resources.prefs b/org.eclipse.cbi.p2repo.tests.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/org.eclipse.cbi.p2repo.tests.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.cbi.p2repo.tests.feature/feature.xml b/org.eclipse.cbi.p2repo.tests.feature/feature.xml index 9d2589433..a48bac19a 100644 --- a/org.eclipse.cbi.p2repo.tests.feature/feature.xml +++ b/org.eclipse.cbi.p2repo.tests.feature/feature.xml @@ -16,7 +16,7 @@ diff --git a/org.eclipse.cbi.p2repo.tests.feature/pom.xml b/org.eclipse.cbi.p2repo.tests.feature/pom.xml index f25806c45..ae5fb91f9 100644 --- a/org.eclipse.cbi.p2repo.tests.feature/pom.xml +++ b/org.eclipse.cbi.p2repo.tests.feature/pom.xml @@ -5,14 +5,14 @@ org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT org.eclipse.cbi org.eclipse.cbi.p2repo.tests.feature - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-feature - + org.eclipse.tycho @@ -25,27 +25,6 @@ feature-source - - - - - - org.eclipse.tycho - tycho-p2-plugin - ${tycho-version} - - - attach-p2-metadata - package - - p2-metadata - diff --git a/org.eclipse.cbi.p2repo.util/META-INF/MANIFEST.MF b/org.eclipse.cbi.p2repo.util/META-INF/MANIFEST.MF index 295157b90..7f14436f7 100644 --- a/org.eclipse.cbi.p2repo.util/META-INF/MANIFEST.MF +++ b/org.eclipse.cbi.p2repo.util/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: %Bundle-Name Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.cbi.p2repo.util -Bundle-Version: 1.0.400.qualifier +Bundle-Version: 1.1.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-Activator: org.eclipse.cbi.p2repo.util.P2RepoUtil Require-Bundle: org.eclipse.core.runtime diff --git a/org.eclipse.cbi.p2repo.util/about.html b/org.eclipse.cbi.p2repo.util/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.p2repo.util/about.html +++ b/org.eclipse.cbi.p2repo.util/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.p2repo.util/pom.xml b/org.eclipse.cbi.p2repo.util/pom.xml index 003173d3b..52474ecd1 100644 --- a/org.eclipse.cbi.p2repo.util/pom.xml +++ b/org.eclipse.cbi.p2repo.util/pom.xml @@ -2,12 +2,12 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.eclipse.cbi.p2repo.util - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT eclipse-plugin org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT
\ No newline at end of file diff --git a/org.eclipse.cbi.tycho/.settings/org.eclipse.core.resources.prefs b/org.eclipse.cbi.tycho/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/org.eclipse.cbi.tycho/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/org.eclipse.cbi.tycho/about.html b/org.eclipse.cbi.tycho/about.html index 0881ccdec..16e7373a1 100644 --- a/org.eclipse.cbi.tycho/about.html +++ b/org.eclipse.cbi.tycho/about.html @@ -13,7 +13,7 @@

License

The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the -Eclipse Public License Version 2.0("EPL"). A copy of the EPL is available +Eclipse Public License Version 2.0 ("EPL"). A copy of the EPL is available at http://www.eclipse.org/legal/epl-v20.html. For purposes of the EPL, "Program" will mean the Content.

diff --git a/org.eclipse.cbi.tycho/plugin.xml b/org.eclipse.cbi.tycho/plugin.xml index 169c38195..1cb666a02 100644 --- a/org.eclipse.cbi.tycho/plugin.xml +++ b/org.eclipse.cbi.tycho/plugin.xml @@ -19,7 +19,7 @@ point="org.eclipse.ui.commands"> + name="Generate category.xml and pom.xml"> org.eclipse.cbi org.eclipse.cbi.p2repo.releng.parent ../org.eclipse.cbi.p2repo.releng.parent - 1.0.400-SNAPSHOT + 1.1.0-SNAPSHOT
\ No newline at end of file