Package jade.tools.gui
Class ACLSyntaxDocument
- java.lang.Object
-
- javax.swing.text.AbstractDocument
-
- javax.swing.text.PlainDocument
-
- jade.tools.gui.ACLSyntaxDocument
-
- All Implemented Interfaces:
Serializable,Document
public class ACLSyntaxDocument extends PlainDocument
The interface a document must implement to be colorizable by the jEdit text area component. The original file is written by Slava Pestov (www.gjt.org) and altered to fit ACL/SL.- Author:
- Chris van Aart - Acklin B.V., the Netherlands & Slava Pestov
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
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
Fields Modifier and Type Field Description protected ACLSLTokenMarkertokenMarker-
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 javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
-
-
Constructor Summary
Constructors Constructor Description ACLSyntaxDocument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidfireInsertUpdate(DocumentEvent evt)We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.protected voidfireRemoveUpdate(DocumentEvent evt)We overwrite this method to update the token marker state immediately so that any event listeners get a consistent token marker.ACLSLTokenMarkergetTokenMarker()Returns the token marker that is to be used to split lines of this document up into tokens.voidsetTokenMarker(ACLSLTokenMarker tm)Sets the token marker that is to be used to split lines of this document up into tokens.voidtokenizeLines()Reparses the document, by passing all lines to the token marker.voidtokenizeLines(int start, int len)Reparses the document, by passing the specified lines to the token marker.-
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
-
-
-
-
Field Detail
-
tokenMarker
protected ACLSLTokenMarker tokenMarker
-
-
Method Detail
-
getTokenMarker
public ACLSLTokenMarker 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.- Returns:
- The TokenMarker value
-
setTokenMarker
public void setTokenMarker(ACLSLTokenMarker tm)
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:
tm- The new token marker
-
tokenizeLines
public void tokenizeLines()
Reparses the document, by passing all lines to the token marker. This should be called after the document is first loaded.
-
tokenizeLines
public void tokenizeLines(int start, int len)Reparses 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:
start- The first line to parselen- The number of lines, after the first one to parse
-
fireInsertUpdate
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.- Overrides:
fireInsertUpdatein classAbstractDocument- Parameters:
evt- Description of Parameter
-
fireRemoveUpdate
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.- Overrides:
fireRemoveUpdatein classAbstractDocument- Parameters:
evt- Description of Parameter
-
-