public abstract class SourceFileDocumentProvider extends org.eclipse.ui.editors.text.TextFileDocumentProvider implements IWorkingCopyManager
TextFileDocumentProvider
specialized for
working copy management of source files.Modifier and Type | Class and Description |
---|---|
protected static class |
SourceFileDocumentProvider.SourceFileInfo |
org.eclipse.ui.editors.text.TextFileDocumentProvider.DocumentProviderOperation, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileBufferListener, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo, org.eclipse.ui.editors.text.TextFileDocumentProvider.NullProvider
Constructor and Description |
---|
SourceFileDocumentProvider()
Creates a new source file document provider with no parent.
|
SourceFileDocumentProvider(org.eclipse.ui.texteditor.IDocumentProvider parent)
Creates a new source file document provider with the given parent.
|
Modifier and Type | Method and Description |
---|---|
protected ISourceFile |
acquireWorkingCopy(java.lang.Object element,
org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo info)
Attempts to acquire a working copy for the given element.
|
protected org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo |
createEmptyFileInfo() |
protected org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo |
createFileInfo(java.lang.Object element) |
protected void |
disposeFileInfo(java.lang.Object element,
org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo info) |
protected abstract ISourceFile |
getSourceFile(java.lang.Object element)
Returns the source file for the given element.
|
ISourceFile[] |
getWorkingCopies()
Returns all working copies that are currently managed by this manager.
|
ISourceFile |
getWorkingCopy(org.eclipse.jface.text.IDocument document)
Returns the working copy managed for the given document.
|
ISourceFile |
getWorkingCopy(java.lang.Object element)
Returns the working copy managed for the given element.
|
protected void |
releaseWorkingCopy(ISourceFile workingCopy,
java.lang.Object element,
org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo info)
Releases the working copy acquired via a call to
#acquireWorkingCopy(Object, FileInfo) . |
aboutToChange, addElementStateListener, canSaveDocument, changed, commitFileBuffer, computeSchedulingRule, connect, createAnnotationModel, createFileFromDocument, createSaveOperation, disconnect, executeOperation, fireElementStateChangeFailed, fireElementStateChanging, getAnnotationModel, getConnectedElementsIterator, getContentType, getDefaultEncoding, getDocument, getElements, getEncoding, getFileInfo, getFileInfosIterator, getFileStore, getModificationStamp, getOperationRunner, getParentProvider, getProgressMonitor, getStatus, getSynchronizationStamp, getSystemFile, handleCoreException, isDeleted, isModifiable, isNotSynchronizedException, isReadOnly, isStateValidated, isSynchronized, isSystemFileReadOnly, mustSaveDocument, removeElementStateListener, resetDocument, saveDocument, setCanSaveDocument, setEncoding, setParentDocumentProvider, setProgressMonitor, setUpSynchronization, synchronize, updateStateCache, validateState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect, disconnect
public SourceFileDocumentProvider()
public SourceFileDocumentProvider(org.eclipse.ui.texteditor.IDocumentProvider parent)
parent
- the parent document providerpublic ISourceFile getWorkingCopy(java.lang.Object element)
IWorkingCopyManager
getWorkingCopy
in interface IWorkingCopyManager
element
- the element for which to find the working copy,
or null
null
if nonepublic ISourceFile getWorkingCopy(org.eclipse.jface.text.IDocument document)
IWorkingCopyManager
Note: An implementation may go through the list of working copies and test whether the working copy buffer's document is equal to the given one. Therefore, this method should not be used in performance critical code.
getWorkingCopy
in interface IWorkingCopyManager
document
- the document for which to find the working copy,
or null
null
if nonepublic ISourceFile[] getWorkingCopies()
IWorkingCopyManager
getWorkingCopies
in interface IWorkingCopyManager
null
)protected abstract ISourceFile getSourceFile(java.lang.Object element)
element
- the elementnull
if noneprotected org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo createEmptyFileInfo()
createEmptyFileInfo
in class org.eclipse.ui.editors.text.TextFileDocumentProvider
protected org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo createFileInfo(java.lang.Object element) throws org.eclipse.core.runtime.CoreException
createFileInfo
in class org.eclipse.ui.editors.text.TextFileDocumentProvider
org.eclipse.core.runtime.CoreException
protected void disposeFileInfo(java.lang.Object element, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo info)
disposeFileInfo
in class org.eclipse.ui.editors.text.TextFileDocumentProvider
protected ISourceFile acquireWorkingCopy(java.lang.Object element, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo info) throws org.eclipse.core.runtime.CoreException
#releaseWorkingCopy(ISourceFile, Object, FileInfo)
.element
- the elementinfo
- the element infonull
if no working copy
can be acquired for the given elementorg.eclipse.core.runtime.CoreException
- if working copy could not be acquired successfullyprotected void releaseWorkingCopy(ISourceFile workingCopy, java.lang.Object element, org.eclipse.ui.editors.text.TextFileDocumentProvider.FileInfo info)
#acquireWorkingCopy(Object, FileInfo)
.workingCopy
- the working copy to releaseelement
- the elementinfo
- the element info