Java Code Examples for com.intellij.ide.fileTemplates.FileTemplate#isTemplateOfType()

The following examples show how to use com.intellij.ide.fileTemplates.FileTemplate#isTemplateOfType() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: NodeTypeCreateFromTemplateHandler.java    From intellij-neos with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean handlesTemplate(FileTemplate template) {
    return template.isTemplateOfType(YAMLFileType.YML) && (template.getName().equals(CreateNodeTypeDefinition.NODE_TYPE_TEMPLATE_NAME)
            || template.getName().equals(CreateNodeTypeDefinition.DOCUMENT_NODE_TYPE_TEMPLATE_NAME)
            || template.getName().equals(CreateNodeTypeDefinition.CONTENT_NODE_TYPE_TEMPLATE_NAME)
            || template.getName().equals(CreateNodeTypeDefinition.COLLECTION_NODE_TYPE_TEMPLATE_NAME)
            || template.getName().equals(CreateNodeTypeDefinition.MIXIN_NODE_TYPE_TEMPLATE_NAME)
            || template.getName().equals(CreateNodeTypeDefinition.CONSTRAINT_NODE_TYPE_TEMPLATE_NAME));
}
 
Example 2
Source File: GLSLCreateFromTemplateHandler.java    From glsl4idea with GNU Lesser General Public License v3.0 5 votes vote down vote up
private static void addTemplates(Map<String, FileTemplate> result, FileTemplate[] templates){
    for(FileTemplate template:templates){
        if(template.isTemplateOfType(GLSLSupportLoader.GLSL) && GLSLFileType.EXTENSIONS.contains(template.getExtension())){
            FileTemplate existing = result.get(template.getExtension());
            if(existing == null){
                //Do not replace existing templates to keep well defined priority order
                result.put(template.getExtension(), template);
            }
        }
    }
}
 
Example 3
Source File: FusionCreateFromTemplateHandler.java    From intellij-neos with GNU General Public License v3.0 4 votes vote down vote up
@Override
public boolean handlesTemplate(FileTemplate template) {
    return template.isTemplateOfType(FusionFileType.INSTANCE);
}
 
Example 4
Source File: GLSLCreateFromTemplateHandler.java    From glsl4idea with GNU Lesser General Public License v3.0 4 votes vote down vote up
@Override
public boolean handlesTemplate(@NotNull FileTemplate template) {
    return template.isTemplateOfType(GLSLSupportLoader.GLSL);
}