Class SyntaxDocument
- java.lang.Object
-
- javax.swing.text.AbstractDocument
-
- javax.swing.text.PlainDocument
-
- net.sf.gridarta.textedit.textarea.SyntaxDocument
-
- All Implemented Interfaces:
java.io.Serializable,javax.swing.text.Document
public class SyntaxDocument extends javax.swing.text.PlainDocumentA document implementation that can be tokenized by the syntax highlighting system.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.text.AbstractDocument
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
-
-
Constructor Summary
Constructors Constructor Description SyntaxDocument()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static voidaddUndoableEdit(@NotNull javax.swing.undo.UndoableEdit edit)Adds an undoable edit to this document's undo list.static voidbeginCompoundEdit()Starts a compound edit that can be undone in one operation.static voidendCompoundEdit()Ends a compound edit that can be undone in one operation.protected voidfireInsertUpdate(@NotNull javax.swing.event.DocumentEvent e)We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.protected voidfireRemoveUpdate(@NotNull javax.swing.event.DocumentEvent e)We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.@Nullable TokenMarkergetTokenMarker()Returns the token marker that is to be used to split lines of this document up into tokens.voidsetTokenMarker(@Nullable TokenMarker tokenMarker)Sets the token marker that is to be used to split lines of this document up into tokens.-
Methods inherited from class javax.swing.text.PlainDocument
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertString, insertUpdate, removeUpdate
-
Methods inherited from class javax.swing.text.AbstractDocument
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
-
-
-
-
Method Detail
-
getTokenMarker
@Nullable public @Nullable TokenMarker getTokenMarker()
Returns the token marker that is to be used to split lines of this document up into tokens. May return null if this document is not to be colorized.
-
setTokenMarker
public void setTokenMarker(@Nullable @Nullable TokenMarker tokenMarker)Sets the token marker that is to be used to split lines of this document up into tokens. May throw an exception if this is not supported for this type of document.- Parameters:
tokenMarker- the new token marker
-
beginCompoundEdit
public static void beginCompoundEdit()
Starts a compound edit that can be undone in one operation. Subclasses that implement undo should override this method; this class has no undo functionality so this method is empty.
-
endCompoundEdit
public static void endCompoundEdit()
Ends a compound edit that can be undone in one operation. Subclasses that implement undo should override this method; this class has no undo functionality so this method is empty.
-
addUndoableEdit
public static void addUndoableEdit(@NotNull @NotNull javax.swing.undo.UndoableEdit edit)Adds an undoable edit to this document's undo list. The edit should be ignored if something is currently being undone.- Parameters:
edit- the undoable edit- Since:
- jEdit 2.2pre1
-
fireInsertUpdate
protected void fireInsertUpdate(@NotNull @NotNull javax.swing.event.DocumentEvent e)We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.- Overrides:
fireInsertUpdatein classjavax.swing.text.AbstractDocument
-
fireRemoveUpdate
protected void fireRemoveUpdate(@NotNull @NotNull javax.swing.event.DocumentEvent e)We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.- Overrides:
fireRemoveUpdatein classjavax.swing.text.AbstractDocument
-
-