diff --git a/projectapi/apichanges.xml b/projectapi/apichanges.xml --- a/projectapi/apichanges.xml +++ b/projectapi/apichanges.xml @@ -108,6 +108,34 @@ + + + Changed LookupProvider.Registration.ProjectType.position default value + + + + +

+ Behavioral change is that recompiled services with no explicit position will now be at 0 rather than MAX_VALUE, + meaning they will be ahead of rather than behind services with an explicit positive value. + The position 0 is a new default even for ProjectServiceProvider, LookupProvider.Registration + and LookupMerger.Registration which does not use LookupProvider.Registration.ProjectType. +

+
+ +

+ Changed the default value of the LookupProvider.Registration.ProjectType.position + from Integer.MAX_VALUE to 0. The reason for this change is to allow client to specify an ordering among + services without a need to order all services contributed into Project's lookup. Without this change warnings + from warnings from org.openide.filesystems.Ordering will be printed if some but not all services + for a given project type specified an order. +

+
+ + + + +
Added LookupProviderSupport.createActionProviderMerger factory method diff --git a/projectapi/manifest.mf b/projectapi/manifest.mf --- a/projectapi/manifest.mf +++ b/projectapi/manifest.mf @@ -1,7 +1,7 @@ Manifest-Version: 1.0 OpenIDE-Module: org.netbeans.modules.projectapi/1 OpenIDE-Module-Install: org/netbeans/modules/projectapi/Installer.class -OpenIDE-Module-Specification-Version: 1.38 +OpenIDE-Module-Specification-Version: 1.39 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectapi/Bundle.properties OpenIDE-Module-Layer: org/netbeans/modules/projectapi/layer.xml diff --git a/projectapi/src/org/netbeans/modules/projectapi/LookupProviderAnnotationProcessor.java b/projectapi/src/org/netbeans/modules/projectapi/LookupProviderAnnotationProcessor.java --- a/projectapi/src/org/netbeans/modules/projectapi/LookupProviderAnnotationProcessor.java +++ b/projectapi/src/org/netbeans/modules/projectapi/LookupProviderAnnotationProcessor.java @@ -99,7 +99,7 @@ throw new LayerGenerationException("You must specify either projectType or projectTypes", e, processingEnv, lpr); } for (String type : lpr.projectType()) { - layer(e).instanceFile("Projects/" + type + "/Lookup", null, LookupProvider.class, lpr, null).write(); + layer(e).instanceFile("Projects/" + type + "/Lookup", null, LookupProvider.class, lpr, null).position(0).write(); } for (LookupProvider.Registration.ProjectType type : lpr.projectTypes()) { layer(e).instanceFile("Projects/" + type.id() + "/Lookup", null, LookupProvider.class, type, null).position(type.position()).write(); @@ -131,7 +131,8 @@ LayerBuilder.File f = layer(e).file("Projects/" + type + "/Lookup/" + fileBaseName + ".instance"). methodvalue("instanceCreate", LazyLookupProviders.class.getName(), "forProjectServiceProvider"). stringvalue("class", binAndMethodNames[0]). - stringvalue("service", servicesBinName); + stringvalue("service", servicesBinName). + position(0); if (binAndMethodNames[1] != null) { f.stringvalue("method", binAndMethodNames[1]); } @@ -174,6 +175,7 @@ methodvalue("instanceCreate", LazyLookupProviders.class.getName(), "forLookupMerger"). instanceAttribute("lookupMergerInstance", LookupMerger.class). stringvalue("service", serviceBinName). + position(0). write(); } for (LookupProvider.Registration.ProjectType type : lmr.projectTypes()) { diff --git a/projectapi/src/org/netbeans/spi/project/LookupProvider.java b/projectapi/src/org/netbeans/spi/project/LookupProvider.java --- a/projectapi/src/org/netbeans/spi/project/LookupProvider.java +++ b/projectapi/src/org/netbeans/spi/project/LookupProvider.java @@ -109,7 +109,7 @@ /** * Optional ordering. */ - int position() default Integer.MAX_VALUE; + int position() default 0; } }