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 ..

3 comments

On 12/13/03 6:24 PM, in article
30058106.1071329075633.JavaMail.javamailuser@localhost, "Evgeny Goldin"
<no_mail@jetbrains.com> wrote:

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:

 VirtualFile[] files = prm.getRootFiles( ProjectRootType.JAVADOC );]]>


Unfortuately, the second call is deprecated ..


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!"


0

Please sign in to leave a comment.