public class JSyntaxDocument extends DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElementAbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElementbuffer, BUFFER_SIZE_DEFAULTBAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementNameStreamDescriptionProperty, TitleProperty| Constructor and Description |
|---|
JSyntaxDocument(net.thevpc.jeep.JContext jcontext) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearUndos()
This will discard all undoable edits
|
void |
doRedo()
Perform a redo action, if possible.
|
void |
doUndo()
Perform an undo action, if possible
|
protected void |
fireChangedUpdate(DocumentEvent e) |
protected void |
fireInsertUpdate(DocumentEvent e) |
protected void |
fireRemoveUpdate(DocumentEvent e) |
protected void |
fireUndoableEditUpdate(UndoableEditEvent e) |
int |
getLineCount()
Return the number of lines in this document
|
int |
getLineEndOffset(int pos)
Returns the end position of the line at pos.
|
int |
getLineNumberAt(int pos)
Return the line number at given position.
|
int |
getLineStartOffset(int pos)
Returns the starting position of the line at pos
|
net.thevpc.jeep.JToken |
getPairFor(net.thevpc.jeep.JToken t)
This is used to return the other part of a paired token in the document.
|
net.thevpc.jeep.JToken |
getTokenAt(int pos)
Find the token at a given position.
|
Iterator<net.thevpc.jeep.JToken> |
getTokens(int start,
int end)
Return an iterator of tokens between p0 and p1.
|
UndoManager |
getUndoManager() |
void |
replaceToken(net.thevpc.jeep.JToken token,
String replacement)
Replace the token with the replacement string
|
String |
toString() |
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeElement, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChangedaddUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, insertString, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlockclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeUndoableEditListener, renderpublic UndoManager getUndoManager()
protected void fireChangedUpdate(DocumentEvent e)
fireChangedUpdate in class AbstractDocumentprotected void fireInsertUpdate(DocumentEvent e)
fireInsertUpdate in class AbstractDocumentprotected void fireRemoveUpdate(DocumentEvent e)
fireRemoveUpdate in class AbstractDocumentprotected void fireUndoableEditUpdate(UndoableEditEvent e)
fireUndoableEditUpdate in class AbstractDocumentpublic void replaceToken(net.thevpc.jeep.JToken token,
String replacement)
token - replacement - public Iterator<net.thevpc.jeep.JToken> getTokens(int start, int end)
start - start position for getting tokensend - position for last tokenpublic net.thevpc.jeep.JToken getTokenAt(int pos)
pos - public net.thevpc.jeep.JToken getPairFor(net.thevpc.jeep.JToken t)
t - public void doUndo()
public void doRedo()
public int getLineStartOffset(int pos)
pos - public int getLineEndOffset(int pos)
pos - public int getLineCount()
public int getLineNumberAt(int pos)
pos - public void clearUndos()
Copyright © 2021 vpc open source initiative. All rights reserved.