|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.eclipse.jface.text.AbstractDocument | +--org.eclipse.jface.text.ChildDocument
A child document represent a range of its parent document.
The child document is always in sync with its parent document
by utilizing the parent document as its ITextStore
.
This class is for internal use only.
ITextStore
Nested Class Summary |
Nested classes inherited from class org.eclipse.jface.text.IDocumentExtension |
IDocumentExtension.IReplace |
Field Summary |
Fields inherited from interface org.eclipse.jface.text.IDocument |
DEFAULT_CATEGORY, DEFAULT_CONTENT_TYPE |
Constructor Summary | |
ChildDocument(IDocument parentDocument,
Position range)
Creates a child document for the given range of the given parent document. |
Method Summary | |
protected void |
fireDocumentAboutToBeChanged(DocumentEvent event)
Fires the given document event to all registers document listeners informing them about the forthcoming document manipulation. |
protected void |
fireDocumentChanged(DocumentEvent event)
Ignores the given event and sends the similar child document event instead. |
IDocument |
getParentDocument()
Returns parent document |
Position |
getParentDocumentRange()
Returns the range of the parent document covered by this child document. |
void |
parentDocumentAboutToBeChanged(DocumentEvent event)
When called this child document is informed about a forthcoming change of its parent document. |
void |
parentDocumentChanged(DocumentEvent event)
When called this child document is informed about a change of its parent document. |
void |
registerPostNotificationReplace(IDocumentListener owner,
IDocumentExtension.IReplace replace)
Callback for document listeners to be used inside documentChanged
to register a post notification replace operation on the document notifying them. |
void |
replace(int offset,
int length,
String text)
Subsitutes the given text for the specified document range. |
void |
set(String text)
Replaces the content of the document with the given text. |
void |
setParentDocumentRange(int offset,
int length)
Sets the child document's parent document range. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ChildDocument(IDocument parentDocument, Position range)
parentDocument
- the parent Documentrange
- the parent document range covered by the child documentMethod Detail |
public void setParentDocumentRange(int offset, int length) throws BadLocationException
offset
- the offset of the parent document rangelength
- the length of the parent document range
BadLocationException
public IDocument getParentDocument()
public Position getParentDocumentRange()
public void parentDocumentAboutToBeChanged(DocumentEvent event)
event
- the parent document eventpublic void parentDocumentChanged(DocumentEvent event)
event
- the parent document eventprotected void fireDocumentAboutToBeChanged(DocumentEvent event)
AbstractDocument
fireDocumentAboutToBeChanged
in class AbstractDocument
event
- the event to be sent outprotected void fireDocumentChanged(DocumentEvent event)
fireDocumentChanged
in class AbstractDocument
event
- the event to be ignoredIDocumentExtension
public void replace(int offset, int length, String text) throws BadLocationException
IDocument
DocumentEvent
to all registered IDocumentListener
.
replace
in interface IDocument
replace
in class AbstractDocument
offset
- the document offsetlength
- the length of the specified rangetext
- the substitution text
BadLocationException
- if the offset is invalid in this documentDocumentEvent
,
IDocumentListener
public void set(String text)
IDocument
DocumentEvent
to all registered IDocumentListener
.
This method is a convenience method for
replace(0, getLength(), text)
.
set
in interface IDocument
set
in class AbstractDocument
text
- the new content of the documentDocumentEvent
,
IDocumentListener
public void registerPostNotificationReplace(IDocumentListener owner, IDocumentExtension.IReplace replace)
IDocumentExtension
documentChanged
to register a post notification replace operation on the document notifying them.
registerPostNotificationReplace
in interface IDocumentExtension
registerPostNotificationReplace
in class AbstractDocument
owner
- the owner of the replace operation
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |