Package sc.parser
Class RangeStyleAdapter
- java.lang.Object
-
- sc.parser.RangeStyleAdapter
-
- All Implemented Interfaces:
IStyleAdapter
public abstract class RangeStyleAdapter extends java.lang.Object implements IStyleAdapter
Used by IDE integrations to hook into the parselets style engine. You extend this class, override the styleMatched method, and call "styleNode".
-
-
Constructor Summary
Constructors Constructor Description RangeStyleAdapter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
getNeedsFormattedString()
For styling in HTML, the styleString method returns the styled string.void
setFormatContext(FormatContext ctx)
void
styleEnd(java.lang.String styleName)
abstract void
styleMatched(java.lang.String styleName, java.lang.String styleDesc, int startOffset, int endOffset)
void
styleStart(java.lang.String styleName)
void
styleString(java.lang.CharSequence codeOut, boolean escape, java.lang.String styleName, java.lang.String styleDesc)
Adds a style for the text range specified.
-
-
-
Method Detail
-
getNeedsFormattedString
public boolean getNeedsFormattedString()
Description copied from interface:IStyleAdapter
For styling in HTML, the styleString method returns the styled string. For IDEs, it's api drive so no result string is required.- Specified by:
getNeedsFormattedString
in interfaceIStyleAdapter
-
setFormatContext
public void setFormatContext(FormatContext ctx)
- Specified by:
setFormatContext
in interfaceIStyleAdapter
-
styleStart
public void styleStart(java.lang.String styleName)
- Specified by:
styleStart
in interfaceIStyleAdapter
-
styleEnd
public void styleEnd(java.lang.String styleName)
- Specified by:
styleEnd
in interfaceIStyleAdapter
-
styleMatched
public abstract void styleMatched(java.lang.String styleName, java.lang.String styleDesc, int startOffset, int endOffset)
-
styleString
public void styleString(java.lang.CharSequence codeOut, boolean escape, java.lang.String styleName, java.lang.String styleDesc)
Description copied from interface:IStyleAdapter
Adds a style for the text range specified. If needsFormattedString is true, the result is used to accumulate the result string.- Specified by:
styleString
in interfaceIStyleAdapter
-
-