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?

3 comments

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.

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?

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

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


0

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?

0

Hello Ken,

I'm looking for an example of how to override how folding is done for
(say) javadoc.  I cant  find one.


See the FoldingBuilder API. Foldings from multiple folding builders for the
same language are combined.

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?


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!"


0

Please sign in to leave a comment.