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.SectionElementNested 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 MutableAttributeSetprivate MutableAttributeSetprivate DiagnosticCollector<JavaFileObject>private MutableAttributeSetprivate booleanprivate Elementprivate MutableAttributeSetprivate MutableAttributeSetprivate MutableAttributeSetFields inherited from class javax.swing.text.DefaultStyledDocument
buffer, BUFFER_SIZE_DEFAULTFields inherited from class javax.swing.text.AbstractDocument
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementNameFields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringaddMatchingBrace(int offset) protected Stringprotected Stringprotected StringaddWhiteSpace(int offset) private voidapplyHighlighting(String content, int line) private voidcheckForTokens(String content, int startOffset, int endOffset) private voidcommentLinesAfter(String content, int line) private booleancommentLinesBefore(String content, int line) private booleanendingMultiLineComment(String content, int startOffset, int endOffset) findErrorMessage(int iPos) protected voidprotected voidprotected Stringprivate Stringprivate intgetOtherToken(String content, int startOffset, int endOffset) private intgetQuoteToken(String content, int startOffset, int endOffset) protected Stringprotected Stringprivate voidhighlightLinesAfter(String content, int line) private intvoidinsertString(int offset, String str, AttributeSet a) Override to apply syntax highlighting after the document has been updatedprotected booleanisCharQuoteDelimiter(String character) protected booleanisDelimiter(String character) private booleanisError(int iPos) private booleanisError(int iPos, int iLength) protected booleanprivate booleanprotected booleanisQuoteDelimiter(String character) private booleanisWarning(int iPos) private booleanisWarning(int iPos, int iLength) private intlastIndexOf(String content, String needle, int offset) private voidprocessChangedLines(int offset, int length) private voidprocessIssues(DiagnosticCollector<JavaFileObject> errorHandler) voidremove(int offset, int length) voidsetErrorHandler(DiagnosticCollector<JavaFileObject> errorHandler) private voidsetMultiLineComment(boolean value) private booleanstartingMultiLineComment(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, styleChangedMethods 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, writeUnlockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
insertStringin interfaceDocument- Overrides:
insertStringin classAbstractDocument- Throws:
BadLocationException
-
remove
- Specified by:
removein interfaceDocument- Overrides:
removein 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:
fireInsertUpdatein classAbstractDocument
-
fireRemoveUpdate
- Overrides:
fireRemoveUpdatein 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
-