VFS integration question

hi,
can anybody provide a starting guide for creating a plugin that provides a own VFS implementation (e.g. a FTP browser). From what i understand, i need to register the impl. as application component.
but how do i let it show up in the project view? i.e. how do i inject the 'root' file for my protocol?

thanks for any hints.
regards, toby

5 comments
Comment actions Permalink

Hello Tobias,

can anybody provide a starting guide for creating a plugin that
provides a own VFS implementation (e.g. a FTP browser). From what i
understand, i need to register the impl. as application component.

but how do i let it show up in the poject view? i.e. how do i inject
the 'root' file for my protocol?


The project view displays the PSI structure of the project rather than the
VFS, so there's quite a lot more work to do besides implementing VFS if you
want to show your content in project view. The starting point for modifying
the ProjectView structure is the TreeStructureProvider interface.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

cool, thanks so far.
i managed to add a new PSI element to the project view.

in order to populate the VirtualFiles, i implement the TreeStructureProvider.getData() and check for DataConstants.VIRTUAL_FILE. Is this the way to do?

if i need several 'FTP sites' in the view, the virtual file system would not do, since there can only be one per application, right? or would i use the qualified urls as virtual file paths?

what would be the best place to configure (i.e. add/remove) FTP sites that should show up in the project view? could i add them as "Project Source Roots" somehow?

is there as suitable example plugin that does something similar?

thanks for your help.

0
Comment actions Permalink

cool, thanks so far.
i managed to add a new PSI element to the project view.

in order to populate the VirtualFiles, i implement the TreeStructureProvider.getData() and check for DataConstants.VIRTUAL_FILE. Is this the way to do?

if i need several 'FTP sites' in the view, the virtual file system would not do, since there can only be one per application, right? or would i use the qualified urls as virtual file paths?

what would be the best place to configure (i.e. add/remove) FTP sites that should show up in the project view? could i add them as "Project Source Roots" somehow?

is there as suitable example plugin that does something similar?

thanks for your help.

0
Comment actions Permalink

Hello Tobias,

cool, thanks so far.
i managed to add a new PSI element to the project view.
in order to populate the VirtualFiles, i implement the
TreeStructureProvider.getData() and check for
DataConstants.VIRTUAL_FILE. Is this the way to do?


No. This only provides data for actions invoked on your node. To populate
the tree, you need to add child nodes to the node that you add from your
TreeStructureProvider.

if i need several 'FTP sites' in the view, the virtual file system
would not do, since there can only be one per application, right? or
would i use the qualified urls as virtual file paths?


Yes, you should use qualified URLs.

what would be the best place to configure (i.e. add/remove) FTP sites
that should show up in the project view? could i add them as "Project
Source Roots" somehow?


You should probably create a Configurable that will be shown in the Settings
dialog. Project source roots are directories where the source code of the
project is located, which is completely different from what you need.

is there as suitable example plugin that does something similar?


I'm not aware of any such plugins.

--
Dmitry Jemerov
Software Developer
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"


0
Comment actions Permalink

thanks. i think i got it now.
regards, toby

0

Please sign in to leave a comment.