【发布时间】:2016-12-16 10:15:33
【问题描述】:
我正在编写一个 intellij 插件。创建 Java 类后,我想在编辑器中打开新创建的文件。我该怎么办?
【问题讨论】:
标签: java intellij-idea intellij-plugin
我正在编写一个 intellij 插件。创建 Java 类后,我想在编辑器中打开新创建的文件。我该怎么办?
【问题讨论】:
标签: java intellij-idea intellij-plugin
解决方法如下:
// 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);
【讨论】: