--- a/editor.codetemplates/apichanges.xml Wed Apr 24 14:32:02 2013 +0200 +++ a/editor.codetemplates/apichanges.xml Mon Apr 29 10:35:14 2013 +0200 @@ -108,6 +108,24 @@ + + + Added CodeTemplateFilter.ContextBasedFactory. + + + + + + Added interface CodeTemplateFilter.ContextBasedFactory + with the getSupportedContexts() method as an extension + to the exisitng CodeTemplateFilter.Factory + that allows for specifying all the possible context values + valid for the given language (supported by the particular + CodeTemplateFilters that the factory creates). + + + + --- a/editor.codetemplates/nbproject/project.properties Wed Apr 24 14:32:02 2013 +0200 +++ a/editor.codetemplates/nbproject/project.properties Mon Apr 29 10:35:14 2013 +0200 @@ -45,6 +45,6 @@ #javadoc.name=EditorCodeTemplates javadoc.apichanges=${basedir}/apichanges.xml javadoc.arch=${basedir}/arch.xml -spec.version.base=1.33.0 +spec.version.base=1.34.0 test.config.stableBTD.includes=**/*Test.class --- a/editor.codetemplates/src/org/netbeans/lib/editor/codetemplates/spi/CodeTemplateFilter.java Wed Apr 24 14:32:02 2013 +0200 +++ a/editor.codetemplates/src/org/netbeans/lib/editor/codetemplates/spi/CodeTemplateFilter.java Mon Apr 29 10:35:14 2013 +0200 @@ -44,6 +44,7 @@ package org.netbeans.lib.editor.codetemplates.spi; +import java.util.List; import javax.swing.text.JTextComponent; import org.netbeans.lib.editor.codetemplates.api.CodeTemplate; import org.netbeans.spi.editor.mimelookup.MimeLocation; @@ -80,6 +81,24 @@ * @return non-null code template filter instance. */ CodeTemplateFilter createFilter(JTextComponent component, int offset); + } + + /** + * Factory for producing of the code template filters that filter templates + * based on their contexts. + *
+ * It should be registered in the MimeLookup for a given mime-type. + * + * @since 1.34 + */ + @MimeLocation(subfolderName="CodeTemplateFilterFactories") + public interface ContextBasedFactory extends Factory { + /** + * Get the list of all code template contexts supported by filters + * created by the factory. + * @return non-null list of supported contexts. + */ + List getSupportedContexts(); } }