|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IDocument
An IDocument
represents extensible content providing support
A document allows to set its content and to manipulate it.
On each document change, all registered document listeners are informed exactly once.
IDocumentListener
Field Summary | |
---|---|
static long |
UNKNOWN_MODIFICATION_STAMP
The unknown modification stamp. |
Method Summary | |
---|---|
void |
addDocumentListener(IDocumentListener listener)
Registers the document listener with the document. |
void |
addPrenotifiedDocumentListener(IDocumentListener documentAdapter)
Adds the given document listener as one which is notified before those document listeners added with addDocumentListener
are notified. |
java.lang.Object |
getContent()
Returns this document's contents. |
long |
getModificationStamp()
Returns the modification stamp of this document. |
void |
removeDocumentListener(IDocumentListener listener)
Removes the listener from the document's list of document listeners. |
void |
removePrenotifiedDocumentListener(IDocumentListener documentAdapter)
Removes the given document listener from the document's list of pre-notified document listeners. |
void |
resumeListenerNotification()
Resumes the notification of document listeners which must previously have been stopped by a call to stopListenerNotification . |
void |
setContent(java.lang.Object documentContent)
Replaces the content of the document with the given content. |
void |
setContent(java.lang.Object content,
long modificationStamp)
Replaces the content of the document with the given text. |
void |
stopListenerNotification()
The affect of these calls is that no document listener is notified until resumeListenerNotification is called. |
Field Detail |
---|
static final long UNKNOWN_MODIFICATION_STAMP
Method Detail |
---|
long getModificationStamp()
The magnitude or sign of the numerical difference between two modification stamps is not significant.
UNKNOWN_MODIFICATION_STAMP
void addDocumentListener(IDocumentListener listener)
An IDocumentListener
may call back to this method
when being inside a document notification.
listener
- the listener to be registeredvoid removeDocumentListener(IDocumentListener listener)
An IDocumentListener
may call back to this method
when being inside a document notification.
listener
- the listener to be removedvoid addPrenotifiedDocumentListener(IDocumentListener documentAdapter)
addDocumentListener
are notified. If the given listener is also registered using
addDocumentListener
it will be notified twice.
If the listener is already registered nothing happens.This method is not for public use.
documentAdapter
- the listener to be added as pre-notified document listenerremovePrenotifiedDocumentListener(IDocumentListener)
void removePrenotifiedDocumentListener(IDocumentListener documentAdapter)
This method is not for public use.
documentAdapter
- the listener to be removedaddPrenotifiedDocumentListener(IDocumentListener)
java.lang.Object getContent()
void setContent(java.lang.Object documentContent)
DocumentEvent
to all registered IDocumentListener
.
documentContent
- the new content of the documentDocumentEvent
,
IDocumentListener
void setContent(java.lang.Object content, long modificationStamp)
DocumentEvent
to all registered IDocumentListener
.
content
- the new content of the documentmodificationStamp
- of the document after setting the contentDocumentEvent
,
IDocumentListener
void stopListenerNotification()
resumeListenerNotification
is called. This allows clients
to update structure before any listener is informed about the change.
Listener notification can only be stopped for a single replace
operation.
Otherwise, document change notifications will be lost.
void resumeListenerNotification()
stopListenerNotification
.
|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp., Borland Software Corp., and others 2005,2006. All rights reserved.