Taking over a segment of a Java file
I want to take over the display and editing of segments of a java file; specifically, javadoc comments with a certain doc tag in them. My idea is that when a doc comment has that tag, it would be displayed as its generated output, not its raw HTML input; when being edited a new window would pop up that was more like an HTML-only editor that understood javadoc, that I could control formatting/style of the comment, etc.
Is there a way to get this deep into how IntelliJ understands Java files? If not, how close might I get?
Please sign in to leave a comment.
Hello Ken,
The only way to modify how a segment of a source file is displayed is the
folding API, and I don't think it's rich enough to do what you want. You
can play around with the CE codebase to see if you can hack it into doing
what you need, though.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
I'm looking for an example of how to override how folding is done for (say) javadoc. I cant find one.
On a possibly related subject, I was just noticing how @PropertyKey results in an abbreviation of resource bundle access in code — instead of the lookup key, you see the message in a language. How is that done?
Hello Ken,
See the FoldingBuilder API. Foldings from multiple folding builders for the
same language are combined.
That's also done via folding - see PropertyFoldingBuilder in the CE source
(java-i18n plugin).
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"