|
|||||||||
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
|
protected java.lang.ref.WeakReference |
docRef
|
static LineMark[] |
EMPTY_MARKLIST
|
static java.lang.String |
I18NProperty
|
protected EditorDocument.MarkList |
markList
|
static java.lang.Object |
NOMARK
|
protected Scanner |
scanner
|
protected BasicStyleMap |
styleMap
|
protected JBUndoManager |
undoManager
|
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 |
Constructor Summary | |
EditorDocument()
|
Method Summary | |
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. |
int |
getMarkIndex(LineMark mark)
Get the 0-based index on which a particular mark exists. |
java.lang.ref.WeakReference |
getReference()
|
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 occurances 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. |
int |
setLineMark(int index,
LineMark mark)
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,
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)
protected void fireRemoveUpdate(javax.swing.event.DocumentEvent e)
protected void fireChangedUpdate(javax.swing.event.DocumentEvent e)
public 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 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 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 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)
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 |