New Plugin for Webmacro

I am interested in writing a plugin for webmacro (a templating engine like velocity). I have looked briefly at the documentation but would just like a point in the right direction.

In its simplest form I want to add navigation on webmacro's "macro" functionality. In webmacro you can create a kind of function called a macro that would for example display a common table header. We have libraries of these things.

From a template you would just write #commonTableHeader() and it will spit out the contents of the macro when it is parsed. What I need to do is parse the collection of macro files (all ending in .wmm) and locate each macro. Then when a user holds down "ctrl" and clicks on the macro in any given template it takes you to the code for that macro.

My question is this, what classes should I be looking at to get this type of functionality? Is there any other plugins that have similar behaviour to what I require? I have looked through each plugins description but not really found one that does anything similar, but I may have missed something.

Any help would be much appreciated.

Thanks in advance, Laurence

4 comments
Comment actions Permalink

With the PropertiesEditor plugin, ctrl + middle-click on a String goes
to the properties file where it is defined.

BoD


Laurence Smith wrote:

I am interested in writing a plugin for webmacro (a templating engine like velocity). I have looked briefly at the documentation but would just like a point in the right direction.

In its simplest form I want to add navigation on webmacro's "macro" functionality. In webmacro you can create a kind of function called a macro that would for example display a common table header. We have libraries of these things.

From a template you would just write #commonTableHeader() and it will spit out the contents of the macro when it is parsed. What I need to do is parse the collection of macro files (all ending in .wmm) and locate each macro. Then when a user holds down "ctrl" and clicks on the macro in any given template it takes you to the code for that macro.

My question is this, what classes should I be looking at to get this type of functionality? Is there any other plugins that have similar behaviour to what I require? I have looked through each plugins description but not really found one that does anything similar, but I may have missed something.

Any help would be much appreciated.

Thanks in advance, Laurence

0
Comment actions Permalink

Great, but the source code is not available! Short of decompiling...

Unless anyone knows where I can obtain it?

0
Comment actions Permalink

Dmitry Kashin made this plugin.
I'm sure he's reading this forum ;)

BoD


Laurence Smith wrote:
>

Great, but the source code is not available! Short of decompiling...

Unless anyone knows where I can obtain it?

0
Comment actions Permalink

Try something like this to open file in specified position:
VirtualFile virtualFile = FileDocumentManager.getInstance().getFile(
propertiesFileDocument.getDocument());
OpenFileDescriptor openfiledescr = new OpenFileDescriptor(virtualFile,
propertiesFileDocument.getPropertiesFile().findPropertyItemWithName(selectedPropertyName).getTextOffset());
FileEditorManager.getInstance(myProject).openTextEditor(openfiledescr,
false);

If you have questions fill free to ask.

TIA,
Dmitry

0

Please sign in to leave a comment.