|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.AbstractDocument
javax.swing.text.PlainDocument
com.jidesoft.editor.SyntaxDocument
public class SyntaxDocument
A document implementation that can be tokenized by the syntax highlighting system.
Nested Class Summary | |
---|---|
protected class |
SyntaxDocument.MyUndoableEditListener
|
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument |
---|
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement |
Field Summary | |
---|---|
protected CompoundEdit |
_compoundEdit
|
protected int |
_compoundEditCount
|
protected UndoManager |
_undoManager
|
protected TokenMarker |
tokenMarker
|
Fields inherited from class javax.swing.text.PlainDocument |
---|
lineLimitAttribute, tabSizeAttribute |
Fields inherited from class javax.swing.text.AbstractDocument |
---|
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName |
Fields inherited from interface com.jidesoft.editor.LineBreak |
---|
CR, LF, LINE_BREAK_CODE_EDITOR, LINE_BREAK_MAC, LINE_BREAK_MIXED, LINE_BREAK_PC, LINE_BREAK_UNIX, LINE_BREAK_UNKNOWN, STRING_CR, STRING_CR_LF, STRING_LF |
Fields inherited from interface javax.swing.text.Document |
---|
StreamDescriptionProperty, TitleProperty |
Constructor Summary | |
---|---|
SyntaxDocument()
|
Method Summary | |
---|---|
void |
addUndoableEdit(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. |
char |
charAt(int offset)
|
static int |
convertLineBreaks(String text,
StringBuffer buffer)
|
static int |
convertLineBreaks(String text,
StringBuffer buffer,
String newLineBreak)
|
void |
endCompoundEdit()
Ends a compound edit that can be undone in one operation. |
int |
findNext(String[] s,
int fromIndex,
int toIndex,
boolean caseSensitive)
|
int |
findNext(String[] s,
int fromIndex,
int toIndex,
boolean caseSensitive,
boolean wholeWords)
|
int |
findPrevious(String[] s,
int fromIndex,
int toIndex,
boolean caseSensitive)
|
int |
findPrevious(String[] s,
int fromIndex,
int toIndex,
boolean caseSensitive,
boolean wholeWords)
|
protected void |
fireInsertUpdate(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(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 |
fireRemovingUpdate(DocumentEvent evt)
|
int |
getLineCount()
|
int |
getLineEndOffset(int line)
|
int |
getLineLength(int line)
|
int |
getLineNumber(int offset)
|
int |
getLineStartOffset(int line)
|
String |
getLineText(int offset)
|
int |
getLookupBufferSize()
|
TokenMarker |
getTokenMarker()
Returns the token marker that is to be used to split lines of this document up into tokens. |
UndoManager |
getUndoManager()
|
protected boolean |
isInCommentOrLiteral(int offset)
Check if the character in the offset is inside a comment or literal. |
boolean |
isLineLoaded(int line)
|
boolean |
isOffsetLoaded(int offset)
|
protected boolean |
isWordChar(char ch)
Check if the ch is a valid word char to determine if Searchable#fromStart() and Searchable#toEnd() is satisfied. |
void |
redo()
|
protected void |
removeUpdate(AbstractDocument.DefaultDocumentEvent changed)
|
void |
setLookupBufferSize(int lookupBufferSize)
|
void |
setTokenMarker(TokenMarker tm)
Sets the token marker that is to be used to split lines of this document up into tokens. |
void |
setUndoManager(UndoManager u)
|
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. |
void |
undo()
|
Methods inherited from class javax.swing.text.PlainDocument |
---|
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertString, insertUpdate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected UndoManager _undoManager
protected CompoundEdit _compoundEdit
protected int _compoundEditCount
protected TokenMarker tokenMarker
Constructor Detail |
---|
public SyntaxDocument()
Method Detail |
---|
public String getLineText(int offset) throws BadLocationException
BadLocationException
public int getLineNumber(int offset)
public void undo()
public void redo()
public UndoManager getUndoManager()
public void setUndoManager(UndoManager u)
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 parseprotected boolean isInCommentOrLiteral(int offset) throws BadLocationException
offset
- the offset to check
BadLocationException
- if the location is not correct.public void beginCompoundEdit()
public void endCompoundEdit()
public void addUndoableEdit(UndoableEdit edit)
edit
- The undoable editprotected void fireInsertUpdate(DocumentEvent evt)
fireInsertUpdate
in class AbstractDocument
protected void fireRemoveUpdate(DocumentEvent evt)
fireRemoveUpdate
in class AbstractDocument
public static int convertLineBreaks(String text, StringBuffer buffer)
public static int convertLineBreaks(String text, StringBuffer buffer, String newLineBreak)
public char charAt(int offset) throws BadLocationException
BadLocationException
protected void removeUpdate(AbstractDocument.DefaultDocumentEvent changed)
removeUpdate
in class PlainDocument
protected void fireRemovingUpdate(DocumentEvent evt)
public int getLookupBufferSize()
public void setLookupBufferSize(int lookupBufferSize)
public int findNext(String[] s, int fromIndex, int toIndex, boolean caseSensitive)
public int findNext(String[] s, int fromIndex, int toIndex, boolean caseSensitive, boolean wholeWords)
protected boolean isWordChar(char ch)
ch
- the character
public int findPrevious(String[] s, int fromIndex, int toIndex, boolean caseSensitive)
public int findPrevious(String[] s, int fromIndex, int toIndex, boolean caseSensitive, boolean wholeWords)
public boolean isOffsetLoaded(int offset)
public boolean isLineLoaded(int line)
public int getLineCount()
public int getLineStartOffset(int line)
public int getLineEndOffset(int line)
public int getLineLength(int line)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |