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
public class JavaDocument extends DefaultStyledDocument
- See Also:
- Serialized Form
-
-
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
-
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 Constructor Description JavaDocument()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
addMatchingBrace(int offset)
protected String
addMatchingQuotationMark()
protected String
addParenthesis()
protected String
addWhiteSpace(int offset)
String
findErrorMessage(int iPos)
protected void
fireInsertUpdate(DocumentEvent evt)
protected void
fireRemoveUpdate(DocumentEvent evt)
protected String
getEndDelimiter()
DiagnosticCollector<JavaFileObject>
getErrorHandler()
protected String
getSingleLineDelimiter()
protected String
getStartDelimiter()
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)
protected boolean
isKeyword(String token)
protected boolean
isQuoteDelimiter(String character)
void
remove(int offset, int length)
void
setErrorHandler(DiagnosticCollector<JavaFileObject> errorHandler)
-
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
-
-
-
-
Method Detail
-
insertString
public void insertString(int offset, String str, AttributeSet a) throws BadLocationException
Override to apply syntax highlighting after the document has been updated- Specified by:
insertString
in interfaceDocument
- Overrides:
insertString
in classAbstractDocument
- Throws:
BadLocationException
-
remove
public void remove(int offset, int length) throws BadLocationException
- Specified by:
remove
in interfaceDocument
- Overrides:
remove
in classAbstractDocument
- Throws:
BadLocationException
-
fireInsertUpdate
protected void fireInsertUpdate(DocumentEvent evt)
- Overrides:
fireInsertUpdate
in classAbstractDocument
-
fireRemoveUpdate
protected void fireRemoveUpdate(DocumentEvent evt)
- Overrides:
fireRemoveUpdate
in classAbstractDocument
-
isDelimiter
protected boolean isDelimiter(String character)
-
isQuoteDelimiter
protected boolean isQuoteDelimiter(String character)
-
isCharQuoteDelimiter
protected boolean isCharQuoteDelimiter(String character)
-
isKeyword
protected boolean isKeyword(String token)
-
getStartDelimiter
protected String getStartDelimiter()
-
getEndDelimiter
protected String getEndDelimiter()
-
getSingleLineDelimiter
protected String getSingleLineDelimiter()
-
addMatchingQuotationMark
protected String addMatchingQuotationMark() throws BadLocationException
- Throws:
BadLocationException
-
addMatchingBrace
protected String addMatchingBrace(int offset) throws BadLocationException
- Throws:
BadLocationException
-
addWhiteSpace
protected String addWhiteSpace(int offset) throws BadLocationException
- Throws:
BadLocationException
-
addParenthesis
protected String addParenthesis() throws BadLocationException
- Throws:
BadLocationException
-
getErrorHandler
public DiagnosticCollector<JavaFileObject> getErrorHandler()
-
setErrorHandler
public void setErrorHandler(DiagnosticCollector<JavaFileObject> errorHandler)
-
findErrorMessage
public String findErrorMessage(int iPos)
-
-