public class NbEditorDocument extends GuardedDocument implements NbDocument.PositionBiasable, NbDocument.WriteLockable, NbDocument.Printable, NbDocument.CustomEditor, NbDocument.CustomToolbar, NbDocument.Annotatable
BaseDocument.LazyPropertyMap, BaseDocument.PropertyEvaluator
AbstractDocument.AbstractElement, AbstractDocument.AttributeContext, AbstractDocument.BranchElement, AbstractDocument.Content, AbstractDocument.DefaultDocumentEvent, AbstractDocument.ElementEdit, AbstractDocument.LeafElement
Modifier and Type | Field and Description |
---|---|
static String |
INDENT_ENGINE
Indent engine for the given kitClass.
|
FMT_GUARDED_INSERT_LOCALE, FMT_GUARDED_REMOVE_LOCALE, GUARDED_ATTRIBUTE, guardedSet, normalStyleName, styles, unguardedSet
BLOCKS_FINDER_PROP, defaultRootElem, FILE_NAME_PROP, FORMATTER, ID_PROP, inited, KIT_CLASS_PROP, LINE_BATCH_SIZE, LINE_LIMIT_PROP, LS_CR, LS_CRLF, LS_LF, MIME_TYPE_PROP, modified, READ_LINE_SEPARATOR_PROP, STRING_BWD_FINDER_PROP, STRING_FINDER_PROP, UNDO_MANAGER_PROP, WRAP_SEARCH_MARK_PROP, WRITE_LINE_SEPARATOR_PROP
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName
StreamDescriptionProperty, TitleProperty
Constructor and Description |
---|
NbEditorDocument(Class kitClass)
Deprecated.
Use of editor kit's implementation classes is deprecated
in favor of mime types.
|
NbEditorDocument(String mimeType)
Creates a new document.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(Position startPos,
int length,
Annotation annotation)
Add annotation to the document.
|
protected Dictionary |
createDocumentProperties(Dictionary origDocumentProperties) |
Component |
createEditor(JEditorPane j) |
AttributedCharacterIterator[] |
createPrintIterators() |
JToolBar |
createToolbar(JEditorPane j) |
int |
getShiftWidth() |
int |
getTabSize() |
void |
removeAnnotation(Annotation annotation)
Removal of added annotation.
|
void |
setCharacterAttributes(int offset,
int length,
AttributeSet s,
boolean replace) |
addStyle, createDocumentEvent, getBackground, getCharacterElement, getFont, getForeground, getGuardedBlockChain, getLogicalStyle, getStyle, getStyleNames, isPosGuarded, preInsertCheck, preRemoveCheck, removeStyle, runAtomic, runAtomicAsUser, setLogicalStyle, setNormalStyleName, setParagraphAttributes, toStringDetail
addAtomicLockListener, addAtomicLockListener, addDocumentListener, addPostModificationDocumentListener, addUndoableEdit, addUndoableEditListener, addUpdateDocumentListener, atomicLock, atomicUndo, atomicUnlock, breakAtomicLock, checkTrailingSpaces, createPosition, extWriteLock, extWriteUnlock, find, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAnnotations, getAtomicDepth, getChars, getChars, getChars, getDefaultRootElement, getKitClass, getParagraphElement, getRootElements, getSyntaxSupport, getText, getText, insertString, insertUpdate, invalidateSyntaxMarks, isAtomicLock, isIdentifierPart, isModifiable, isModified, isWhitespace, postRemoveUpdate, preInsertUpdate, print, print, print, processText, read, remove, removeAtomicLockListener, removeAtomicLockListener, removeDocumentListener, removePostModificationDocumentListener, removeUpdate, removeUpdateDocumentListener, render, repaintBlock, replace, resetUndoMerge, setPostModificationDocumentListener, toString, write
createBranchElement, createLeafElement, createPosition, dump, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDefaultRootElement, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, putProperty, readLock, readUnlock, removeUndoableEditListener, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createPosition
runAtomic, runAtomicAsUser
addDocumentListener, addUndoableEditListener, createPosition, getDefaultRootElement, getEndPosition, getLength, getProperty, getRootElements, getStartPosition, getText, getText, insertString, putProperty, remove, removeDocumentListener, removeUndoableEditListener, render
getParagraphElement
public static final String INDENT_ENGINE
@Deprecated public NbEditorDocument(Class kitClass)
public NbEditorDocument(String mimeType)
mimeType
- The mime type for the new document.public int getShiftWidth()
getShiftWidth
in class BaseDocument
public int getTabSize()
getTabSize
in class BaseDocument
public void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)
setCharacterAttributes
in interface StyledDocument
setCharacterAttributes
in class GuardedDocument
public AttributedCharacterIterator[] createPrintIterators()
createPrintIterators
in interface NbDocument.Printable
public Component createEditor(JEditorPane j)
createEditor
in interface NbDocument.CustomEditor
public JToolBar createToolbar(JEditorPane j)
createToolbar
in interface NbDocument.CustomToolbar
public void addAnnotation(Position startPos, int length, Annotation annotation)
addAnnotation
in interface NbDocument.Annotatable
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 textpublic void removeAnnotation(Annotation annotation)
removeAnnotation
in interface NbDocument.Annotatable
annotation
- annotation which is going to be removedprotected Dictionary createDocumentProperties(Dictionary origDocumentProperties)
createDocumentProperties
in class BaseDocument