Leveraging existing JSP/Java editing framework for non-file based JSP/Java

I'd like to be able to use the existing infrastructure that is available for editing JSP or Java files on content that is not loaded from the file system. The JSP content will be coming out of a JCR 2.0 compliant repository and if the node I am working with represents a JSP file (or a .java file) I'd like to create a new Editor and load the Editor with the content from the JCR node. At that point, I assume I would listen for events on the Editor to manage the lifecycle.

I've got the JSP content from the JCR node, but I'm not sure exactly what I have to implement in my plugin to get it to display in a window. Can I leverage the existing JSP/Java functionality?

Thanks!

Todd

0
3 comments

Hello Todd,

Yes, of course you can. All you need to do is to implement a custom VirtualFileSystem
and VirtualFile, and give your VirtualFile the extension of .jsp. You can
find multiple examples of VirtualFileSystem implementation in the CE source
code.

I'd like to be able to use the existing infrastructure that is
available for editing JSP or Java files on content that is not loaded
from the file system. The JSP content will be coming out of a JCR 2.0
compliant repository and if the node I am working with represents a
JSP file (or a .java file) I'd like to create a new Editor and load
the Editor with the content from the JCR node. At that point, I assume
I would listen for events on the Editor to manage the lifecycle.

I've got the JSP content from the JCR node, but I'm not sure exactly
what I have to implement in my plugin to get it to display in a
window. Can I leverage the existing JSP/Java functionality?


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


0

Thanks for the pointers, Dmitry

I've been reviewing the CE source code but I am not sure I'm clear on the usage of the VirtualFileSystem. I've created a stub implementation of VirtualFileSystem and VirtualFile to see how they are called and used, but I can't get IntelliJ to accept my virtualFileSystem extension point in the plugin.xml.

I've added the virtualFileSystem line to my plugin.xml, but the word virtualFIleSystem is in red and the error is "Element virtualFileSystem is not allowed here".

Thanks!

Todd

<idea-plugin version="2">   <name>CRXPlugin</name>   <description>short description of the plugin</description>   <version>1.0</version>   <vendor>Meredith</vendor>   <application-components>       <component>         <interface-class>com.meredith.devtools.intellij.crx.CrxApplicationComponent</interface-class>         <implementation-class>com.meredith.devtools.intellij.crx.CrxApplicationComponent</implementation-class>       </component>   </application-components>   <project-components>     <!-- Add your project components here -->       <component>           <implementation-class>com.meredith.devtools.intellij.crx.CrxIdeaProject</implementation-class>       </component>   </project-components>   <actions>     <!-- Add your actions here -->   </actions>   <extensions defaultExtensionNs="com.intellij">       <applicationService serviceInterface="com.meredith.devtools.intellij.crx.repository.CrxRepositoryImpl"                      serviceImplementation="com.meredith.devtools.intellij.crx.repository.CrxRepositoryImpl"/>     <!-- Add your extensions here -->       <toolWindow           id="CRX Repository Tree"           anchor="left"           secondary="true"           factoryClass="com.meredith.devtools.intellij.crx.toolwindow.CrxTreeToolWindowFactory">       </toolWindow>       <toolWindow           id="CRX Property View"           anchor="bottom"           secondary="true"           factoryClass="com.meredith.devtools.intellij.crx.toolwindow.CrxPropertyToolWindowFactory">       </toolWindow>       <virtualFileSystem key="crx" implementationClass="com.meredith.devtools.intellij.crx.vfs.CrxVirtualFileSystem"/>   </extensions> </idea-plugin>

0

Hello Todd,

Registering a VirtualFileSystem as an extension is only supported in IDEA
11. If you're targeting IDEA 10.5 or earlier, your VirtualFileSystem implementation
needs to be an application component.

Thanks for the pointers, Dmitry

I've been reviewing the CE source code but I am not sure I'm clear on
the usage of the VirtualFileSystem. I've created a stub implementation
of VirtualFileSystem and VirtualFile to see how they are called and
used, but I can't get IntelliJ to accept my virtualFileSystem
extension point in the plugin.xml.

I've added the virtualFileSystem line to my plugin.xml, but the word
virtualFIleSystem is in red and the error is "Element
virtualFileSystem is not allowed here".

Thanks!

Todd

> CRXPlugin
> short description of the plugin
> 1.0
> Meredith
> 
> 
> 
> com.meredith.devtools.intellij.crx.CrxApplicationComp
> onent
> 
> com.meredith.devtools.intellij.crx.CrxApplicatio
> nComponent
> 
> 
> 
> > 
> 
> com.meredith.devtools.intellij.crx.CrxIdeaProjec
> t
> 
> 
> 
> > 
> 
>  serviceInterface="com.meredith.devtools.intellij.crx.repository.CrxRep
> ositoryImpl"
> 
> serviceImplementation="com.meredith.devtools.intellij.crx.repository.C
> rxRepositoryImpl"/>
> >  id="CRX Repository Tree"
> anchor="left"
> secondary="true"
> 
> factoryClass="com.meredith.devtools.intellij.crx.toolwindow.CrxTreeToo
> lWindowFactory">
> 
>  id="CRX Property View"
> anchor="bottom"
> secondary="true"
> 
> factoryClass="com.meredith.devtools.intellij.crx.toolwindow.CrxPropert
> yToolWindowFactory">
> 
>  implementationClass="com.meredith.devtools.intellij.crx.vfs.CrxVirtual
> FileSystem"/>
> 
> ]]>

---
Original message URL:
http://devnet.jetbrains.net/message/5316961#5316961


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


0

Please sign in to leave a comment.