Interface ISharedDocumentAdapter

    • Method Detail

      • getDocumentKey

        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. Returns null if the element does not have a shared document.
        Parameters:
        element - the element being queried for a shared document
        Returns:
        the object that acts as the key to obtain a document provider and document or null
      • flushDocument

        void flushDocument​(IDocumentProvider provider,
                           IEditorInput documentKey,
                           IDocument document,
                           boolean overwrite)
                    throws CoreException
        Flush the contents of the given document into the typed element that provided the document. This method is invoked by the Compare framework classes when a request to flush the viewers has been made. It is up to the implementor to decide whether the changes in the buffer should be saved to disk at the time of the flush or buffered to be saved at a later time.
        Parameters:
        provider - the document provider
        documentKey - the element's key returned from getDocumentKey(Object)
        document - the document
        overwrite - indicates whether overwrite should be performed while saving the given element if necessary
        Throws:
        CoreException - if document could not be stored to the given element
        See Also:
        IDocumentProvider.saveDocument(IProgressMonitor, Object, IDocument, boolean)