debugger.gui.debugging
Class SyntaxDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.DefaultStyledDocument
debugger.gui.debugging.SyntaxDocument
- All Implemented Interfaces:
- Document, Serializable, StyledDocument
- class SyntaxDocument
- extends DefaultStyledDocument
Copyright (c) Ontos AG (http://www.ontosearch.com).
This class is part of JAPE Debugger component for
GATE (Copyright (c) "The University of Sheffield" see http://gate.ac.uk/)
- Author:
- Oleg Mishenko
Method Summary |
protected String |
addMatchingBrace(int offset)
|
private void |
applyHighlighting(String content,
int line)
|
private void |
checkForTokens(String content,
int startOffset,
int endOffset)
|
private void |
commentLinesAfter(String content,
int line)
|
private boolean |
commentLinesBefore(String content,
int line)
|
private boolean |
endingMultiLineComment(String content,
int startOffset,
int endOffset)
|
protected String |
getEndDelimiter()
|
protected String |
getEscapeString(String quoteDelimiter)
|
private String |
getLine(String content,
int offset)
|
private int |
getOtherToken(String content,
int startOffset,
int endOffset)
|
private int |
getQuoteToken(String content,
int startOffset,
int endOffset)
|
protected String |
getSingleLineDelimiter()
|
protected String |
getStartDelimiter()
|
private void |
highlightLinesAfter(String content,
int line)
|
private int |
indexOf(String content,
String needle,
int offset)
|
void |
insertString(int offset,
String str,
AttributeSet a)
|
protected boolean |
isDelimiter(String character)
|
protected boolean |
isKeyword(String token)
|
private boolean |
isMultiLineComment()
|
protected boolean |
isQuoteDelimiter(String character)
|
private int |
lastIndexOf(String content,
String needle,
int offset)
|
private void |
processChangedLines(int offset,
int length)
|
void |
remove(int offset,
int length)
|
private void |
setMultiLineComment(boolean value)
|
private boolean |
startingMultiLineComment(String content,
int startOffset,
int endOffset)
|
Methods inherited from class javax.swing.text.DefaultStyledDocument |
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged |
Methods inherited from class javax.swing.text.AbstractDocument |
addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.swing.text.Document |
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeUndoableEditListener, render |
doc
private DefaultStyledDocument doc
rootElement
private Element rootElement
multiLineComment
private boolean multiLineComment
normal
private MutableAttributeSet normal
keyword
private MutableAttributeSet keyword
comment
private MutableAttributeSet comment
quote
private MutableAttributeSet quote
keywords
private Hashtable keywords
SyntaxDocument
public SyntaxDocument()
insertString
public void insertString(int offset,
String str,
AttributeSet a)
throws BadLocationException
- Throws:
BadLocationException
remove
public void remove(int offset,
int length)
throws BadLocationException
- Throws:
BadLocationException
processChangedLines
private void processChangedLines(int offset,
int length)
throws BadLocationException
- Throws:
BadLocationException
commentLinesBefore
private boolean commentLinesBefore(String content,
int line)
commentLinesAfter
private void commentLinesAfter(String content,
int line)
highlightLinesAfter
private void highlightLinesAfter(String content,
int line)
applyHighlighting
private void applyHighlighting(String content,
int line)
startingMultiLineComment
private boolean startingMultiLineComment(String content,
int startOffset,
int endOffset)
endingMultiLineComment
private boolean endingMultiLineComment(String content,
int startOffset,
int endOffset)
isMultiLineComment
private boolean isMultiLineComment()
setMultiLineComment
private void setMultiLineComment(boolean value)
checkForTokens
private void checkForTokens(String content,
int startOffset,
int endOffset)
getQuoteToken
private int getQuoteToken(String content,
int startOffset,
int endOffset)
getOtherToken
private int getOtherToken(String content,
int startOffset,
int endOffset)
indexOf
private int indexOf(String content,
String needle,
int offset)
lastIndexOf
private int lastIndexOf(String content,
String needle,
int offset)
getLine
private String getLine(String content,
int offset)
isDelimiter
protected boolean isDelimiter(String character)
isQuoteDelimiter
protected boolean isQuoteDelimiter(String character)
isKeyword
protected boolean isKeyword(String token)
getStartDelimiter
protected String getStartDelimiter()
getEndDelimiter
protected String getEndDelimiter()
getSingleLineDelimiter
protected String getSingleLineDelimiter()
getEscapeString
protected String getEscapeString(String quoteDelimiter)
addMatchingBrace
protected String addMatchingBrace(int offset)
throws BadLocationException
- Throws:
BadLocationException