Enable Builddialog with CreateFileFromTemplateAction to create file with only file extension
Answered
Hi I have managed to implement a FileTemplateGroupDescriptorFactory and an action, which extends CreateFileFromTemplateAction, to create the files. However, the CreateFileFromTemplateDialog that opens up requires a name to be filled out and I would like to create files with no name in other words with only the file extension like for example:
.gitignore
Is there a way I can enable this?
Please sign in to leave a comment.
Does overriding com.intellij.ide.actions.CreateFileFromTemplateDialog#doValidate help?
Hi, no it didn't.
I tried that and tried to just print something to see if I defined it correctly but I never get to the souts. Am I missing something?
public class CreateNoNameFileFromTemplateDialog extends CreateFileFromTemplateDialog {
protected CreateNoNameFileFromTemplateDialog(@NotNull Project project) {
super(project);
System.out.println("construct");
}
@Nullable
@Override
protected ValidationInfo doValidate() {
System.out.println("here");
return null;
}
Please share full sources of your plugin.