|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.text.AbstractDocument | +--javax.swing.text.PlainDocument | +--com.borland.primetime.editor.EditorDocument
This is the editor document that the JBuilder editor is going to use. It's modeled on the standard PlainDocument, but modified to fit our particular needs better. In particular, it's aware of a Scanner element and uses AbstractDocument.StyledLeafElement objects to store style information for syntax highlighting. It also has an associated undo manager to handle undo at the document level.
Inner Class Summary | |
protected class |
EditorDocument.MarkChain
This class maintains the list of LineMarks on a particular line of this document. |
protected class |
EditorDocument.MarkList
This class maintains the list of LineMarks for this document. |
static class |
EditorDocument.RunInfo
This inner class stores blocks of run information. |
class |
EditorDocument.StyledLeafElement
|
Inner classes 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 |
Field Summary | |
static Scanner |
DEFAULT_SCANNER
The default scanner that this document uses |
protected java.lang.ref.WeakReference |
docRef
Create a weak reference to ourself |
static LineMark[] |
EMPTY_MARKLIST
The empty line mark array used for functions that have to return an array of line marks at times when there really are no line marks |
static java.lang.String |
I18NProperty
We need to create a copy of this variable which is defined final private in AbstractDocument |
protected EditorDocument.MarkList |
markList
The list of linemarks that this document has |
static java.lang.Object |
NOMARK
The object that indicates that there is no mark on a line |
protected Scanner |
scanner
The actual scanner that this document uses |
protected BasicStyleMap |
styleMap
The style map used for syntax highlighting |
protected JBUndoManager |
undoManager
The undo manager this document uses |
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 | |
EditorDocument()
Create a new document |
Method Summary | |
void |
changeTabSize(java.lang.Object newTabSize)
The tab size of the document has to be changed. |
protected javax.swing.text.Element |
createLeafElement(javax.swing.text.Element parent,
javax.swing.text.AttributeSet a,
int p0,
int p1)
Creates a document leaf element. |
protected void |
fireChangedUpdate(javax.swing.event.DocumentEvent e)
Notify interested listeners that a change was made to the document. |
protected void |
fireInsertUpdate(javax.swing.event.DocumentEvent e)
Notify interested listeners that an insertion was made into the document. |
protected void |
fireRemoveUpdate(javax.swing.event.DocumentEvent e)
Notify interested listeners that a removal was made from the document. |
void |
fireRowsChanged(int start,
int end)
Called by the scanner to tell the editor that the syntax highlighting for the given rows have changed. |
LineMark[] |
getLineMarks(int index)
Get the list of LineMarks on a particular line without checking if the linemarks are specific to a single editorPane. |
LineMark[] |
getLineMarks(int index,
EditorPane editor)
Get the list of LineMarks on a particular line. |
int |
getMarkIndex(LineMark mark)
Get the 0-based index on which a particular mark exists. |
java.lang.ref.WeakReference |
getReference()
Get the reference to this document |
Scanner |
getScanner()
Get the scanner currently in use for this document. |
BasicStyleMap |
getStyleMap()
Get the StyleMap to use when Rendering this Document. |
JBUndoManager |
getUndoManager()
Get the JBUndoManager for this document. |
void |
removeLightweightLineMarks(LineMark mark)
Remove all occurrences of a particular linemark from this document. |
int |
removeLineMark(LineMark mark)
Remove a LineMark. |
void |
reparse(javax.swing.event.DocumentEvent e)
Tell the scanner to reparse the document. |
void |
setLightweightLineMarks(int[] indexes,
LineMark mark)
Set a LineMark on an array of lines. |
void |
setLightweightLineMarks(int[] indexes,
LineMark mark,
EditorPane editor)
Set a LineMark on an array of lines. |
int |
setLineMark(int index,
LineMark mark)
Set a LineMark on a particular line. |
int |
setLineMark(int index,
LineMark mark,
EditorPane editor)
Set a LineMark on a particular line. |
void |
setScanner(Scanner scanner)
Set the scanner to use for this document. |
void |
setStyleMap(BasicStyleMap styleMap)
Set the StyleMap to use for this document. |
Methods inherited from class javax.swing.text.PlainDocument |
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate |
Methods inherited from class javax.swing.text.AbstractDocument |
addDocumentListener, addUndoableEditListener, createBranchElement, createPosition, dump, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, insertString, postRemoveUpdate, putProperty, readLock, readUnlock, remove, removeDocumentListener, removeUndoableEditListener, render, setAsynchronousLoadPriority, setDocumentProperties, writeLock, writeUnlock |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Scanner DEFAULT_SCANNER
protected java.lang.ref.WeakReference docRef
public static final java.lang.String I18NProperty
protected BasicStyleMap styleMap
protected Scanner scanner
protected JBUndoManager undoManager
public static final LineMark[] EMPTY_MARKLIST
public static final java.lang.Object NOMARK
protected EditorDocument.MarkList markList
Constructor Detail |
public EditorDocument()
Method Detail |
public void fireRowsChanged(int start, int end)
start
- the first line that changedend
- the last line that changedpublic java.lang.ref.WeakReference getReference()
public Scanner getScanner()
public void setScanner(Scanner scanner)
scanner
- the scanner to use for this document.public JBUndoManager getUndoManager()
public void setStyleMap(BasicStyleMap styleMap)
styleMap
- the StyleMap to use.public BasicStyleMap getStyleMap()
public void reparse(javax.swing.event.DocumentEvent e)
e
- the DocumentEvent to pass to the scanner's parse method.protected void fireInsertUpdate(javax.swing.event.DocumentEvent e)
fireInsertUpdate
in class javax.swing.text.AbstractDocument
e
- The document event that triggered this insert updateprotected void fireRemoveUpdate(javax.swing.event.DocumentEvent e)
fireRemoveUpdate
in class javax.swing.text.AbstractDocument
e
- The document event that triggered this remove updateprotected void fireChangedUpdate(javax.swing.event.DocumentEvent e)
fireChangedUpdate
in class javax.swing.text.AbstractDocument
e
- The document event that triggered this change updatepublic void changeTabSize(java.lang.Object newTabSize)
newTabSize
- Integer object describing the new tab sizepublic void setLightweightLineMarks(int[] indexes, LineMark mark)
indexes
- An array of 0-based index entries at which the specified
lightweight mark will be set.mark
- The lightweight LineMark to set.public void setLightweightLineMarks(int[] indexes, LineMark mark, EditorPane editor)
indexes
- An array of 0-based index entries at which the specified
lightweight mark will be set.mark
- The lightweight LineMark to set.editor
- If not null, the mark will only be visible in the
specified editor pane.public void removeLightweightLineMarks(LineMark mark)
mark
- The lightweight LineMark to be removed.removeLineMark
public int setLineMark(int index, LineMark mark)
index
- The 0-based index at which the mark will be set.mark
- The LineMark to set.public int setLineMark(int index, LineMark mark, EditorPane editor)
index
- The 0-based index at which the mark will be set.mark
- The LineMark to set.editor
- If not null, the mark will only be visible in the
specified editor pane.public int removeLineMark(LineMark mark)
mark
- The LineMark to remove.public LineMark[] getLineMarks(int index)
index
- The 0-based index for which to retrieve the marks.public LineMark[] getLineMarks(int index, EditorPane editor)
index
- The 0-based index for which to retrieve the marks.editor
- If a lineMark is editor specific, make sure it
belongs to this editor.public int getMarkIndex(LineMark mark)
mark
- The LineMark to look up.protected javax.swing.text.Element createLeafElement(javax.swing.text.Element parent, javax.swing.text.AttributeSet a, int p0, int p1)
createLeafElement
in class javax.swing.text.AbstractDocument
parent
- the parent elementa
- the attributes for the elementp0
- the beginning of the range >= 0p1
- the end of the range >= p0
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |