public interface ISharedDocumentAdapter
ISharedDocumentAdapter
is used to map an
ITypedElement
to a shared document for the purposes of editing.SharedDocumentAdapter
or
SharedDocumentAdapterWrapper
.Modifier and Type | Method and Description |
---|---|
void |
connect(IDocumentProvider provider,
IEditorInput documentKey)
Connect the given element to its document provider.
|
void |
disconnect(IDocumentProvider provider,
IEditorInput documentKey)
Disconnect the element from the document provider.
|
void |
disconnect(Object element)
A helper disconnect method that looks up the appropriate key (using
getDocumentKey(Object)
and the appropriate provider and calls disconnect(IDocumentProvider, IEditorInput) . |
void |
flushDocument(IDocumentProvider provider,
IEditorInput documentKey,
IDocument document,
boolean overwrite)
Flush the contents of the given document into the typed element that provided the
document.
|
IEditorInput |
getDocumentKey(Object element)
Return the object that is to be used as the key for retrieving the
appropriate
IDocumentProvider from the
DocumentProviderRegistry and for obtaining the shared
IDocument from the document provider. |
IEditorInput getDocumentKey(Object element)
IDocumentProvider
from the
DocumentProviderRegistry
and for obtaining the shared
IDocument
from the document provider. Returns null
if the element does not have a shared document.element
- the element being queried for a shared documentnull
void connect(IDocumentProvider provider, IEditorInput documentKey) throws CoreException
provider
- the document providerdocumentKey
- the element's key returned from getDocumentKey(Object)
CoreException
- if connection was not possibleIDocumentProvider.connect(Object)
void disconnect(IDocumentProvider provider, IEditorInput documentKey)
provider
- the document providerdocumentKey
- the element's key returned from getDocumentKey(Object)
IDocumentProvider.disconnect(Object)
void disconnect(Object element)
getDocumentKey(Object)
and the appropriate provider and calls disconnect(IDocumentProvider, IEditorInput)
.element
- the element that was used to previously connect to a documentIDocumentProvider.disconnect(Object)
void flushDocument(IDocumentProvider provider, IEditorInput documentKey, IDocument document, boolean overwrite) throws CoreException
provider
- the document providerdocumentKey
- the element's key returned from getDocumentKey(Object)
document
- the documentoverwrite
- indicates whether overwrite should be performed
while saving the given element if necessaryCoreException
- if document could not be stored to the given elementIDocumentProvider.saveDocument(IProgressMonitor, Object, IDocument, boolean)
Copyright (c) 2000, 2015 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.