Package editor.plugin.typeloader.java
Class JavaDocument
java.lang.Object
javax.swing.text.AbstractDocument
javax.swing.text.DefaultStyledDocument
editor.plugin.typeloader.java.JavaDocument
- All Implemented Interfaces:
Serializable
,Document
,StyledDocument
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.text.DefaultStyledDocument
DefaultStyledDocument.AttributeUndoableEdit, DefaultStyledDocument.ElementBuffer, DefaultStyledDocument.ElementSpec, DefaultStyledDocument.SectionElement
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
FieldsModifier and TypeFieldDescriptionprivate MutableAttributeSet
private MutableAttributeSet
private DiagnosticCollector<JavaFileObject>
private MutableAttributeSet
private boolean
private Element
private MutableAttributeSet
private MutableAttributeSet
private MutableAttributeSet
Fields inherited from class javax.swing.text.DefaultStyledDocument
buffer, BUFFER_SIZE_DEFAULT
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected String
addMatchingBrace
(int offset) protected String
protected String
protected String
addWhiteSpace
(int offset) private void
applyHighlighting
(String content, int line) private void
checkForTokens
(String content, int startOffset, int endOffset) private void
commentLinesAfter
(String content, int line) private boolean
commentLinesBefore
(String content, int line) private boolean
endingMultiLineComment
(String content, int startOffset, int endOffset) findErrorMessage
(int iPos) protected void
protected void
protected String
private String
private int
getOtherToken
(String content, int startOffset, int endOffset) private int
getQuoteToken
(String content, int startOffset, int endOffset) protected String
protected String
private void
highlightLinesAfter
(String content, int line) private int
void
insertString
(int offset, String str, AttributeSet a) Override to apply syntax highlighting after the document has been updatedprotected boolean
isCharQuoteDelimiter
(String character) protected boolean
isDelimiter
(String character) private boolean
isError
(int iPos) private boolean
isError
(int iPos, int iLength) protected boolean
private boolean
protected boolean
isQuoteDelimiter
(String character) private boolean
isWarning
(int iPos) private boolean
isWarning
(int iPos, int iLength) private int
lastIndexOf
(String content, String needle, int offset) private void
processChangedLines
(int offset, int length) private void
processIssues
(DiagnosticCollector<JavaFileObject> errorHandler) void
remove
(int offset, int length) void
setErrorHandler
(DiagnosticCollector<JavaFileObject> errorHandler) private void
setMultiLineComment
(boolean value) private boolean
startingMultiLineComment
(String content, int startOffset, int endOffset) Methods inherited from class javax.swing.text.DefaultStyledDocument
addDocumentListener, addStyle, create, createDefaultRoot, getBackground, getCharacterElement, getDefaultRootElement, getFont, getForeground, getLogicalStyle, getParagraphElement, getStyle, getStyleNames, insert, insertUpdate, removeDocumentListener, removeElement, removeStyle, removeUpdate, setCharacterAttributes, setLogicalStyle, setParagraphAttributes, styleChanged
Methods inherited from class javax.swing.text.AbstractDocument
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, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.swing.text.Document
addUndoableEditListener, createPosition, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, putProperty, removeUndoableEditListener, render
-
Field Details
-
_root
-
_word
-
_keyword
-
_error
-
_warning
-
_comment
-
_stringLiteral
-
_multiLineComment
private boolean _multiLineComment -
_keywords
-
_errorHandler
-
-
Constructor Details
-
JavaDocument
public JavaDocument()
-
-
Method Details
-
insertString
Override to apply syntax highlighting after the document has been updated- Specified by:
insertString
in interfaceDocument
- Overrides:
insertString
in classAbstractDocument
- Throws:
BadLocationException
-
remove
- Specified by:
remove
in interfaceDocument
- Overrides:
remove
in classAbstractDocument
- Throws:
BadLocationException
-
processChangedLines
- Throws:
BadLocationException
-
commentLinesBefore
-
commentLinesAfter
-
highlightLinesAfter
- Throws:
BadLocationException
-
applyHighlighting
- Throws:
BadLocationException
-
startingMultiLineComment
private boolean startingMultiLineComment(String content, int startOffset, int endOffset) throws BadLocationException - Throws:
BadLocationException
-
endingMultiLineComment
private boolean endingMultiLineComment(String content, int startOffset, int endOffset) throws BadLocationException - Throws:
BadLocationException
-
isMultiLineComment
private boolean isMultiLineComment() -
setMultiLineComment
private void setMultiLineComment(boolean value) -
checkForTokens
-
getQuoteToken
-
getOtherToken
-
fireInsertUpdate
- Overrides:
fireInsertUpdate
in classAbstractDocument
-
fireRemoveUpdate
- Overrides:
fireRemoveUpdate
in classAbstractDocument
-
indexOf
-
lastIndexOf
-
getLine
-
isDelimiter
-
isQuoteDelimiter
-
isCharQuoteDelimiter
-
isKeyword
-
getStartDelimiter
-
getEndDelimiter
-
getSingleLineDelimiter
-
addMatchingQuotationMark
- Throws:
BadLocationException
-
addMatchingBrace
- Throws:
BadLocationException
-
addWhiteSpace
- Throws:
BadLocationException
-
addParenthesis
- Throws:
BadLocationException
-
getErrorHandler
-
setErrorHandler
-
processIssues
-
isError
private boolean isError(int iPos) -
isError
private boolean isError(int iPos, int iLength) -
isWarning
private boolean isWarning(int iPos) -
isWarning
private boolean isWarning(int iPos, int iLength) -
findErrorMessage
-