|
Runtime | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gmf.runtime.diagram.ui.resources.editor.document.AbstractDocument
public abstract class AbstractDocument
Abstract implementation of IDocument
. This class
provides implementation for registering IDocumentListener
s.
Additionally it also handles firing of DocumentEvent
to
the document listeners.
Field Summary | |
---|---|
protected java.lang.Object |
content
Content of this document. |
Fields inherited from interface org.eclipse.gmf.runtime.diagram.ui.resources.editor.document.IDocument |
---|
UNKNOWN_MODIFICATION_STAMP |
Constructor Summary | |
---|---|
AbstractDocument()
|
Method Summary | |
---|---|
void |
addDocumentListener(IDocumentListener listener)
Registers the document listener with the document. |
void |
addPrenotifiedDocumentListener(IDocumentListener listener)
Adds the given document listener as one which is notified before those document listeners added with addDocumentListener
are notified. |
protected void |
completeInitialization()
Initializes document listeners, positions, and position updaters. |
protected void |
doFireDocumentChanged(DocumentEvent event)
Notifies all listeners about the given document change. |
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)
Updates the internal document structures and informs all document listeners if listener notification has been enabled. |
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 listener)
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 documentContent,
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object content
Constructor Detail |
---|
public AbstractDocument()
Method Detail |
---|
public long getModificationStamp()
IDocument
The magnitude or sign of the numerical difference between two modification stamps is not significant.
getModificationStamp
in interface IDocument
UNKNOWN_MODIFICATION_STAMP
org.eclipse.gmf.runtime.diagram.ui.editor.IDocument#getModificationStamp()
protected void completeInitialization()
public void addDocumentListener(IDocumentListener listener)
IDocument
An IDocumentListener
may call back to this method
when being inside a document notification.
addDocumentListener
in interface IDocument
listener
- the listener to be registeredorg.eclipse.gmf.runtime.diagram.ui.editor.IDocument#addDocumentListener(org.eclipse.gmf.runtime.diagram.ui.editor.IDocumentListener)
public void removeDocumentListener(IDocumentListener listener)
IDocument
An IDocumentListener
may call back to this method
when being inside a document notification.
removeDocumentListener
in interface IDocument
listener
- the listener to be removedorg.eclipse.gmf.runtime.diagram.ui.editor.IDocument#removeDocumentListener(org.eclipse.gmf.runtime.diagram.ui.editor.IDocumentListener)
public void addPrenotifiedDocumentListener(IDocumentListener listener)
IDocument
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.
addPrenotifiedDocumentListener
in interface IDocument
listener
- the listener to be added as pre-notified document listenerorg.eclipse.gmf.runtime.diagram.ui.editor.IDocument#addPrenotifiedDocumentListener(org.eclipse.gmf.runtime.diagram.ui.editor.IDocumentListener)
public void removePrenotifiedDocumentListener(IDocumentListener listener)
IDocument
This method is not for public use.
removePrenotifiedDocumentListener
in interface IDocument
listener
- the listener to be removedorg.eclipse.gmf.runtime.diagram.ui.editor.IDocument#removePrenotifiedDocumentListener(org.eclipse.gmf.runtime.diagram.ui.editor.IDocumentListener)
public java.lang.Object getContent()
IDocument
getContent
in interface IDocument
org.eclipse.gmf.runtime.diagram.ui.editor.IDocument#getContent()
public void setContent(java.lang.Object documentContent)
IDocument
DocumentEvent
to all registered IDocumentListener
.
setContent
in interface IDocument
documentContent
- the new content of the documentorg.eclipse.gmf.runtime.diagram.ui.editor.IDocument#setContent(java.lang.Object)
public void setContent(java.lang.Object documentContent, long modificationStamp)
IDocument
DocumentEvent
to all registered IDocumentListener
.
setContent
in interface IDocument
documentContent
- the new content of the documentmodificationStamp
- of the document after setting the contentorg.eclipse.gmf.runtime.diagram.ui.editor.IDocument#setContent(java.lang.Object, long)
protected void fireDocumentAboutToBeChanged(DocumentEvent event)
event
- the event to be sent outprotected void fireDocumentChanged(DocumentEvent event)
event
- the document event to be sent outprotected void doFireDocumentChanged(DocumentEvent event)
Executes all registered post notification replace operation.
This method will be renamed to doFireDocumentChanged
.
event
- the event to be sent outpublic void resumeListenerNotification()
IDocument
stopListenerNotification
.
resumeListenerNotification
in interface IDocument
org.eclipse.gmf.runtime.diagram.ui.editor.IDocument#resumeListenerNotification()
public void stopListenerNotification()
IDocument
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.
stopListenerNotification
in interface IDocument
org.eclipse.gmf.runtime.diagram.ui.editor.IDocument#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.