Class RemoteMappingContextStorageAccessor
java.lang.Object
org.eclipse.emf.compare.ide.ui.internal.logical.RemoteMappingContextStorageAccessor
- All Implemented Interfaces:
IStorageProviderAccessor
This will use a
RemoteResourceMappingContext in order to fetch the content of the sides of a
comparison during model resolving.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.emf.compare.ide.ui.logical.IStorageProviderAccessor
IStorageProviderAccessor.DiffSide -
Constructor Summary
ConstructorsConstructorDescriptionRemoteMappingContextStorageAccessor(org.eclipse.core.resources.mapping.RemoteResourceMappingContext context) Wraps the given mapping context within this accessor. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.core.resources.IFilegetFileAfterRename(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.org.eclipse.core.resources.IFilegetFileBeforeRename(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.getStorageProvider(org.eclipse.core.resources.IResource resource, IStorageProviderAccessor.DiffSide side) This will be called by the URI Converter to get the content associated with the given local resource (which might not exist locally).booleanisInSync(org.eclipse.core.resources.IResource resource) Checks whether the given resource is considered "in sync".
-
Constructor Details
-
RemoteMappingContextStorageAccessor
public RemoteMappingContextStorageAccessor(org.eclipse.core.resources.mapping.RemoteResourceMappingContext context) Wraps the given mapping context within this accessor.- Parameters:
context- The wrapped context.
-
-
Method Details
-
getStorageProvider
public IStorageProvider getStorageProvider(org.eclipse.core.resources.IResource resource, IStorageProviderAccessor.DiffSide side) throws org.eclipse.core.runtime.CoreException This will be called by the URI Converter to get the content associated with the given local resource (which might not exist locally).- Specified by:
getStorageProviderin interfaceIStorageProviderAccessor- Parameters:
resource- The resource we need content for.side- Side of the content we seek.- Returns:
- The content for the given side of the given resource.
- Throws:
org.eclipse.core.runtime.CoreException- Thrown if the underlying provider cannot be retrieved.
-
isInSync
public boolean isInSync(org.eclipse.core.resources.IResource resource) throws org.eclipse.core.runtime.CoreException Checks whether the given resource is considered "in sync".- Specified by:
isInSyncin interfaceIStorageProviderAccessor- Parameters:
resource- The resource to check.- Returns:
trueif this resource is in sync with its remote variant,falseotherwise.- Throws:
org.eclipse.core.runtime.CoreException- Thrown if we cannot get the diff for this resource.
-
getFileBeforeRename
public 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.Implementers should delegate this to
RenameDetector.- Specified by:
getFileBeforeRenamein interfaceIStorageProviderAccessor- 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,
nullotherwise.
-
getFileAfterRename
public 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.Implementers should delegate this to
RenameDetector.- Specified by:
getFileAfterRenamein interfaceIStorageProviderAccessor- 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,
nullotherwise.
-