|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.swing.text.AbstractDocument
org.netbeans.editor.BaseDocument
org.netbeans.editor.GuardedDocument
public class GuardedDocument
Extension to the guarded document that implements StyledDocument interface
| 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 |
FMT_GUARDED_INSERT_LOCALE
|
static String |
FMT_GUARDED_REMOVE_LOCALE
|
static String |
GUARDED_ATTRIBUTE
Guarded attribute used for specifying that the inserted block will be guarded. |
static SimpleAttributeSet |
guardedSet
AttributeSet with only guarded attribute |
protected String |
normalStyleName
Name of the normal style. |
protected StyleContext |
styles
Style context to hold the styles |
protected Hashtable |
stylesToLayers
Style to layer name mapping |
static SimpleAttributeSet |
unguardedSet
AttributeSet with only break-guarded attribute |
| 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 |
| Constructor Summary | |
|---|---|
GuardedDocument(Class kitClass)
|
|
GuardedDocument(Class kitClass,
boolean addToRegistry,
StyleContext styles)
Create base document with a specified syntax and style context. |
|
| Method Summary | |
|---|---|
Style |
addStyle(String styleName,
Style parent)
Adds style to the document |
protected DrawLayer |
addStyledLayer(String layerName,
Style style)
Deprecated. Please use Highlighting SPI instead, for details see Editor Library 2. |
void |
addStyleToLayerMapping(String styleName,
String layerName)
|
protected BaseDocumentEvent |
createDocumentEvent(int offset,
int length,
DocumentEvent.EventType type)
|
Color |
getBackground(AttributeSet attr)
Takes a set of attributes and turn it into a background color specification. |
Element |
getCharacterElement(int pos)
Gets the element that represents the character that is at the given offset within the document. |
Font |
getFont(AttributeSet attr)
Takes a set of attributes and turn it into a font specification. |
Color |
getForeground(AttributeSet attr)
Takes a set of attributes and turn it into a foreground color specification. |
MarkBlockChain |
getGuardedBlockChain()
Get the chain of the guarded blocks |
Style |
getLogicalStyle(int pos)
Get logical style for position in paragraph |
Style |
getStyle(String styleName)
Fetches style previously added |
Enumeration |
getStyleNames()
Fetches the list of style names |
boolean |
isPosGuarded(int pos)
|
protected void |
preInsertCheck(int offset,
String text,
AttributeSet a)
This method is called automatically before the document is updated as result of removal. |
protected void |
preRemoveCheck(int offset,
int len)
This method is called automatically before the document is updated as result of removal. |
void |
removeStyle(String styleName)
Removes style from document |
void |
runAtomic(Runnable r)
Runs the runnable under write lock. |
void |
runAtomicAsUser(Runnable r)
Runs the runnable under write lock. |
void |
setCharacterAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
|
void |
setLogicalStyle(int pos,
Style s)
Sets the logical style to use for the paragraph at the given position. |
void |
setNormalStyleName(String normalStyleName)
Set the name for normal style. |
void |
setParagraphAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
Change attributes for part of the text. |
String |
toStringDetail()
Detailed debug info about the document |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.swing.text.StyledDocument |
|---|
getParagraphElement |
| 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 |
| Field Detail |
|---|
public static final String GUARDED_ATTRIBUTE
public static final SimpleAttributeSet guardedSet
public static final SimpleAttributeSet unguardedSet
public static final String FMT_GUARDED_INSERT_LOCALE
public static final String FMT_GUARDED_REMOVE_LOCALE
protected StyleContext styles
protected Hashtable stylesToLayers
protected String normalStyleName
| Constructor Detail |
|---|
public GuardedDocument(Class kitClass)
public GuardedDocument(Class kitClass, boolean addToRegistry, StyleContext styles)
kitClass - class used to initialize this document with proper settings
category based on the editor kit for which this document is createdsyntax - syntax scanner to use with this documentstyles - style context to use| Method Detail |
|---|
public MarkBlockChain getGuardedBlockChain()
public boolean isPosGuarded(int pos)
protected void preInsertCheck(int offset,
String text,
AttributeSet a)
throws BadLocationException
preInsertCheck in class BaseDocumentevt - document event containing the change including array
of characters that will be inserted
BadLocationException
protected void preRemoveCheck(int offset,
int len)
throws BadLocationException
preRemoveCheck in class BaseDocumentoffset - position where the insertion will be donelen - length of the removal
BadLocationException
public void setCharacterAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
setCharacterAttributes in interface StyledDocumentpublic void runAtomic(Runnable r)
BaseDocument
runAtomic in class BaseDocumentpublic void runAtomicAsUser(Runnable r)
BaseDocument
runAtomicAsUser in class BaseDocumentprotected BaseDocumentEvent createDocumentEvent(int offset, int length, DocumentEvent.EventType type)
createDocumentEvent in class BaseDocumentpublic Style addStyle(String styleName, Style parent)
addStyle in interface StyledDocumentpublic void addStyleToLayerMapping(String styleName, String layerName)
public void removeStyle(String styleName)
removeStyle in interface StyledDocumentpublic Style getStyle(String styleName)
getStyle in interface StyledDocumentpublic void setNormalStyleName(String normalStyleName)
public Enumeration getStyleNames()
public void setParagraphAttributes(int offset,
int length,
AttributeSet s,
boolean replace)
setParagraphAttributes in interface StyledDocument
public void setLogicalStyle(int pos,
Style s)
setLogicalStyle in interface StyledDocumentpos - the starting position >= 0s - the style to setpublic Style getLogicalStyle(int pos)
getLogicalStyle in interface StyledDocumentpublic Element getCharacterElement(int pos)
getCharacterElement in interface StyledDocumentpos - the offset >= 0
public Color getForeground(AttributeSet attr)
getForeground in interface StyledDocumentattr - the set of attributes
public Color getBackground(AttributeSet attr)
getBackground in interface StyledDocumentattr - the set of attributes
public Font getFont(AttributeSet attr)
getFont in interface StyledDocumentattr - the set of attributes
protected DrawLayer addStyledLayer(String layerName, Style style)
DrawLayers has been deprecated.
public String toStringDetail()
BaseDocument
toStringDetail in class BaseDocument
|
org.netbeans.modules.editor.lib/1 1.14.0 3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||