【问题标题】:Intellij plugin open new class in editor after creationIntellij 插件创建后在编辑器中打开新类
【发布时间】:2016-12-16 10:15:33
【问题描述】:

我正在编写一个 intellij 插件。创建 Java 类后,我想在编辑器中打开新创建的文件。我该怎么办?

【问题讨论】:

    标签: java intellij-idea intellij-plugin


    【解决方案1】:

    解决方法如下:

     // we create the actual class
     final VirtualFile newFile = JavaDirectoryService.getInstance().createClass(directory, className, templateName).getContainingFile().getVirtualFile();
     // open to the new file in the editor
     FileEditorManager.getInstance(project).openFile(newFile, true, true);
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-08-15
      • 1970-01-01
      • 2014-09-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多