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
*/
	public boolean isValid() {
		if (location != null) {
			return super.isValid();
		}
		return super.isValid() && fileContentDescription != null
				&& fileContentDescription.exists();
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see org.eclipse.ui.internal.ide.undo.ResourceDescription#getName()
	 */
	public String getName() {
		return name;
	}
	/*
	 * Get the file state that matches this file description. The local time
	 * stamp is used to try to find a matching file state. If none can be found,
	 * the most recent copy of the file state is used.
	 */
	private IFileState getMatchingFileState(IFileState[] states) {
		for (int i = 0; i < states.length; i++) {
			if (localTimeStamp == states[i].getModificationTime()) {
				return states[i];
			}
		}
		return states[0];
	}
}