org.netbeans.modules.editor/3 1.42.0 3

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, 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

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 INDENT_ENGINE
          Indent engine for the given kitClass.
 
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, 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
 
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)
          Deprecated. Use of editor kit's implementation classes is deprecated in favor of mime types.
NbEditorDocument(String mimeType)
          Creates a new document.
 
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)
           
 int getShiftWidth()
           
 int getTabSize()
           
 void removeAnnotation(Annotation annotation)
          Removal of added annotation.
 void setCharacterAttributes(int offset, int length, AttributeSet s, boolean replace)
           
 
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 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

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)
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
Method Detail

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 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.42.0 3

Built on December 3 2008.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.