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:

public class LookupProviderImpl implements LookupProvider {

    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.


Splendid! Finally, minimal layer file encounters.

Posted by Rohan Ranade on November 12, 2008 at 07:17 AM PST #

Btw, it wouldn't be too difficult to produce a completion provider which suggests the project types based on the project types registered, or would it? Would be a fantastic add on for module development IMO.

Posted by Rohan Ranade on November 12, 2008 at 07:19 AM PST #

Post a Comment:
  • HTML Syntax: NOT allowed

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.


« November 2015