|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A root resource represents the top of the resource hierarchy in a workspace. There is exactly one root in a workspace. The root resource has the following behavior:
This interface is not intended to be implemented by clients.
Workspace roots implement the IAdaptable
interface;
extensions are managed by the platform's adapter manager.
Platform.getAdapterManager()
Field Summary |
Fields inherited from interface org.eclipse.core.resources.IContainer |
INCLUDE_PHANTOMS, INCLUDE_TEAM_PRIVATE_MEMBERS |
Fields inherited from interface org.eclipse.core.resources.IResource |
ALWAYS_DELETE_PROJECT_CONTENT, DEPTH_INFINITE, DEPTH_ONE, DEPTH_ZERO, FILE, FOLDER, FORCE, KEEP_HISTORY, NEVER_DELETE_PROJECT_CONTENT, NONE, NULL_STAMP, PROJECT, ROOT |
Method Summary | |
void |
delete(boolean deleteContent,
boolean force,
IProgressMonitor monitor)
Deletes everything in the workspace except the workspace root resource itself. |
IContainer |
getContainerForLocation(IPath path)
Returns a handle to the workspace root, project or folder which is mapped to the given path in the local file system, or null if none. |
IFile |
getFileForLocation(IPath filesystemPath)
Returns a handle to the file which is mapped to the given path in the local file system, or null if none. |
IProject |
getProject(String name)
Returns a handle to the project resource with the given name which is a child of this root. |
IProject[] |
getProjects()
Returns the collection of projects which exist under this root. |
Methods inherited from interface org.eclipse.core.resources.IContainer |
exists, findDeletedMembersWithHistory, findMember, findMember, findMember, findMember, getFile, getFolder, members, members, members |
Methods inherited from interface org.eclipse.core.resources.IResource |
accept, accept, accept, clearHistory, copy, copy, copy, copy, createMarker, delete, delete, deleteMarkers, equals, exists, findMarker, findMarkers, getFileExtension, getFullPath, getLocation, getMarker, getModificationStamp, getName, getParent, getPersistentProperty, getProject, getProjectRelativePath, getSessionProperty, getType, getWorkspace, isAccessible, isDerived, isLocal, isPhantom, isReadOnly, isSynchronized, isTeamPrivateMember, move, move, move, move, refreshLocal, setDerived, setLocal, setPersistentProperty, setReadOnly, setSessionProperty, setTeamPrivateMember, touch |
Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
Method Detail |
public void delete(boolean deleteContent, boolean force, IProgressMonitor monitor) throws CoreException
This is a convenience method, fully equivalent to:
delete( (deleteContent ? IResource.ALWAYS_DELETE_PROJECT_CONTENT : IResource.NEVER_DELETE_PROJECT_CONTENT ) | (force ? FORCE : IResource.NONE), monitor);
This method changes resources; these changes will be reported in a subsequent resource change event.
This method is long-running; progress and cancellation are provided by the given progress monitor.
deleteContent
- a flag controlling how whether content is
aggressively deletedforce
- a flag controlling whether resources that are not
in sync with the local file system will be toleratedmonitor
- a progress monitor, or null
if progress
reporting and cancellation are not desired
CoreException
- if this method fails. Reasons include:
IResource.delete(int,IProgressMonitor)
public IContainer getContainerForLocation(IPath path)
null
if none.
If the path maps to the platform working location, the returned object
will be of type ROOT
. If the path maps to a
project, the resulting object will be
of type PROJECT
; otherwise the resulting object
will be a folder (type FOLDER
).
The path must be absolute; its segments need not be valid names;
a trailing separator is ignored.
The resulting resource need not exist in the workspace.
path
- a path in the local file system
null
if nonepublic IFile getFileForLocation(IPath filesystemPath)
null
if none.
The path must be absolute; its segments need not be valid names.
The resulting file need not exist in the workspace.
null
if nonepublic IProject getProject(String name)
Note: This method deals exclusively with resource handles, independent of whether the resources exist in the workspace. The validation check on the project name is not done when the project handle is constructed; rather, it is done automatically as the project is created.
name
- the name of the project
getProjects()
public IProject[] getProjects()
getProject(java.lang.String)
|
Eclipse Platform 2.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |