我正在编写一个intellij插件。创建 Java 类后,我想在编辑器中打开新创建的文件。我该怎么做?
最佳答案
解决办法如下:
// 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);
关于java - Intellij 插件创建后在编辑器中打开新类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41182034/