public class SyntaxDocument
extends javax.swing.text.PlainDocument
javax.swing.text.AbstractDocument.AbstractElement, javax.swing.text.AbstractDocument.AttributeContext, javax.swing.text.AbstractDocument.BranchElement, javax.swing.text.AbstractDocument.Content, javax.swing.text.AbstractDocument.DefaultDocumentEvent, javax.swing.text.AbstractDocument.ElementEdit, javax.swing.text.AbstractDocument.LeafElement
Modifier and Type | Field and Description |
---|---|
protected TokenMarker |
tokenMarker |
Constructor and Description |
---|
SyntaxDocument() |
Modifier and Type | Method and Description |
---|---|
void |
addUndoableEdit(javax.swing.undo.UndoableEdit edit)
Adds an undoable edit to this document's undo list.
|
void |
beginCompoundEdit()
Starts a compound edit that can be undone in one operation.
|
void |
endCompoundEdit()
Ends a compound edit that can be undone in one operation.
|
protected void |
fireInsertUpdate(javax.swing.event.DocumentEvent evt)
We overwrite this method to update the token marker
state immediately so that any event listeners get a
consistent token marker.
|
protected void |
fireRemoveUpdate(javax.swing.event.DocumentEvent evt)
We overwrite this method to update the token marker
state immediately so that any event listeners get a
consistent token marker.
|
TokenMarker |
getTokenMarker()
Returns the token marker that is to be used to split lines
of this document up into tokens.
|
void |
setTokenMarker(TokenMarker tm)
Sets the token marker that is to be used to split lines of
this document up into tokens.
|
void |
tokenizeLines()
Reparses the document, by passing all lines to the token
marker.
|
void |
tokenizeLines(int start,
int len)
Reparses the document, by passing the specified lines to the
token marker.
|
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertString, insertUpdate, removeUpdate
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
protected TokenMarker tokenMarker
public TokenMarker getTokenMarker()
public void setTokenMarker(TokenMarker tm)
tm
- The new token markerpublic void tokenizeLines()
public void tokenizeLines(int start, int len)
start
- The first line to parselen
- The number of lines, after the first one to parsepublic void beginCompoundEdit()
public void endCompoundEdit()
public void addUndoableEdit(javax.swing.undo.UndoableEdit edit)
edit
- The undoable editprotected void fireInsertUpdate(javax.swing.event.DocumentEvent evt)
fireInsertUpdate
in class javax.swing.text.AbstractDocument
protected void fireRemoveUpdate(javax.swing.event.DocumentEvent evt)
fireRemoveUpdate
in class javax.swing.text.AbstractDocument