Eclipse Platform
Release 3.3

org.eclipse.ui.ide.undo
Class ResourceDescription

java.lang.Object
  extended byorg.eclipse.ui.ide.undo.ResourceDescription

public abstract class ResourceDescription
extends Object

ResourceDescription is a lightweight description that describes the common attributes of a resource to be created. This class is not intended to be extended by clients.

Since:
3.3

Constructor Summary
ResourceDescription()
           
 
Method Summary
abstract  void createExistentResourceFromHandle(IResource resource, IProgressMonitor monitor)
          Given a resource handle, create an actual resource with the attributes of the receiver resource description.
abstract  IResource createResource(IProgressMonitor monitor)
          Create an existent resource from this resource description.
abstract  IResource createResourceHandle()
          Create a resource handle that can be used to create a resource from this resource description.
static ResourceDescription fromResource(IResource resource)
          Create a resource description given the specified resource.
abstract  String getName()
          Get the name of this resource.
abstract  boolean isValid()
          Return a boolean indicating whether this resource description has enough information to create a resource.
abstract  void recordStateFromHistory(IResource resource, IProgressMonitor monitor)
          Record the appropriate state of this resource description using any available resource history.
abstract  boolean verifyExistence(boolean checkMembers)
          Return a boolean indicating whether this description represents an existent resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceDescription

public ResourceDescription()
Method Detail

fromResource

public static ResourceDescription fromResource(IResource resource)
Create a resource description given the specified resource. The resource is assumed to exist.

Parameters:
resource - the resource from which a description should be created
Returns:
the resource description

createResourceHandle

public abstract IResource createResourceHandle()
Create a resource handle that can be used to create a resource from this resource description. This handle can be used to create the actual resource, or to describe the creation to a resource delta factory.

Returns:
the resource handle that can be used to create a resource from this description

getName

public abstract String getName()
Get the name of this resource.

Returns:
the name of the Resource

createResource

public abstract IResource createResource(IProgressMonitor monitor)
                                  throws CoreException
Create an existent resource from this resource description.

Parameters:
monitor - the progress monitor to use
Returns:
a resource that has the attributes of this resource description
Throws:
CoreException

createExistentResourceFromHandle

public abstract void createExistentResourceFromHandle(IResource resource,
                                                      IProgressMonitor monitor)
                                               throws CoreException
Given a resource handle, create an actual resource with the attributes of the receiver resource description.

Parameters:
resource - the resource handle
monitor - the progress monitor to be used when creating the resource
Throws:
CoreException

isValid

public abstract boolean isValid()
Return a boolean indicating whether this resource description has enough information to create a resource.

Returns:
true if the resource can be created, and false if it does not have enough information

recordStateFromHistory

public abstract void recordStateFromHistory(IResource resource,
                                            IProgressMonitor monitor)
                                     throws CoreException
Record the appropriate state of this resource description using any available resource history.

Parameters:
resource - the resource whose state is to be recorded.
monitor - the progress monitor to be used
Throws:
CoreException

verifyExistence

public abstract boolean verifyExistence(boolean checkMembers)
Return a boolean indicating whether this description represents an existent resource.

Parameters:
checkMembers - Use true if members should also exist in order for this description to be considered existent. A value of false indicates that the existence of members does not matter.
Returns:
a boolean indicating whether this description represents an existent resource.

Eclipse Platform
Release 3.3

Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2000, 2007. All rights reserved.