Wednesday Nov 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.

About

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.

Search

Archives
« November 2008 »
SunMonTueWedThuFriSat
      
4
7
15
16
17
20
22
23
25
27
29
30
      
Today