Bug 304199 [Path Variables] Second review pass for Dynamic Path Variables API
Not too much time left for API freeze, thus I have a second look at this new API. Changes under review are: - IProject#getPathVariableManager - changes in IPathVariableManager - IPathVariable - PathVariableResolver (SPI) If I missed something, please let me know. 1. IPathVariable#isPreferred. I am not sure how this is computed? Is it set once per whole Eclipse session? Is it possible that we end up having two 'the same' IPathVariables, where one is preferred and another one is not? 2. We had a discussion once, that dynamic path variables API may be more flexible. Right now we can get the manager only for the workspace or a project. I think that more flexible API would be: IWorkspace#getPathVariableManager(IResource) which would return the manager for the given resource and only IWorkspace and IProject scopes would be supported now. Maybe we could add support for IFolder in M7? 3. I don't understand this IPathVariableManager#convertToRelative. Why do we pass IResource there? The same for IPathvariableManager#getVariableRelativePathLocation. I assume that URI is enough...
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/ide/undo/WorkspaceUndoUtil.java
}
	/*
	 * Copy the content of the specified resource to the existing resource,
	 * returning a ResourceDescription that can be used to restore the original
	 * content. Do nothing if the resources are not files.
	 */
	private static ResourceDescription copyOverExistingResource(
			IResource source, IResource existing, IProgressMonitor monitor,
			IAdaptable uiInfo, boolean deleteSourceFile) throws CoreException {
		if (!(source instanceof IFile && existing instanceof IFile)) {
			return null;
		}
		IFile file = (IFile) source;
		IFile existingFile = (IFile) existing;
		monitor
				.beginTask(
						UndoMessages.AbstractResourcesOperation_CopyingResourcesProgress,
						3);
		if (file != null && existingFile != null) {
			if (validateEdit(file, existingFile, getShell(uiInfo))) {
				
				
				FileDescription fileDescription = new FileDescription(
						existingFile);
				
				existingFile.setContents(file.getContents(),
						IResource.KEEP_HISTORY, new SubProgressMonitor(monitor,
								1));
				fileDescription.recordStateFromHistory(existingFile,
						new SubProgressMonitor(monitor, 1));