站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

NbEditorDocument (Editor Module) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.editor/3 1.32.0

org.netbeans.modules.editor
Class NbEditorDocument

java.lang.Object
  extended by javax.swing.text.AbstractDocument
      extended by org.netbeans.editor.BaseDocument
          extended by org.netbeans.editor.GuardedDocument
              extended by 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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.netbeans.editor.BaseDocument
BaseDocument.LazyPropertyMap, BaseDocument.PropertyEvaluator
 
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
static String FORMATTER
          Name of the formatter setting.
static String INDENT_ENGINE
          Indent engine for the given kitClass.
static String MIME_TYPE_PROP
          Mime type of the document.
 
Fields inherited from class org.netbeans.editor.GuardedDocument
FMT_GUARDED_INSERT_LOCALE, FMT_GUARDED_REMOVE_LOCALE, GUARDED_ATTRIBUTE, guardedSet, normalStyleName, styles, stylesToLayers, unguardedSet
 
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
 
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
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Fields inherited from interface javax.swing.text.Document
StreamDescriptionProperty, TitleProperty
 
Constructor Summary
NbEditorDocument(Class kitClass)
           
 
Method Summary
 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)
           
 Formatter getFormatter()
           
 void removeAnnotation(Annotation annotation)
          Removal of added annotation.
 void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)
           
 void settingsChange(SettingsChangeEvent evt)
           
 
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.openide.text.NbDocument.PositionBiasable
createPosition
 
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 org.openide.text.NbDocument.WriteLockable
runAtomic, runAtomicAsUser
 
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.StyledDocument
getParagraphElement
 

Field Detail

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
Constructor Detail

NbEditorDocument

public NbEditorDocument(Class kitClass)
Method Detail

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 text
length - length of the annotated text. If -1 is specified the whole line will be annotated
annotation - 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

org.netbeans.modules.editor/3 1.32.0

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.