Class RenameDetector
java.lang.Object
org.eclipse.emf.compare.ide.ui.internal.logical.RenameDetector
Detector for revealing potential file renames that may have occurred in
IStorageProviderAccessor.DiffSide.SOURCE or
IStorageProviderAccessor.DiffSide.REMOTE in the context of a Subscriber.-
Constructor Summary
ConstructorsConstructorDescriptionRenameDetector(org.eclipse.team.core.subscribers.Subscriber subscriber, IStorageProviderAccessor accessor) Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.base.Optional<org.eclipse.core.resources.IFile>getFileAfterRename(org.eclipse.core.resources.IFile originFile, IStorageProviderAccessor.DiffSide side) Given an origin file, this method optionally returns the correspondingIFileafter it has been renamed on the respectiveside, if it has been renamed at all.com.google.common.base.Optional<org.eclipse.core.resources.IFile>getFileBeforeRename(org.eclipse.core.resources.IFile sourceOrRemoteFile, IStorageProviderAccessor.DiffSide side) Given a source or remote file, this method optionally returns the correspondingIFilebefore it has been renamed on the respectiveside, if it has been renamed at all.
-
Constructor Details
-
RenameDetector
public RenameDetector(org.eclipse.team.core.subscribers.Subscriber subscriber, IStorageProviderAccessor accessor) Constructor.- Parameters:
subscriber- The subscriber to access the diffs. This parameter may benull, and as such, will result in no rename detection.accessor- The accessor to access the file variants.
-
-
Method Details
-
getFileBeforeRename
public com.google.common.base.Optional<org.eclipse.core.resources.IFile> getFileBeforeRename(org.eclipse.core.resources.IFile sourceOrRemoteFile, IStorageProviderAccessor.DiffSide side) Given a source or remote file, this method optionally returns the correspondingIFilebefore it has been renamed on the respectiveside, if it has been renamed at all.Only
IStorageProviderAccessor.DiffSide.SOURCEorIStorageProviderAccessor.DiffSide.REMOTEare valid values forside.- Parameters:
sourceOrRemoteFile- The potentially renamed file.side- TheIStorageProviderAccessor.DiffSideto look for the rename (onlyIStorageProviderAccessor.DiffSide.SOURCEorIStorageProviderAccessor.DiffSide.REMOTEare valid).- Returns:
- The file before the rename, if it has been renamed at all,
Optional.absent()otherwise.
-
getFileAfterRename
public com.google.common.base.Optional<org.eclipse.core.resources.IFile> getFileAfterRename(org.eclipse.core.resources.IFile originFile, IStorageProviderAccessor.DiffSide side) Given an origin file, this method optionally returns the correspondingIFileafter it has been renamed on the respectiveside, if it has been renamed at all.Only
IStorageProviderAccessor.DiffSide.SOURCEorIStorageProviderAccessor.DiffSide.REMOTEare valid values forside.- Parameters:
originFile- The potentially renamed file.side- TheIStorageProviderAccessor.DiffSideto look for the rename (onlyIStorageProviderAccessor.DiffSide.SOURCEorIStorageProviderAccessor.DiffSide.REMOTEare valid).- Returns:
- The file after the rename, if it has been renamed at all,
Optional.absent()otherwise.
-