|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A document provider maps between domain elements and documents. A document provider has the following responsibilities:
This interface may be implemented by clients; or subclass the standard
abstract base class AbstractDocumentProvider
.
IDocument
,
AbstractDocumentProvider
Method Summary | |
void |
aboutToChange(Object element)
Informs this document provider about upcoming changes of the given element. |
void |
addElementStateListener(IElementStateListener listener)
Adds the given element state listener to this document provider. |
boolean |
canSaveDocument(Object element)
Returns whether the document provided for the given element differs from its original state which would required that it be saved. |
void |
changed(Object element)
Informs this document provider that the given element has been changed. |
void |
connect(Object element)
Connects the given element to this document provider. |
void |
disconnect(Object element)
Disconnects the given element from this document provider. |
IAnnotationModel |
getAnnotationModel(Object element)
Returns the annotation model for the given element. |
IDocument |
getDocument(Object element)
Returns the document for the given element. |
long |
getModificationStamp(Object element)
Returns the modification stamp of the given element. |
long |
getSynchronizationStamp(Object element)
Returns the time stamp of the last synchronization of the given element and it's provided document. |
boolean |
isDeleted(Object element)
Returns whether the given element has been deleted. |
boolean |
mustSaveDocument(Object element)
Returns whether the document provided for the given element must be saved. |
void |
removeElementStateListener(IElementStateListener listener)
Removes the given element state listener from this document provider. |
void |
resetDocument(Object element)
Resets the given element's document to its last saved state. |
void |
saveDocument(IProgressMonitor monitor,
Object element,
IDocument document,
boolean overwrite)
Saves the given document provided for the given element. |
Method Detail |
public void connect(Object element) throws CoreException
null
.
element
- the element
CoreException
- if the textual representation or the annotation model
of the element could not be createdpublic void disconnect(Object element)
null
.
element
- the elementpublic IDocument getDocument(Object element)
element
- the element, or null
null
if nonepublic void resetDocument(Object element) throws CoreException
elementContentAboutToBeReplaced
)
and after (elementContentReplaced
) the content is changed.
element
- the element, or null
CoreException
public void saveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException
monitor
- a progress monitor to report progress and request cancelationelement
- the element, or null
document
- the documentoverwrite
- indicates whether overwrite should be performed
while saving the given element if necessary
CoreException
- if document could not be stored to the given elementpublic long getModificationStamp(Object element)
element
- the element
public long getSynchronizationStamp(Object element)
element
- the element
public boolean isDeleted(Object element)
element
- the element
true
if the element has been deletedpublic boolean mustSaveDocument(Object element)
element
- the element, or null
true
if the document must be saved, and
false
otherwise (including the element is null
)public boolean canSaveDocument(Object element)
element
- the element, or null
true
if the document can be saved, and
false
otherwise (including the element is null
)public IAnnotationModel getAnnotationModel(Object element)
element
- the element, or null
null
if nonepublic void aboutToChange(Object element)
aboutToChange
has been and before changed
is called. In this case,
it is assumed that the document is already up to date, e.g., a save operation is a
typical case.
The concrete nature of the change notification depends on the concrete type of the
given element. If the element is, e.g., an IResource
the notification
is a resource delta.
element
- the element, or null
public void changed(Object element)
IResource
the notification is a resource delta.
element
- the element, or null
public void addElementStateListener(IElementStateListener listener)
listener
- the listenerpublic void removeElementStateListener(IElementStateListener listener)
listener
- the listener
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |