|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.PlatformObject
org.eclipse.core.resources.mapping.ResourceMapping
org.eclipse.ltk.core.refactoring.model.AbstractRefactoringHistoryResourceMapping
Partial implementation of a resource mapping for a refactoring history object.
Note: this class is intended to be implemented by clients which need to enhance a model provider with a refactoring model.
ResourceMapping
,
ModelProvider
Constructor Summary | |
---|---|
protected |
AbstractRefactoringHistoryResourceMapping(RefactoringHistory history)
Creates a new abstract refactoring history resource mapping. |
Method Summary | |
---|---|
boolean |
equals(Object object)
Override equals to compare the model objects of the mapping in order to determine equality. |
Object |
getModelObject()
Returns the application model element associated with this resource mapping. |
IProject[] |
getProjects()
Returns the projects that contain the resources that constitute this application model. |
IResource |
getResource()
Returns the associated resource. |
ResourceTraversal[] |
getTraversals(ResourceMappingContext context,
IProgressMonitor monitor)
Returns one or more traversals that can be used to access all the physical resources that constitute the logical resource. A traversal is simply a set of resources and the depth to which they are to be traversed. This method returns an array of traversals in order to provide flexibility in describing the traversals that constitute a model element. Subclasses should, when possible, include all resources that are or may be members of the model element. For instance, a model element should return the same list of resources regardless of the existence of the files on the file system. For example, if a logical resource called "form" maps to "/p1/form.xml" and "/p1/form.java" then whether form.xml or form.java existed, they should be returned by this method. In some cases, it may not be possible for a model element to know all the resources that may constitute the element without accessing the state of the model element in another location (e.g. a repository). This method is provided with a context which, when provided, gives access to the members of corresponding remote containers and the contents of corresponding remote files. This gives the model element the opportunity to deduce what additional resources should be included in the traversal. |
int |
hashCode()
Override hashCode to use the model object. |
Methods inherited from class org.eclipse.core.resources.mapping.ResourceMapping |
---|
accept, contains, findMarkers, getModelProvider, getModelProviderId |
Methods inherited from class org.eclipse.core.runtime.PlatformObject |
---|
getAdapter |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected AbstractRefactoringHistoryResourceMapping(RefactoringHistory history)
history
- the refactoring historyMethod Detail |
public boolean equals(Object object)
equals
in class ResourceMapping
object
- the object to compare
true
if the receiver is equal to the
given object, and false
otherwise.public final Object getModelObject()
getModelObject
in class ResourceMapping
public final IProject[] getProjects()
getProjects
in class ResourceMapping
public final IResource getResource()
This method only returns a meaningful result if the history contains refactorings of a single project.
null
if the
refactoring history contains workspace refactoring descriptors
only, or if it contains refactoring descriptors from multiple
projects.public final ResourceTraversal[] getTraversals(ResourceMappingContext context, IProgressMonitor monitor) throws CoreException
Subclasses should, when possible, include all resources that are or may be members of the model element. For instance, a model element should return the same list of resources regardless of the existence of the files on the file system. For example, if a logical resource called "form" maps to "/p1/form.xml" and "/p1/form.java" then whether form.xml or form.java existed, they should be returned by this method.
In some cases, it may not be possible for a model element to know all the resources that may constitute the element without accessing the state of the model element in another location (e.g. a repository). This method is provided with a context which, when provided, gives access to the members of corresponding remote containers and the contents of corresponding remote files. This gives the model element the opportunity to deduce what additional resources should be included in the traversal.
getTraversals
in class ResourceMapping
context
- gives access to the state of
remote resources that correspond to local resources for the
purpose of determining traversals that adequately cover the
model element resources given the state of the model element
in another location. This parameter may be null
, in
which case the implementor can assume that only the local
resources are of interest to the client.monitor
- a progress monitor, or null
if progress
reporting is not desired
CoreException
- if the traversals could not be obtained.public int hashCode()
hashCode
in class ResourceMapping
|
Eclipse Platform Release 3.2 |
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2006. All rights reserved.