Olivier Schmitt from the French Ministry of Agriculture has forked and enhanced the code I recently blogged about for creating annotations for generating code completion support for NetBeans-based editors.
His fork is here:
He reports that "the new thing is about telling the completion provider registration layer what is 'source' for completion items. My idea is to use URI 'a la Apache Camel' to declare item provider sources:"
@AttributeCompletionRegistrations({ @AttributeCompletionRegistration( id = "jee-architect-cookbook-netbeans-iso6391-LanguageAttributeCompletionProvider", attribute = "lang", iconBase = "jee/architect/cookbook/netbeans/iso6391/bubble.png", content = "csv:jee/architect/cookbook/netbeans/iso6391/ISO6391.csv"), @AttributeCompletionRegistration( id = "jee-architect-cookbook-netbeans-iso6391-CountriesAttributeCompletionProvider", attribute = "accesskey", iconBase = "jee/architect/cookbook/netbeans/iso6391/bubble.png", content = "rest:http://api.worldbank.org/country?format=json"), @AttributeCompletionRegistration( id = "jee-architect-cookbook-netbeans-iso6391-BlaAttributeCompletionProvider", attribute = "bla", iconBase = "jee/architect/cookbook/netbeans/iso6391/bubble.png", content = "raw:tom,dick,harry"), @AttributeCompletionRegistration( id = "jee-architect-cookbook-netbeans-iso6391-CountriesAttributeCompletionProvider", attribute = "bla2", iconBase = "jee/architect/cookbook/netbeans/iso6391/bubble.png", content = "bean:jee.architect.cookbook.netbeans.iso6391.Bla2CompletionItemProvider") }) package jee.architect.cookbook.netbeans.iso6391; import org.netbeans.spi.editor.completion.xhtml.api.AttributeCompletionRegistration; import org.netbeans.spi.editor.completion.xhtml.api.AttributeCompletionRegistrations;
Source of the above:
Olivier says that he thinks "there should be a strong separation between UI artifacts and source provider artifacts. So, the content URI just tells how to get items and not how to render them."
Sounds like a great enhancement!