DevFaqAddFileTemplateToNewFileContentMenu

How can I define the available File types when the user right-clicks the project folder and chooses "New"?

See documentation of "Privileged and Recommended Templates" at http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectuiapi/org/netbeans/spi/project/ui/templates/support/package-summary.html

Example:

import org.netbeans.spi.project.ProjectServiceProvider;
import org.netbeans.spi.project.ui.PrivilegedTemplates;

@ProjectServiceProvider(projectType = "org-netbeans-modules-cnd-makeproject", service = PrivilegedTemplates.class)
public class NescPrivilegedTemplates implements PrivilegedTemplates {

    private static final String[] PRIVILEGED_NAMES = new String[]{
        "Templates/Nesc/EmptyTemplate.nc",
        "Templates/Nesc/SimpleTemplate.nc",
    };

    @Override
    public String[] getPrivilegedTemplates() {
        return PRIVILEGED_NAMES;
    }

} 

Taken from Geertjan @ dev@platform.netbeans.org

Further examples:

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo