Class FileChangesCollection
- All Implemented Interfaces:
- IFolderFileChangeListener,- IResourceDeltaVisitor,- IResourceVisitor
- Direct Known Subclasses:
- JavaManager
The tables addedOrChanged, renamedOrMoved and removed are public, but care should be taken to only work on the snap-shot copy and not the "live" one, otherwise unpredictable results may occur.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- final StringThe description of the visit.- protected IProgressMonitorA progress monitor if not null.- protected final ProjectManagerThe current Project Manager, null for none, to inform file changes.
- Constructor SummaryConstructorsConstructorDescription- FileChangesCollection- (String description, ProjectManager projectManager) Constructs the instance without specified folders.- FileChangesCollection- (String description, IFolder[] folders, ProjectManager projectManager) Constructs the instance with the specified folders.
- Method SummaryModifier and TypeMethodDescription- IFolder[]Gets the folders currently used.Gets the MultiStatus instance when visiting, in order to merge errors.- protected boolean- isFileProcessed- (IFile file) Checks if file is processed.- final boolean- isProcessed- (IResource resource) Checks if the resource is one of the folders.- void- onFileAdded- (IFile file) File has been added.- void- onFileChanged- (IFile file, int flags) File has been changed (markers, contents, etc).- void- onFileMoved- (IFile newFile, IFile oldFile) File has been moved.- void- onFileRemoved- (IFile file) File has been removed.- void- onFolderAdded- (IFolder folder) Folder has been added.- void- onFolderMoved- (IFolder newFolder, IFolder oldFolder) Folder has been moved.- void- onFolderRemoved- (IFolder folder) Folder has been removed.- void- onNewFolders- (IFolder[] folders) Called when new folders has been assigned, due to e.g.- final void- process- (IResourceDelta delta) Processes a delta, it is assumed a check for folder processing has been done using- isProcessed(folder)prior to calling this method.- void- setMultiStatus- (MultiStatus multiStatus) Assigns a MultiStatus before visit.- final void- setNewFolders- (IFolder[] folders) Assigns the folders to process.- void- setProgressMonitor- (IProgressMonitor monitor) Assigns a progress monitor to cancel lengthy job.- final booleanCalled to visit the a resource in one of the processed folders.- final boolean- visit- (IResourceDelta delta) Called to visit the delta changes in one of the processed folders.
- Field Details- descriptionThe description of the visit.
- projectManagerThe current Project Manager, null for none, to inform file changes.
- monitorA progress monitor if not null.
 
- Constructor Details- FileChangesCollectionConstructs the instance without specified folders.- Parameters:
- description- Description of the visit, if it fails.
- projectManager- Instance of Project Manager to inform of changes, null not to inform...
 
- FileChangesCollectionConstructs the instance with the specified folders.- Parameters:
- description- Description of the visit, if it fails.
- folders- The folders to process.
- projectManager- Instance of Project Manager to inform of changes, null not to inform...
 
 
- Method Details- setProgressMonitorAssigns a progress monitor to cancel lengthy job.
- setNewFoldersAssigns the folders to process.
- onNewFoldersCalled when new folders has been assigned, due to e.g. Java project settings changed to add/remove a source folder.- Subclasses should override to process the event, no need to call the - supermethod.- Parameters:
- folders- The new folders.
 
- getFoldersGets the folders currently used.
- isProcessedChecks if the resource is one of the folders.
- processProcesses a delta, it is assumed a check for folder processing has been done using- isProcessed(folder)prior to calling this method.- Parameters:
- delta- The delta for resources.
- Throws:
- CoreException- For visiting errors.
 
- setMultiStatusAssigns a MultiStatus before visit. This helps catching the exception into this multiple status that is thrown upon return.- Parameters:
- multiStatus- The multi-status or null not to use it.
 
- getMultiStatusGets the MultiStatus instance when visiting, in order to merge errors.
- visitCalled to visit the a resource in one of the processed folders.- Specified by:
- visitin interface- IResourceVisitor
- Throws:
- CoreException- For visiting errors.
 
- visitCalled to visit the delta changes in one of the processed folders.- Specified by:
- visitin interface- IResourceDeltaVisitor
- Throws:
- CoreException- For visiting errors.
 
- isFileProcessedChecks if file is processed.- Subclasses must check if this resource is to be processed and return true if it's a valid file (typically the file extension). - Parameters:
- file- The file.
- Returns:
- true if file is to be processed, false otherwise.
 
- onFileAddedFile has been added.- Subclasses should override to process the event, no need to call the - supermethod.- Specified by:
- onFileAddedin interface- IFolderFileChangeListener
- Parameters:
- file- The file.
- Throws:
- CoreException- For failures.
 
- onFileMovedFile has been moved.- Subclasses should override to process the event, no need to call the - supermethod.- Specified by:
- onFileMovedin interface- IFolderFileChangeListener
- Parameters:
- newFile- The new file.
- oldFile- The old file.
- Throws:
- CoreException- For failures.
 
- onFileChangedFile has been changed (markers, contents, etc).- Subclasses should override to process the event, no need to call the - supermethod.- Specified by:
- onFileChangedin interface- IFolderFileChangeListener
- Parameters:
- file- The file.
- flags- How the file was changed, from IResourceDelta, where the important ones are CONTENT, MARKERS, ENCODING, LOCAL_CHANGE, DERIVED_CHANGED, REPLACED.
- Throws:
- CoreException- For failures.
 
- onFileRemovedFile has been removed.- Subclasses should override to process the event, no need to call the - supermethod.- Specified by:
- onFileRemovedin interface- IFolderFileChangeListener
- Parameters:
- file- The file.
- Throws:
- CoreException- For failures.
 
- onFolderAddedFolder has been added.- Subclasses should override to process the event, no need to call the - supermethod.- Specified by:
- onFolderAddedin interface- IFolderFileChangeListener
- Parameters:
- folder- The folder.
- Throws:
- CoreException- For failures.
 
- onFolderMovedFolder has been moved.- Subclasses should override to process the event, no need to call the - supermethod.- Specified by:
- onFolderMovedin interface- IFolderFileChangeListener
- Parameters:
- newFolder- The new folder.
- oldFolder- The old folder.
- Throws:
- CoreException- For failures.
 
- onFolderRemovedFolder has been removed.- Subclasses should override to process the event, no need to call the - supermethod.- Specified by:
- onFolderRemovedin interface- IFolderFileChangeListener
- Parameters:
- folder- The folder.
- Throws:
- CoreException- For failures.