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/ResourceDescription.java
* @since 3.3
 * 
 */
public abstract class ResourceDescription {
	IContainer parent;
	long modificationStamp = IResource.NULL_STAMP;
	long localTimeStamp = IResource.NULL_STAMP;
	ResourceAttributes resourceAttributes;
	MarkerDescription[] markerDescriptions;
	/**
	 * Create a resource description given the specified resource. The resource
	 * is assumed to exist.
	 * 
	 * @param resource
	 *            the resource from which a description should be created
	 * @return the resource description
	 */
	public static ResourceDescription fromResource(IResource resource) {
		if (resource.getType() == IResource.PROJECT) {
			return new ProjectDescription((IProject) resource);
		} else if (resource.getType() == IResource.FOLDER) {
			return new FolderDescription((IFolder) resource);
		} else if (resource.getType() == IResource.FILE) {
			return new FileDescription((IFile) resource);
		} else {
			throw new IllegalArgumentException();
		}
	}
	/**
	 * Create a resource description with no initial attributes