X

Geertjan's Blog

  • November 12, 2008

@org.netbeans.spi.project.LookupProvider.Registration

Geertjan Wielenga
Product Manager
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.

Join the discussion

Comments ( 2 )
  • Rohan Ranade Wednesday, November 12, 2008

    Splendid! Finally, minimal layer file encounters.


  • Rohan Ranade Wednesday, November 12, 2008

    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.


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha