Bug 166763 [Undo] API request: org.eclipse.ui.internal.ide.undo.ResourceDescription
I20061129-1340 To support undo for file operations in the Package Explorer, we need the functionality of org.eclipse.ui.internal.ide.undo.ResourceDescription. Could this class be promoted to API? I've copied the package for now (to avoid referencing internal code). We need more low-level operations than what's currently in org.eclipse.ui.ide.undo, because we must let jdt.core do the actual modifications and because our actions are refactorings with participants, which must adhere to the ltk.core.refactoring undo story.
bundles/org.eclipse.ui.ide/src/org/eclipse/ui/internal/ide/undo/FileDescription.java
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.SubProgressMonitor;
/**
 * FileDescription is a lightweight description that describes a file to be
 * created.
 * 
 * This class is not intended to be instantiated or used by clients.
 * 
 * @since 3.3
 * 
 */
public class FileDescription extends ResourceDescription {
	String name;
	URI location;
	String charset;
	private IFileContentDescription fileContentDescription;
	/**
	 * Create a FileDescription that can be used to later restore the given
	 * file. The file typically already exists, but this constructor will not
	 * fail if the file does not exist.
	 * 
	 * @param file
	 *            the file to be restored.
	 */
	public FileDescription(IFile file) {
		super(file);
		this.name = file.getName();