Plugin Capabilities

Hello

I'm new to plug-in development. I have a new project which I think lends itself to being a plug-in rather than a stand-alone tool. I'd appreciate input from anyone who can comment on the viability of what I propose to do. So, here goes....

I'm working on an abstract approach to modelling certain types of software. The model is stored in an .xml file and is visualised in a graphical UML-like way. (The visualization is similar to a UML class diagram but I am NOT implementing yet another UML visualization tool!.)

Capability 1: Associate a particular .XML file (extension can be specific) with a visual renderer which can parse the file and provide an interactive view of it as a Tab in IntelliJ.

What is important here is the association. I'm already working on the visualization component itself but currently as a stand-alone Swing application and not a plug-in.

Editing the model via the visualization results in changes to code generated from the model.

Capability 2: Have the component which is visualizing the model .xml file write code to files which are part of the IntelliJ source tree, which might or might not already be open in IntelliJ.

The generated files are not intended to be hand-edited, so overwriting changes is fine. I can write the code generation, but I need to get a handle to a FileOutputStream corresponding to, say, "com/robin/Employee.java". This might be interesting where there are a number of source paths defined in the IntelliJ project, and where a new file must be created and an appropriate source path chosen, etc. etc.

Some elements of the model represent "placeholders" for custom coding (the hand-written stuff) which takes place in subclasses of the generated classes.

Capability 3: When specific UI gestures are given to the visualization component, ask IntelliJ to go to (or open) the Editor tab for a class (e.g. com.robin.EmployeeImpl) and go to the line at which a specified method is declared.

This is essentially for ease of navigation - select a behavioural item in the visual model and have the code editor go to the corresponding method declaration, etc. etc.

So, those are the 3 capabilities I think I will need. The visualization itself is going well and the code-generation is old-hat. If I can do these three, then I can stop writing File->Open actions and concentrate on the visualization component itself.

Thanks in advance, Robin.

2 comments

Robin Roos wrote:

Capability 1: Associate a particular .XML file (extension can
be specific) with a visual renderer which can parse the file and
provide an interactive view of it as a Tab in IntelliJ.


Yes, this is possible, but the extension would have to be a custom file
extension. To open any .xml file this would require some variation of
implementation of http://www.jetbrains.net/jira/browse/IDEA-4712

Capability 2: Have the component which is visualizing the
model .xml file write code to files which are part of the IntelliJ
source tree, which might or might not already be open in IntelliJ.


This is easy. There is also a rich sourcepath/contentroot API which you
could use to provide special logic for finding the right source path.

Capability 3: When specific UI gestures are given to the
visualization component, ask IntelliJ to go to (or open) the Editor
tab for a class (e.g. com.robin.EmployeeImpl) and go to the line at
which a specified method is declared.


This is easy as well, there is a rich editor API and windowing API.

0

Thanks Keith.

I will choose a specific extension for the model definition file, which happens to use XML grammar internally. That way I can keep life simple.

Thanks for the confirmation and for the pointers.

0

Please sign in to leave a comment.