|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gjt.sp.util.HtmlUtilities
public class HtmlUtilities
HTML utility methods for conversion of strings to HTML and highlighting matches in search results. Some of these methods were moved here from HyperSearchResults.HighlightingTree to make them available for plugins.
Constructor Summary | |
---|---|
HtmlUtilities()
|
Method Summary | |
---|---|
static void |
appendString2html(java.lang.StringBuilder sb,
java.lang.String s)
Appends a given non-HTML string to an HTML string, translating character entities to the appropriate HTML form. |
static java.lang.String |
highlightString(java.lang.String s,
java.lang.String styleTag,
java.util.List<java.lang.Integer> ranges)
Creates an HTML presentation of a given string, where selected substrings are highlighted with a given syntax style tag. |
static SyntaxStyle |
parseHighlightStyle(java.lang.String style,
java.awt.Font f)
Parses a string specifying a syntax highlight style. |
static java.lang.String |
style2html(java.lang.String prop,
java.awt.Font f)
Parses a string specifying a syntax highlight style, and creates an HTML representation for it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HtmlUtilities()
Method Detail |
---|
public static SyntaxStyle parseHighlightStyle(java.lang.String style, java.awt.Font f)
style
- The syntax highlight style string.f
- The font to which the syntax style will apply.
public static java.lang.String style2html(java.lang.String prop, java.awt.Font f)
prop
- The syntax highlight style string.f
- The font to which the syntax style will apply.
public static java.lang.String highlightString(java.lang.String s, java.lang.String styleTag, java.util.List<java.lang.Integer> ranges)
s
- The (non-HTML) string to highlight.styleTag
- The HTML string representing the highlight style.ranges
- The indices of the substrings to highlight, in pairs: The start
index of a substring followed by the end index of the substring.
public static void appendString2html(java.lang.StringBuilder sb, java.lang.String s)
sb
- The HTML string to which the non-HTML string is appended.s
- The non-HTML string to append.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |