当前页面:
在线文档首页 >
NetBeans API Javadoc (Current Development Version)
NbEditorDocument (Editor Module) - NetBeans API Javadoc (Current Development Version)
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, EventListener, Document, StyledDocument, AtomicLockDocument, SettingsChangeListener, 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, ID_PROP, inited, KIT_CLASS_PROP, LINE_BATCH_SIZE, LINE_LIMIT_PROP, lineRootElement, LS_CR, LS_CRLF, LS_LF, 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, atomicLock, atomicUndo, atomicUnlock, breakAtomicLock, checkTrailingSpaces, createPosition, extWriteLock, extWriteUnlock, find, findLayer, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAnnotations, getAtomicDepth, getChars, getChars, getChars, getDefaultRootElement, getKitClass, getParagraphElement, getRootElements, getShiftWidth, getSyntaxSupport, getTabSize, getText, getText, insertString, insertUpdate, invalidateSyntaxMarks, isAtomicLock, isIdentifierPart, isModified, isWhitespace, postRemoveUpdate, preInsertUpdate, print, print, print, processText, read, remove, removeAtomicLockListener, removeDocumentListener, removeUpdate, 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 |
FORMATTER
public static final String FORMATTER
- Name of the formatter setting.
- See Also:
- Constant Field Values
MIME_TYPE_PROP
public static final String MIME_TYPE_PROP
- Mime type of the document. The name of this property corresponds
to the property that is filled in the document by CloneableEditorSupport.
- See Also:
- Constant Field Values
INDENT_ENGINE
public static final String INDENT_ENGINE
- Indent engine for the given kitClass.
- See Also:
- Constant Field Values
NbEditorDocument
public NbEditorDocument(Class kitClass)
settingsChange
public void settingsChange(SettingsChangeEvent evt)
- Specified by:
settingsChange
in interface SettingsChangeListener
- Overrides:
settingsChange
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
getFormatter
public Formatter getFormatter()
- Overrides:
getFormatter
in class BaseDocument
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