|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.comedia.text.CAbstractHighlighter
Presents an abstract highlighter for CSyntaxEditor. This highlighter is used to highlight a text while editing according mappings for different program languages.
Field Summary | |
protected javax.swing.text.MutableAttributeSet |
commentAttr
The comment attribute. |
protected javax.swing.text.MutableAttributeSet |
delimAttr
The delimiters attribute. |
protected javax.swing.text.MutableAttributeSet |
identAttr
The identificator attribute. |
protected javax.swing.text.MutableAttributeSet |
keywordAttr
The keyword attribute. |
protected javax.swing.text.MutableAttributeSet |
numberAttr
The number attribute. |
protected org.comedia.util.scanner.CScanner |
scanner
The language syntax analizer. |
protected javax.swing.text.MutableAttributeSet |
stringAttr
The string attribute. |
protected javax.swing.text.MutableAttributeSet |
whiteSpaceAttr
The whitespace attribute. |
Constructor Summary | |
CAbstractHighlighter()
Construct this class with default parameters. |
Method Summary | |
javax.swing.text.AttributeSet |
getAttribute()
Gets the attribute for the current token value. |
javax.swing.text.MutableAttributeSet |
getCommentAttribute()
Gets an attribute for comments. |
javax.swing.text.MutableAttributeSet |
getDelimAttribute()
Gets an attribute for delimiters. |
javax.swing.text.MutableAttributeSet |
getIdentAttribute()
Gets an attribute for identifiers. |
javax.swing.text.MutableAttributeSet |
getKeywordAttribute()
Gets an attribute for keywords. |
javax.swing.text.MutableAttributeSet |
getNumberAttribute()
Gets an attribute for numbers. |
javax.swing.text.MutableAttributeSet |
getStringAttribute()
Gets an attribute for strings. |
java.lang.String |
getToken()
Gets the current token value. |
javax.swing.text.MutableAttributeSet |
getWhiteSpaceAttribute()
Gets an attribute for whitespaces. |
java.lang.String |
gotoNextToken()
Goes to the next token in the buffer. |
boolean |
isMultilineComment()
Check if current is a multiline comment. |
abstract int |
locateUnclosedComment(java.lang.String text,
int pos)
Locates a last unclosed multiline comment before specified position. |
protected int |
locateUnclosedComment(java.lang.String text,
int pos,
java.lang.String startSymbol,
java.lang.String endSymbol)
Locates a last unclosed multiline comment before specified position. |
void |
setBuffer(java.lang.String buffer)
Sets a buffer string. |
void |
setCommentAttribute(javax.swing.text.MutableAttributeSet attrs)
Sets an attribute for comments. |
void |
setDelimAttribute(javax.swing.text.MutableAttributeSet attrs)
Sets an attribute for delimiters. |
void |
setIdentAttribute(javax.swing.text.MutableAttributeSet attrs)
Sets an attribute for identifiers. |
void |
setKeywordAttribute(javax.swing.text.MutableAttributeSet attrs)
Sets an attribute for keywords. |
void |
setNumberAttribute(javax.swing.text.MutableAttributeSet attrs)
Sets an attribute for numbers. |
void |
setStringAttribute(javax.swing.text.MutableAttributeSet attrs)
Sets an attribute for strings. |
void |
setWhiteSpaceAttribute(javax.swing.text.MutableAttributeSet attrs)
Sets an attribute for whitespaces. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected javax.swing.text.MutableAttributeSet whiteSpaceAttr
protected javax.swing.text.MutableAttributeSet identAttr
protected javax.swing.text.MutableAttributeSet commentAttr
protected javax.swing.text.MutableAttributeSet delimAttr
protected javax.swing.text.MutableAttributeSet keywordAttr
protected javax.swing.text.MutableAttributeSet stringAttr
protected javax.swing.text.MutableAttributeSet numberAttr
protected org.comedia.util.scanner.CScanner scanner
Constructor Detail |
public CAbstractHighlighter()
Method Detail |
public javax.swing.text.MutableAttributeSet getWhiteSpaceAttribute()
public void setWhiteSpaceAttribute(javax.swing.text.MutableAttributeSet attrs)
attrs
- an attribute for whitespaces.public javax.swing.text.MutableAttributeSet getIdentAttribute()
public void setIdentAttribute(javax.swing.text.MutableAttributeSet attrs)
attrs
- an attribute for identifiers.public javax.swing.text.MutableAttributeSet getCommentAttribute()
public void setCommentAttribute(javax.swing.text.MutableAttributeSet attrs)
attrs
- an attribute for comments.public javax.swing.text.MutableAttributeSet getDelimAttribute()
public void setDelimAttribute(javax.swing.text.MutableAttributeSet attrs)
attrs
- an attribute for delimiters.public javax.swing.text.MutableAttributeSet getKeywordAttribute()
public void setKeywordAttribute(javax.swing.text.MutableAttributeSet attrs)
attrs
- an attribute for keywords.public javax.swing.text.MutableAttributeSet getStringAttribute()
public void setStringAttribute(javax.swing.text.MutableAttributeSet attrs)
attrs
- an attribute for strings.public javax.swing.text.MutableAttributeSet getNumberAttribute()
public void setNumberAttribute(javax.swing.text.MutableAttributeSet attrs)
attrs
- an attribute for numbers.public void setBuffer(java.lang.String buffer)
buffer
- a new buffer string.public java.lang.String gotoNextToken()
public java.lang.String getToken()
public javax.swing.text.AttributeSet getAttribute()
an
- attribute for the current token value.protected int locateUnclosedComment(java.lang.String text, int pos, java.lang.String startSymbol, java.lang.String endSymbol)
text
- the text to search in.pos
- the last positionstartSymbol
- comment starting symbol.endSymbol
- comment end symbol.public abstract int locateUnclosedComment(java.lang.String text, int pos)
text
- the text to search in.pos
- the last positionpublic boolean isMultilineComment()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |