Wednesday November 12, 2008
@org.netbeans.spi.project.LookupProvider.Registration
It's been possible since 6.1 to extend an existing project type's Lookup, by means of the layer.xml file. The NetBeans Project Type Extension Module Tutorial provides all the details. From today onwards (as recorded in the NetBeans API Changes document), however, in line with the annotation-based approach for registration of NetBeans artifacts, as introduced here in a recent blog entry, it is also possible to register Lookups via an annotation (instead of via the layer.xml).
So, the example in the tutorial can now (from 7.0 onwards, anyway, since it's in the development build from today, which is therefore not part of 6.5) be rewritten as follows:
@org.netbeans.spi.project.LookupProvider.Registration(projectType="org-netbeans-modules-web-project")
public class LookupProviderImpl implements LookupProvider {
@Override
public Lookup createAdditionalLookup(Lookup lookup) {
...
...
...
Therefore, note the new annotation above for project type Lookup extensions. By the way, I've actually tried the above in a build from a few hours ago, and it works exactly as advertized. Read here for the rewritten Lookup extension for Java project types, in order to support, for example, Groovy, as well as the issue itself, which is issue 152392.
Nov 12 2008, 12:20:14 PM PST Permalink


