org.netbeans.modules.editor
Class NbEditorDocument
java.lang.Object
javax.swing.text.AbstractDocument
org.netbeans.editor.BaseDocument
org.netbeans.editor.GuardedDocument
org.netbeans.modules.editor.NbEditorDocument
- All Implemented Interfaces:
- Serializable, Document, StyledDocument, AtomicLockDocument, NbDocument.Annotatable, NbDocument.CustomEditor, NbDocument.CustomToolbar, NbDocument.PositionBiasable, NbDocument.Printable, NbDocument.WriteLockable
public class NbEditorDocument
- extends GuardedDocument
- implements NbDocument.PositionBiasable, NbDocument.WriteLockable, NbDocument.Printable, NbDocument.CustomEditor, NbDocument.CustomToolbar, NbDocument.Annotatable
BaseDocument extension managing the readonly blocks of text
- See Also:
- Serialized Form
| Fields inherited from class org.netbeans.editor.BaseDocument |
BLOCKS_FINDER_PROP, defaultRootElem, FILE_NAME_PROP, FORMATTER, ID_PROP, inited, KIT_CLASS_PROP, LINE_BATCH_SIZE, LINE_LIMIT_PROP, lineRootElement, LS_CR, LS_CRLF, LS_LF, MIME_TYPE_PROP, modified, READ_LINE_SEPARATOR_PROP, STRING_BWD_FINDER_PROP, STRING_FINDER_PROP, THREAD_LOCAL_LOCK_DEPTH, UNDO_MANAGER_PROP, WRAP_SEARCH_MARK_PROP, WRITE_LINE_SEPARATOR_PROP |
| Methods inherited from class org.netbeans.editor.GuardedDocument |
addStyle, addStyledLayer, addStyleToLayerMapping, createDocumentEvent, getBackground, getCharacterElement, getFont, getForeground, getGuardedBlockChain, getLogicalStyle, getStyle, getStyleNames, isPosGuarded, preInsertCheck, preRemoveCheck, removeStyle, runAtomic, runAtomicAsUser, setLogicalStyle, setNormalStyleName, setParagraphAttributes, toStringDetail |
| Methods inherited from class org.netbeans.editor.BaseDocument |
addAtomicLockListener, addDocumentListener, addLayer, addPostModificationDocumentListener, addUndoableEdit, addUpdateDocumentListener, atomicLock, atomicUndo, atomicUnlock, breakAtomicLock, checkTrailingSpaces, createPosition, extWriteLock, extWriteUnlock, find, findLayer, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAnnotations, getAtomicDepth, getChars, getChars, getChars, getDefaultRootElement, getFormatter, getKitClass, getLegacyFormatter, getParagraphElement, getRootElements, getSyntaxSupport, getText, getText, insertString, insertUpdate, invalidateSyntaxMarks, isAtomicLock, isIdentifierPart, isModified, isWhitespace, postRemoveUpdate, preInsertUpdate, print, print, print, processText, read, remove, removeAtomicLockListener, removeDocumentListener, removePostModificationDocumentListener, removeUpdate, removeUpdateDocumentListener, render, repaintBlock, resetUndoMerge, setPostModificationDocumentListener, toString, write |
| Methods inherited from class javax.swing.text.AbstractDocument |
addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getStartPosition, getText, getText, getUndoableEditListeners, putProperty, readLock, readUnlock, removeUndoableEditListener, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock |
| Methods inherited from interface javax.swing.text.Document |
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
| Methods inherited from interface javax.swing.text.Document |
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
| Methods inherited from interface javax.swing.text.Document |
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
| Methods inherited from interface javax.swing.text.Document |
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
| Methods inherited from interface javax.swing.text.Document |
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
| Methods inherited from interface javax.swing.text.Document |
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render |
INDENT_ENGINE
public static final String INDENT_ENGINE
- Indent engine for the given kitClass.
- See Also:
- Constant Field Values
NbEditorDocument
public NbEditorDocument(Class kitClass)
- Deprecated. Use of editor kit's implementation classes is deprecated
in favor of mime types.
- Creates a new document.
NbEditorDocument
public NbEditorDocument(String mimeType)
- Creates a new document.
- Parameters:
mimeType - The mime type for the new document.- Since:
- 1.18
getShiftWidth
public int getShiftWidth()
- Overrides:
getShiftWidth in class BaseDocument
getTabSize
public int getTabSize()
- Overrides:
getTabSize in class BaseDocument
setCharacterAttributes
public void setCharacterAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
- Specified by:
setCharacterAttributes in interface StyledDocument- Overrides:
setCharacterAttributes in class GuardedDocument
createPrintIterators
public AttributedCharacterIterator[] createPrintIterators()
- Specified by:
createPrintIterators in interface NbDocument.Printable
createEditor
public Component createEditor(JEditorPane j)
- Specified by:
createEditor in interface NbDocument.CustomEditor
createToolbar
public JToolBar createToolbar(JEditorPane j)
- Specified by:
createToolbar in interface NbDocument.CustomToolbar
addAnnotation
public void addAnnotation(Position startPos,
int length,
Annotation annotation)
- Add annotation to the document. For annotation of whole line
the length parameter can be ignored (specify value -1).
- Specified by:
addAnnotation in interface NbDocument.Annotatable
- Parameters:
startPos - position which represent begining
of the annotated textlength - length of the annotated text. If -1 is specified
the whole line will be annotatedannotation - annotation which is attached to this text
removeAnnotation
public void removeAnnotation(Annotation annotation)
- Removal of added annotation.
- Specified by:
removeAnnotation in interface NbDocument.Annotatable
- Parameters:
annotation - annotation which is going to be removed
createDocumentProperties
protected Dictionary createDocumentProperties(Dictionary origDocumentProperties)
- Overrides:
createDocumentProperties in class BaseDocument