ProjectRootManager.getRootFiles(ProjectRootType projectRootType) is deprecated ?
The above call is marked as deprecated in build 922.
What is the legal way now to get the required ProjectRootType ?
In my case I need ProjectRootType.JAVADOC of the current project.
Currently, the following code does the job:
Unfortuately, the second call is deprecated ..
请先登录再写评论。
On 12/13/03 6:24 PM, in article
30058106.1071329075633.JavaMail.javamailuser@localhost, "Evgeny Goldin"
<no_mail@jetbrains.com> wrote:
The following should work:
VirtualFile[] getJavadocRoots(Project project) {
List javadocRoots = new ArrayList]]>();
Module[] modules = ModuleManager.getInstance(project).getModules();
for (int i = 0; i < modules.length; i++) {
Module module = modules+;
OrderEntry[] orderEntries =
ModuleRootManager.getInstance(module).getOrderEntries();
for (int j = 0; j < orderEntries.length; j++) {
OrderEntry orderEntry = orderEntries[j];
javadocRoots.addAll(Arrays.asList(orderEntry.getFiles(OrderRootType.JAVADOC)
));
}
}
return javadocRoots.toArray(new VirtualFile[javadocRoots.size()]);
}
--
Maxim Shafirov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
Thank's ! I'll try it
Yeap, it worked.