Package org.eclipse.ui.editors.text
Class TextFileDocumentProvider.NullProvider
- java.lang.Object
-
- org.eclipse.ui.editors.text.TextFileDocumentProvider.NullProvider
-
- All Implemented Interfaces:
IStorageDocumentProvider
,IDocumentProvider
,IDocumentProviderExtension
,IDocumentProviderExtension2
,IDocumentProviderExtension3
,IDocumentProviderExtension4
,IDocumentProviderExtension5
- Enclosing class:
- TextFileDocumentProvider
@Deprecated protected static class TextFileDocumentProvider.NullProvider extends Object implements IDocumentProvider, IDocumentProviderExtension, IDocumentProviderExtension2, IDocumentProviderExtension3, IDocumentProviderExtension4, IDocumentProviderExtension5, IStorageDocumentProvider
Deprecated.As of 3.3 - do not use
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NullProvider()
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
aboutToChange(Object element)
Deprecated.Informs this document provider about upcoming changes of the given element.void
addElementStateListener(IElementStateListener listener)
Deprecated.Adds the given element state listener to this document provider.boolean
canSaveDocument(Object element)
Deprecated.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)
Deprecated.Informs this document provider that the given element has been changed.void
connect(Object element)
Deprecated.Connects the given element to this document provider.void
disconnect(Object element)
Deprecated.Disconnects the given element from this document provider.IAnnotationModel
getAnnotationModel(Object element)
Deprecated.Returns the annotation model for the given element.IContentType
getContentType(Object element)
Deprecated.Returns the content type of for the given element ornull
if none could be determined.String
getDefaultEncoding()
Deprecated.Returns the default character encoding used by this provider.IDocument
getDocument(Object element)
Deprecated.Returns the document for the given element.String
getEncoding(Object element)
Deprecated.Returns the character encoding for the given element, ornull
if the element is not managed by this provider.long
getModificationStamp(Object element)
Deprecated.Returns the modification stamp of the given element.IProgressMonitor
getProgressMonitor()
Deprecated.Returns this providers progress monitor.IStatus
getStatus(Object element)
Deprecated.Returns the status of the given element.long
getSynchronizationStamp(Object element)
Deprecated.Returns the time stamp of the last synchronization of the given element and its provided document.boolean
isDeleted(Object element)
Deprecated.Returns whether the given element has been deleted.boolean
isModifiable(Object element)
Deprecated.Returns whether the document provider thinks that the given element can persistently be modified.boolean
isNotSynchronizedException(Object element, CoreException ex)
Deprecated.Tells whether the given core exception is exactly the exception which is thrown for a non-synchronized element.boolean
isReadOnly(Object element)
Deprecated.Returns whether the document provider thinks that the given element is read-only.boolean
isStateValidated(Object element)
Deprecated.Returns whether the state of the given element has been validated.boolean
isSynchronized(Object element)
Deprecated.Returns whether the information provided for the given element is in sync with the element.boolean
mustSaveDocument(Object element)
Deprecated.Returns whether the document provided for the given element must be saved.void
removeElementStateListener(IElementStateListener listener)
Deprecated.Removes the given element state listener from this document provider.void
resetDocument(Object element)
Deprecated.Resets the given element's document to its last saved state.void
saveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite)
Deprecated.Saves the given document provided for the given element.void
setCanSaveDocument(Object element)
Deprecated.Marks the document managed for the given element as savable.void
setEncoding(Object element, String encoding)
Deprecated.Sets the encoding for the given element.void
setProgressMonitor(IProgressMonitor progressMonitor)
Deprecated.Sets this providers progress monitor.void
synchronize(Object element)
Deprecated.Synchronizes the document provided for the given element with the given element.void
updateStateCache(Object element)
Deprecated.Updates the state cache for the given element.void
validateState(Object element, Object computationContext)
Deprecated.Validates the state of the given element.
-
-
-
Method Detail
-
connect
public void connect(Object element) throws CoreException
Deprecated.Description copied from interface:IDocumentProvider
Connects the given element to this document provider. This tells the provider that caller of this method is interested to work with the document provided for the given domain model element. By counting the invocations of this method anddisconnect(Object)
this provider can assume to know the correct number of clients working with the document provided for that domain model element.The given element must not be
null
.- Specified by:
connect
in interfaceIDocumentProvider
- Parameters:
element
- the element- Throws:
CoreException
- if the textual representation or the annotation model of the element could not be created
-
disconnect
public void disconnect(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Disconnects the given element from this document provider. This tells the provider that the caller of this method is no longer interested in working with the document provided for the given domain model element. By counting the invocations ofconnect(Object)
and of this method this provider can assume to know the correct number of clients working with the document provided for that domain model element.The given element must not be
null
.- Specified by:
disconnect
in interfaceIDocumentProvider
- Parameters:
element
- the element
-
getDocument
public IDocument getDocument(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Returns the document for the given element. Usually the document contains a textual presentation of the content of the element, or is the element itself.- Specified by:
getDocument
in interfaceIDocumentProvider
- Parameters:
element
- the element, ornull
- Returns:
- the document, or
null
if none
-
resetDocument
public void resetDocument(Object element) throws CoreException
Deprecated.Description copied from interface:IDocumentProvider
Resets the given element's document to its last saved state. Element state listeners are notified both before (elementContentAboutToBeReplaced
) and after (elementContentReplaced
) the content is changed.- Specified by:
resetDocument
in interfaceIDocumentProvider
- Parameters:
element
- the element, ornull
- Throws:
CoreException
- if document could not be reset for the given element
-
saveDocument
public void saveDocument(IProgressMonitor monitor, Object element, IDocument document, boolean overwrite) throws CoreException
Deprecated.Description copied from interface:IDocumentProvider
Saves the given document provided for the given element.- Specified by:
saveDocument
in interfaceIDocumentProvider
- Parameters:
monitor
- a progress monitor to report progress and request cancelationelement
- the element, ornull
document
- the documentoverwrite
- 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
-
getModificationStamp
public long getModificationStamp(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Returns the modification stamp of the given element.- Specified by:
getModificationStamp
in interfaceIDocumentProvider
- Parameters:
element
- the element- Returns:
- the modification stamp of the given element
-
getSynchronizationStamp
public long getSynchronizationStamp(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Returns the time stamp of the last synchronization of the given element and its provided document.- Specified by:
getSynchronizationStamp
in interfaceIDocumentProvider
- Parameters:
element
- the element- Returns:
- the synchronization stamp of the given element
-
isDeleted
public boolean isDeleted(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Returns whether the given element has been deleted.- Specified by:
isDeleted
in interfaceIDocumentProvider
- Parameters:
element
- the element- Returns:
true
if the element has been deleted
-
mustSaveDocument
public boolean mustSaveDocument(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Returns whether the document provided for the given element must be saved.- Specified by:
mustSaveDocument
in interfaceIDocumentProvider
- Parameters:
element
- the element, ornull
- Returns:
true
if the document must be saved, andfalse
otherwise (including the element isnull
)
-
canSaveDocument
public boolean canSaveDocument(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Returns whether the document provided for the given element differs from its original state which would required that it be saved.- Specified by:
canSaveDocument
in interfaceIDocumentProvider
- Parameters:
element
- the element, ornull
- Returns:
true
if the document can be saved, andfalse
otherwise (including the element isnull
)
-
getAnnotationModel
public IAnnotationModel getAnnotationModel(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Returns the annotation model for the given element.- Specified by:
getAnnotationModel
in interfaceIDocumentProvider
- Parameters:
element
- the element, ornull
- Returns:
- the annotation model, or
null
if none
-
aboutToChange
public void aboutToChange(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Informs this document provider about upcoming changes of the given element. The changes might cause change notifications specific for the type of the given element. If this provider manages a document for the given element, the document provider must not change the document because of the notifications received afteraboutToChange
has been and beforechanged
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.- Specified by:
aboutToChange
in interfaceIDocumentProvider
- Parameters:
element
- the element, ornull
-
changed
public void changed(Object element)
Deprecated.Description copied from interface:IDocumentProvider
Informs this document provider that the given element has been changed. All notifications have been sent out. If this provider manages a document for the given element, the document provider must from now on change the document on the receipt of change notifications. The concrete nature of the change notification depends on the concrete type of the given element. If the element is, e.g., anIResource
the notification is a resource delta.- Specified by:
changed
in interfaceIDocumentProvider
- Parameters:
element
- the element, ornull
-
addElementStateListener
public void addElementStateListener(IElementStateListener listener)
Deprecated.Description copied from interface:IDocumentProvider
Adds the given element state listener to this document provider. Has no effect if an identical listener is already registered.- Specified by:
addElementStateListener
in interfaceIDocumentProvider
- Parameters:
listener
- the listener
-
removeElementStateListener
public void removeElementStateListener(IElementStateListener listener)
Deprecated.Description copied from interface:IDocumentProvider
Removes the given element state listener from this document provider. Has no effect if an identical listener is not registered.- Specified by:
removeElementStateListener
in interfaceIDocumentProvider
- Parameters:
listener
- the listener
-
isReadOnly
public boolean isReadOnly(Object element)
Deprecated.Description copied from interface:IDocumentProviderExtension
Returns whether the document provider thinks that the given element is read-only. If this method returnstrue
,saveDocument
could fail. This method does not say anything about the document constructed from the given element. If the given element is not connected to this document provider, the return value is undefined. Document providers are allowed to use a cache to answer this question, i.e. there can be a difference between the "real" state of the element and the return value.- Specified by:
isReadOnly
in interfaceIDocumentProviderExtension
- Parameters:
element
- the element- Returns:
true
if the given element is read-only,false
otherwise
-
isModifiable
public boolean isModifiable(Object element)
Deprecated.Description copied from interface:IDocumentProviderExtension
Returns whether the document provider thinks that the given element can persistently be modified. This is orthogonal toisReadOnly
as read-only elements may be modifiable and writable elements may not be modifiable. If the given element is not connected to this document provider, the result is undefined. Document providers are allowed to use a cache to answer this question, i.e. there can be a difference between the "real" state of the element and the return value.- Specified by:
isModifiable
in interfaceIDocumentProviderExtension
- Parameters:
element
- the element- Returns:
true
if the given element is modifiable,false
otherwise
-
validateState
public void validateState(Object element, Object computationContext) throws CoreException
Deprecated.Description copied from interface:IDocumentProviderExtension
Validates the state of the given element. This method may change the "real" state of the element. If using, it also updates the internal caches, so that this method may also change the results returned byisReadOnly
andisModifiable
. If the given element is not connected to this document provider, the effect is undefined.- Specified by:
validateState
in interfaceIDocumentProviderExtension
- Parameters:
element
- the elementcomputationContext
- the context in which the computation is performed, e.g., a SWT shell- Throws:
CoreException
- if validating fails
-
isStateValidated
public boolean isStateValidated(Object element)
Deprecated.Description copied from interface:IDocumentProviderExtension
Returns whether the state of the given element has been validated.- Specified by:
isStateValidated
in interfaceIDocumentProviderExtension
- Parameters:
element
- the element- Returns:
true
if the state has been validated
-
updateStateCache
public void updateStateCache(Object element) throws CoreException
Deprecated.Description copied from interface:IDocumentProviderExtension
Updates the state cache for the given element. This method may change the result returned byisReadOnly
andisModifiable
. If the given element is not connected to this document provider, the effect is undefined.- Specified by:
updateStateCache
in interfaceIDocumentProviderExtension
- Parameters:
element
- the element- Throws:
CoreException
- if validating fails
-
setCanSaveDocument
public void setCanSaveDocument(Object element)
Deprecated.Description copied from interface:IDocumentProviderExtension
Marks the document managed for the given element as savable. I.e.canBeSaved(element)
will returntrue
afterwards.- Specified by:
setCanSaveDocument
in interfaceIDocumentProviderExtension
- Parameters:
element
- the element
-
getStatus
public IStatus getStatus(Object element)
Deprecated.Description copied from interface:IDocumentProviderExtension
Returns the status of the given element.- Specified by:
getStatus
in interfaceIDocumentProviderExtension
- Parameters:
element
- the element- Returns:
- the status of the given element
-
synchronize
public void synchronize(Object element) throws CoreException
Deprecated.Description copied from interface:IDocumentProviderExtension
Synchronizes the document provided for the given element with the given element. After that callgetSynchronizationTimeStamp
andgetModificationTimeStamp
return the same value.- Specified by:
synchronize
in interfaceIDocumentProviderExtension
- Parameters:
element
- the element- Throws:
CoreException
- if the synchronization could not be performed
-
setProgressMonitor
public void setProgressMonitor(IProgressMonitor progressMonitor)
Deprecated.Description copied from interface:IDocumentProviderExtension2
Sets this providers progress monitor.- Specified by:
setProgressMonitor
in interfaceIDocumentProviderExtension2
- Parameters:
progressMonitor
- the progress monitor
-
getProgressMonitor
public IProgressMonitor getProgressMonitor()
Deprecated.Description copied from interface:IDocumentProviderExtension2
Returns this providers progress monitor.- Specified by:
getProgressMonitor
in interfaceIDocumentProviderExtension2
- Returns:
- IProgressMonitor
-
isSynchronized
public boolean isSynchronized(Object element)
Deprecated.Description copied from interface:IDocumentProviderExtension3
Returns whether the information provided for the given element is in sync with the element.- Specified by:
isSynchronized
in interfaceIDocumentProviderExtension3
- Parameters:
element
- the element- Returns:
true
if the information is in sync with the element,false
otherwise
-
isNotSynchronizedException
public boolean isNotSynchronizedException(Object element, CoreException ex)
Deprecated.Description copied from interface:IDocumentProviderExtension5
Tells whether the given core exception is exactly the exception which is thrown for a non-synchronized element.- Specified by:
isNotSynchronizedException
in interfaceIDocumentProviderExtension5
- Parameters:
element
- the elementex
- the core exception- Returns:
true
iff the given core exception is exactly the exception which is thrown for a non-synchronized element
-
getDefaultEncoding
public String getDefaultEncoding()
Deprecated.Description copied from interface:IStorageDocumentProvider
Returns the default character encoding used by this provider.- Specified by:
getDefaultEncoding
in interfaceIStorageDocumentProvider
- Returns:
- the default character encoding used by this provider
-
getEncoding
public String getEncoding(Object element)
Deprecated.Description copied from interface:IStorageDocumentProvider
Returns the character encoding for the given element, ornull
if the element is not managed by this provider.- Specified by:
getEncoding
in interfaceIStorageDocumentProvider
- Parameters:
element
- the element- Returns:
- the encoding for the given element
-
setEncoding
public void setEncoding(Object element, String encoding)
Deprecated.Description copied from interface:IStorageDocumentProvider
Sets the encoding for the given element. Ifencoding
isnull
the workbench's character encoding should be used.- Specified by:
setEncoding
in interfaceIStorageDocumentProvider
- Parameters:
element
- the elementencoding
- the encoding to be used
-
getContentType
public IContentType getContentType(Object element) throws CoreException
Deprecated.Description copied from interface:IDocumentProviderExtension4
Returns the content type of for the given element ornull
if none could be determined. If the element's document can be saved, the returned content type is determined by the document's current content.- Specified by:
getContentType
in interfaceIDocumentProviderExtension4
- Parameters:
element
- the element- Returns:
- the content type or
null
- Throws:
CoreException
- if reading or accessing the underlying store fails
-
-