Tabnine Logo
CreateFileFromTemplateAction.createFileFromTemplate
Code IndexAdd Tabnine to your IDE (free)

How to use
createFileFromTemplate
method
in
com.intellij.ide.actions.CreateFileFromTemplateAction

Best Java code snippets using com.intellij.ide.actions.CreateFileFromTemplateAction.createFileFromTemplate (Showing top 2 results out of 315)

origin: go-lang-plugin-org/go-lang-idea-plugin

 private static void doTemplateTest(@NotNull PsiDirectory dir, @NotNull String newFileName, @NotNull String expectedPackage, @NotNull  CustomFileTemplate template) {
  GoFile file = (GoFile)CreateFileFromTemplateAction.createFileFromTemplate(newFileName, template, dir, null, true);
  assertNotNull(file);
  assertEquals(expectedPackage, file.getPackageName());
  WriteCommandAction.runWriteCommandAction(dir.getProject(), file::delete);
 }
}
origin: Camelcade/Perl5-IDEA

 @Override
 protected PsiFile createFileFromTemplate(String name, FileTemplate template, PsiDirectory dir) {
  final List<String> pathChunks = new ArrayList<>();

  if (StringUtil.contains(name, PerlPackageUtil.PACKAGE_SEPARATOR)) {
   pathChunks.addAll(StringUtil.split(name, PerlPackageUtil.PACKAGE_SEPARATOR));
  }
  else if (StringUtil.contains(name, "/")) {
   pathChunks.addAll(StringUtil.split(name, "/"));
  }
  else {
   pathChunks.add(name);
  }
  name = pathChunks.remove(pathChunks.size() - 1);

  for (String pathChunk : pathChunks) {
   if (StringUtil.isNotEmpty(pathChunk)) {
    final PsiDirectory sub = dir.findSubdirectory(pathChunk);
    dir = sub == null ? dir.createSubdirectory(pathChunk) : sub;
   }
  }
  return super.createFileFromTemplate(name, template, dir);
 }
}
com.intellij.ide.actionsCreateFileFromTemplateActioncreateFileFromTemplate

Popular methods of CreateFileFromTemplateAction

  • isAvailable
  • postProcess

Popular in Java

  • Making http post requests using okhttp
  • getApplicationContext (Context)
  • setContentView (Activity)
  • getResourceAsStream (ClassLoader)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Dictionary (java.util)
    Note: Do not use this class since it is obsolete. Please use the Map interface for new implementatio
  • Option (scala)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now