Package org.eclipse.ui.editors.text
Class FileDocumentProvider.FileSynchronizer
java.lang.Object
org.eclipse.ui.editors.text.FileDocumentProvider.FileSynchronizer
- All Implemented Interfaces:
EventListener,IResourceChangeListener,IResourceDeltaVisitor
- Enclosing class:
FileDocumentProvider
protected class FileDocumentProvider.FileSynchronizer
extends Object
implements IResourceChangeListener, IResourceDeltaVisitor
Synchronizes the document with external resource changes.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IFileEditorInputThe file editor input.protected booleanA flag indicating whether this synchronizer is installed or not.Fields inherited from interface org.eclipse.core.resources.IResourceChangeListener
PROPERTY_EVENT_MASK -
Constructor Summary
ConstructorsConstructorDescriptionFileSynchronizer(IFileEditorInput fileEditorInput) Creates a new file synchronizer.FileSynchronizer(FileEditorInput fileEditorInput) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected IFilegetFile()Returns the file wrapped by the file editor input.voidinstall()Installs the synchronizer on the input's file.voidNotifies this listener that some resource changes are happening, or have already happened.voidUninstalls the synchronizer from the input's file.protected voidPosts the update code "behind" the running operation.booleanvisit(IResourceDelta delta) Visits the given resource delta.
-
Field Details
-
fFileEditorInput
The file editor input. -
fIsInstalled
protected boolean fIsInstalledA flag indicating whether this synchronizer is installed or not.- Since:
- 2.1
-
-
Constructor Details
-
FileSynchronizer
Creates a new file synchronizer. Is not yet installed on a resource.- Parameters:
fileEditorInput- the editor input to be synchronized
-
FileSynchronizer
Deprecated.useFileSynchronizer(IFileEditorInput)Creates a new file synchronizer which is not yet installed on a resource.- Parameters:
fileEditorInput- the editor input to be synchronized
-
-
Method Details
-
getFile
Returns the file wrapped by the file editor input.- Returns:
- the file wrapped by the editor input associated with that synchronizer
-
install
public void install()Installs the synchronizer on the input's file. -
uninstall
public void uninstall()Uninstalls the synchronizer from the input's file. -
resourceChanged
Description copied from interface:IResourceChangeListenerNotifies this listener that some resource changes are happening, or have already happened.The supplied event gives details. This event object (and the resource delta within it) is valid only for the duration of the invocation of this method.
Note: This method is called by the platform; it is not intended to be called directly by clients.
Note that during resource change event notification, further changes to resources may be disallowed.
- Specified by:
resourceChangedin interfaceIResourceChangeListener- Parameters:
e- the resource change event- See Also:
-
visit
Description copied from interface:IResourceDeltaVisitorVisits the given resource delta.- Specified by:
visitin interfaceIResourceDeltaVisitor- Returns:
trueif the resource delta's children should be visited;falseif they should be skipped.- Throws:
CoreException- if the visit fails for some reason.
-
update
Posts the update code "behind" the running operation.- Parameters:
runnable- the update code
-
FileSynchronizer(IFileEditorInput)