Hi

I posted an idea similar to this before, but I came across something today
that made me think about it some more.

In the new JSP spec, there is provision to write the entire page in XML. As
a result, the short <%= ... %> syntax is replaced by
<jsp:expression>...</jsp:expression>.  This is fine in principal, but in
the everyday writing of JSP pages, the syntax is too long and obtrusive in
editors.  I'd like to be able to choose a different way of displaying this
construct -- using visual highlighting features like coloured text and
backgrounds.  IDEA is a visual editor, after all.

Suppose I have the following:

     Hello <jsp:expression>  userProfile.getDisplayName()
</jsp:expression>, Welcome Back!

Long and ugly, right?  I select the whole expression tag, and choose an
"Alternative Representation" for that block of code.   This is simply a
regular expression:

     "<jsp:expression>(.*)</jsp:expression>"

I also give a formatting spec, which says how I want the block I selected
to be actually displayed:

     "display with a green background the contents of group 1".

So what I would see would be

     Hello userProfile.getDisplayName(), Welcome Back!

(The userProfile.getDisplayName() would, obviously, be in green).  In the
editor, the part that was replaced would be obvious, and would be so much
easier to scan in the editor, and to edit.  I'd be able to say what I
actually *mean*, rather than letting the syntax get in the way.

In the example above, there'd be a way of configuring the editor to add
this alternative view as I typed it, of course, as well as a drop-down list
of presets I can choose from.  The area would remain 'live', and I'd be
able to change the text in the green part and the contents of the
jsp:expression tag would change.  I'd also probably expect to be able to
hover over the green part to show the full version.

I hope this is clear; I'd appreciate comments on this.   In the previous
mails I sent on this subject, I gave several other applications of this,
including Java code comments, <xsl:value-of> tags in XSLT and others.

Cheers.
Ben,




_______________________________________________
Eap-features mailing list
[EMAIL PROTECTED]
http://www.intellij.com/mailman/listinfo/eap-features

Reply via email to