How to get the list of files in a Project?
I've got a Project object, and want all of it's children files. Apparently
VirtualFile.getChildren only returns results for a directory. I can't seem
to find any other way to get the project's files...
Any help would be greatly appreciated
Thanks,
harpstein
Please sign in to leave a comment.
Harpstein wrote:
There is no notion of project children, not in the VFS sense anyway.
Project currently consists of modules, to get them use
com.intellij.openapi.module.ModuleManager.
Use com.intellij.openapi.roots.ModuleRootManager to get module content,
source roots etc. See javadocs there for more info.
Hope this helps,
Friendly,
Dmitry
--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Where is this ModuleManager? It's not documented, and I can't find it in any
of the jar files in the lib directory...
I'm using IDEA 3.0, if that matters
-matt
"Dmitry Lomov (JetBrains)" <Dmitry.Lomov@jetbrains.com> wrote in message
news:bn39bd$mb9$1@is.intellij.net...
>
Apparently
seem
>
>
>
>
>
Ah. It was assumed you were using the EAP.
I think there's something like RootManager or ProjectManager in that version...
Harpstein wrote:
>>Harpstein wrote:
>>
>>
>>>I've got a Project object, and want all of it's children files.
>>>VirtualFile.getChildren only returns results for a directory. I can't
>>>to find any other way to get the project's files...
>>>
>>>Any help would be greatly appreciated
>>
>>There is no notion of project children, not in the VFS sense anyway.
>>Project currently consists of modules, to get them use
>>com.intellij.openapi.module.ModuleManager.
>>Use com.intellij.openapi.roots.ModuleRootManager to get module content,
>>source roots etc. See javadocs there for more info.
>>
>>Hope this helps,
>>
>>Friendly,
>>Dmitry
>>
>>
>>--
>>Dmitry Lomov
>>IntelliJ Labs / JetBrains Inc.
>>http://www.intellij.com
>>"Develop with pleasure!"
--
Erb
==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================
Harpstein wrote:
Oh sorry, I indeed assumed that you use EAP. In 3.0, use ProjectRootManager.
Do you have any special reason to target 3.0 in your plugin? I guess with
4.0 coming out pretty soon and OpenAPI in 4.0 being quite reworked,
targeting 4.0 is better choice...
Friendly,
Dmitry
I guess targeting
>> Harpstein wrote:
>>
>> > I've got a Project object, and want all of it's children files.
>> > VirtualFile.getChildren only returns results for a directory. I can't
>> > to find any other way to get the project's files...
>> >
>> > Any help would be greatly appreciated
>>
>> There is no notion of project children, not in the VFS sense anyway.
>> Project currently consists of modules, to get them use
>> com.intellij.openapi.module.ModuleManager.
>> Use com.intellij.openapi.roots.ModuleRootManager to get module content,
>> source roots etc. See javadocs there for more info.
>>
>> Hope this helps,
>>
>> Friendly,
>> Dmitry
>>
>>
>> --
>> Dmitry Lomov
>> IntelliJ Labs / JetBrains Inc.
>> http://www.intellij.com
>> "Develop with pleasure!"
--
Dmitry Lomov
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"
Really "pretty soon"? I'd say at least 2 months down the road, based on
completed features and bug state...
Dmitry Lomov (JetBrains) wrote:
>>Where is this ModuleManager? It's not documented, and I can't find it in
>>any of the jar files in the lib directory...
>>
>>I'm using IDEA 3.0, if that matters
>>
>>-matt
>>"Dmitry Lomov (JetBrains)" <Dmitry.Lomov@jetbrains.com> wrote in message
>>news:bn39bd$mb9$1@is.intellij.net...
>>
>>>Harpstein wrote:
>>>
>>>
>>>>I've got a Project object, and want all of it's children files.
>>
>>Apparently
>>
>>>>VirtualFile.getChildren only returns results for a directory. I can't
>>
>>seem
>>
>>>>to find any other way to get the project's files...
>>>>
>>>>Any help would be greatly appreciated
>>>
>>>There is no notion of project children, not in the VFS sense anyway.
>>>Project currently consists of modules, to get them use
>>>com.intellij.openapi.module.ModuleManager.
>>>Use com.intellij.openapi.roots.ModuleRootManager to get module content,
>>>source roots etc. See javadocs there for more info.
>>>
>>>Hope this helps,
>>>
>>>Friendly,
>>>Dmitry
>>>
>>>
>>>--
>>>Dmitry Lomov
>>>IntelliJ Labs / JetBrains Inc.
>>>http://www.intellij.com
>>>"Develop with pleasure!"
--
Erb
==============================================================
"Most of you are familiar with the virtues of a programmer.
There are three, of course: laziness, impatience, and hubris."
- Larry Wall
==============================================================