Gridarta Editor
net.sf.gridarta.textedit.textarea.SyntaxDocument Class Reference

A document implementation that can be tokenized by the syntax highlighting system. More...

+ Inheritance diagram for net.sf.gridarta.textedit.textarea.SyntaxDocument:
+ Collaboration diagram for net.sf.gridarta.textedit.textarea.SyntaxDocument:

Public Member Functions

TokenMarker getTokenMarker ()
 Returns the token marker that is to be used to split lines of this document up into tokens. More...
 
void setTokenMarker (@Nullable final TokenMarker tokenMarker)
 Sets the token marker that is to be used to split lines of this document up into tokens. More...
 

Static Public Member Functions

static void addUndoableEdit (@NotNull final UndoableEdit edit)
 Adds an undoable edit to this document's undo list. More...
 
static void beginCompoundEdit ()
 Starts a compound edit that can be undone in one operation. More...
 
static void endCompoundEdit ()
 Ends a compound edit that can be undone in one operation. More...
 

Protected Member Functions

void fireInsertUpdate (@NotNull final DocumentEvent e)
 We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker. More...
 
void fireRemoveUpdate (@NotNull final DocumentEvent e)
 We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker. More...
 

Private Member Functions

void tokenizeLines ()
 Re-parses the document, by passing all lines to the token marker. More...
 
void tokenizeLines (final int start, final int len)
 Re-parses the document, by passing the specified lines to the token marker. More...
 

Private Attributes

TokenMarker tokenMarker
 

Static Private Attributes

static final long serialVersionUID = 1L
 Serial Version UID. More...
 

Detailed Description

A document implementation that can be tokenized by the syntax highlighting system.

Author
Slava Pestov

Definition at line 28 of file SyntaxDocument.java.

Member Function Documentation

◆ addUndoableEdit()

static void net.sf.gridarta.textedit.textarea.SyntaxDocument.addUndoableEdit ( @NotNull final UndoableEdit  edit)
static

Adds an undoable edit to this document's undo list.

The edit should be ignored if something is currently being undone.

Parameters
editThe undoable edit
Since
jEdit 2.2pre1

Definition at line 120 of file SyntaxDocument.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.select().

+ Here is the caller graph for this function:

◆ beginCompoundEdit()

static void net.sf.gridarta.textedit.textarea.SyntaxDocument.beginCompoundEdit ( )
static

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.

Definition at line 103 of file SyntaxDocument.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.overwriteSetSelectedText(), net.sf.gridarta.textedit.textarea.actions.Replace.replace(), net.sf.gridarta.textedit.textarea.TextAreaSelection.setSelectedText(), and net.sf.gridarta.textedit.textarea.TextAreaSelection.setText().

+ Here is the caller graph for this function:

◆ endCompoundEdit()

static void net.sf.gridarta.textedit.textarea.SyntaxDocument.endCompoundEdit ( )
static

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.

Definition at line 111 of file SyntaxDocument.java.

Referenced by net.sf.gridarta.textedit.textarea.JEditTextArea.overwriteSetSelectedText(), net.sf.gridarta.textedit.textarea.actions.Replace.replace(), net.sf.gridarta.textedit.textarea.TextAreaSelection.setSelectedText(), and net.sf.gridarta.textedit.textarea.TextAreaSelection.setText().

+ Here is the caller graph for this function:

◆ fireInsertUpdate()

void net.sf.gridarta.textedit.textarea.SyntaxDocument.fireInsertUpdate ( @NotNull final DocumentEvent  e)
protected

We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.

Definition at line 133 of file SyntaxDocument.java.

References net.sf.gridarta.textedit.textarea.tokenmarker.TokenMarker.insertLines().

+ Here is the call graph for this function:

◆ fireRemoveUpdate()

void net.sf.gridarta.textedit.textarea.SyntaxDocument.fireRemoveUpdate ( @NotNull final DocumentEvent  e)
protected

We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.

Definition at line 149 of file SyntaxDocument.java.

References net.sf.gridarta.textedit.textarea.tokenmarker.TokenMarker.deleteLines().

+ Here is the call graph for this function:

◆ getTokenMarker()

TokenMarker net.sf.gridarta.textedit.textarea.SyntaxDocument.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.

Definition at line 41 of file SyntaxDocument.java.

References net.sf.gridarta.textedit.textarea.SyntaxDocument.tokenMarker.

Referenced by net.sf.gridarta.textedit.textarea.TextAreaSelection.getTokenMarker(), and net.sf.gridarta.textedit.textarea.TextAreaPainter.paint().

+ Here is the caller graph for this function:

◆ setTokenMarker()

void net.sf.gridarta.textedit.textarea.SyntaxDocument.setTokenMarker ( @Nullable final 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
tokenMarkerthe new token marker

Definition at line 51 of file SyntaxDocument.java.

References net.sf.gridarta.textedit.textarea.tokenmarker.TokenMarker.insertLines(), net.sf.gridarta.textedit.textarea.SyntaxDocument.tokenizeLines(), and net.sf.gridarta.textedit.textarea.SyntaxDocument.tokenMarker.

Referenced by net.sf.gridarta.textedit.scripteditor.ScriptEditView.addTab().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ tokenizeLines() [1/2]

void net.sf.gridarta.textedit.textarea.SyntaxDocument.tokenizeLines ( )
private

Re-parses the document, by passing all lines to the token marker.

This should be called after the document is first loaded.

Definition at line 65 of file SyntaxDocument.java.

Referenced by net.sf.gridarta.textedit.textarea.SyntaxDocument.setTokenMarker().

+ Here is the caller graph for this function:

◆ tokenizeLines() [2/2]

void net.sf.gridarta.textedit.textarea.SyntaxDocument.tokenizeLines ( final int  start,
final int  len 
)
private

Re-parses the document, by passing the specified lines to the token marker.

This should be called after a large quantity of text is first inserted.

Parameters
startthe first line to parse
lenthe number of lines, after the first one to parse

Definition at line 76 of file SyntaxDocument.java.

References net.sf.gridarta.textedit.textarea.tokenmarker.TokenMarker.markTokens(), and net.sf.gridarta.textedit.textarea.SyntaxDocument.tokenMarker.

+ Here is the call graph for this function:

Member Data Documentation

◆ serialVersionUID

final long net.sf.gridarta.textedit.textarea.SyntaxDocument.serialVersionUID = 1L
staticprivate

Serial Version UID.

Definition at line 33 of file SyntaxDocument.java.

◆ tokenMarker


The documentation for this class was generated from the following file: