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? 

1
3 comments

Does overriding com.intellij.ide.actions.CreateFileFromTemplateDialog#doValidate help?

0

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;
}
0

Please share full sources of your plugin.

0

Please sign in to leave a comment.