|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Represents a component as defined by the WTP Modules file. A virtual container represents the root of the component.
Virtual containers can provide handles to virtual files and virtual folders that it contains.
To acquire a handle to a component, use the following snippet:
ModuleCore.createContainer(containingProject, componentName)
which will create a handle to a virtual container contained by
containingProject with the name componentName. If the
a component of the given name exists, then
IVirtualResource.exists()
will return true. Otherwise, use create(int, IProgressMonitor) to
create the relevant model elements. If a client needs to add a
mapping from a folder in the same project to root, use
IVirtualResource.createLink(IPath, int, IProgressMonitor) with a
project-relative path.
This interface is not intended to be implemented by clients.
| Field Summary |
| Fields inherited from interface org.eclipse.wst.common.componentcore.resources.IVirtualResource |
COMPONENT, FILE, FOLDER, FORCE, IGNORE_EXCLUSIONS, IGNORE_UNDERLYING_RESOURCE, NONE |
| Method Summary | |
void |
create(int updateFlags,
org.eclipse.core.runtime.IProgressMonitor aMonitor)
Create the underlying model elements if they do not already exist. |
boolean |
exists(org.eclipse.core.runtime.IPath path)
Returns whether a virtual resource of some type with the given path exists relative to this resource. |
IVirtualResource |
findMember(org.eclipse.core.runtime.IPath path)
Finds and returns the member resource identified by the given path in this container, or null if no such resource exists.
|
IVirtualResource |
findMember(org.eclipse.core.runtime.IPath path,
int searchFlags)
Finds and returns the member resource identified by the given path in this container, or null if there is no such resource.
|
IVirtualResource |
findMember(java.lang.String name)
Finds and returns the member virtual resource (folder or file) with the given name in this container, or null if no such
resource exists. |
IVirtualResource |
findMember(java.lang.String name,
int searchFlags)
Finds and returns the member resource (folder, or file) with the given name in this container, or null if
there is no such resource.
|
IVirtualFile |
getFile(org.eclipse.core.runtime.IPath path)
Returns a handle to the file identified by the given path in this container. |
IVirtualFile |
getFile(java.lang.String name)
Returns a handle to the file with the given name in this folder. |
IVirtualFolder |
getFolder(org.eclipse.core.runtime.IPath path)
Returns a handle to the folder identified by the given path in this container. |
IVirtualFolder |
getFolder(java.lang.String name)
Returns a handle to the folder with the given name in this folder. |
IVirtualResource[] |
getResources(java.lang.String aResourceType)
|
IVirtualResource[] |
members()
Returns a list of existing member resources (projects, folders and files) in this resource, in no particular order. |
IVirtualResource[] |
members(int memberFlags)
Returns a list of all member resources (projects, folders and files) in this resource, in no particular order. |
| Methods inherited from interface org.eclipse.wst.common.componentcore.resources.IVirtualResource |
createLink, delete, equals, exists, getComponent, getFileExtension, getName, getParent, getProject, getProjectRelativePath, getResourceType, getRuntimePath, getType, getUnderlyingResource, getUnderlyingResources, getWorkspaceRelativePath, isAccessible, setResourceType |
| Methods inherited from interface org.eclipse.core.runtime.jobs.ISchedulingRule |
contains, isConflicting |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
getAdapter |
| Method Detail |
public void create(int updateFlags,
org.eclipse.core.runtime.IProgressMonitor aMonitor)
throws org.eclipse.core.runtime.CoreException
updateFlags - Any of IVirtualResource or IResource update flags. If a
resource must be created, the updateFlags will be supplied to the
resource creation operation.aMonitor -
org.eclipse.core.runtime.CoreExceptionpublic boolean exists(org.eclipse.core.runtime.IPath path)
path - the path of the resource
true if a resource of some type with the given path
exists relative to this resource, and false otherwiseIVirtualResource.exists()public IVirtualResource findMember(java.lang.String name)
null if no such
resource exists.
name - the string name of the member resource
null if no such
resource exists
public IVirtualResource findMember(java.lang.String name,
int searchFlags)
null if
there is no such resource.
If the includePhantoms argument is false,
only a member resource with the given name that exists will be returned.
If the includePhantoms argument is true,
the method also returns a resource if the workspace is keeping track of a
phantom with that name.
Note that no attempt is made to exclude team-private member resources
as with members.
name - the string name of the member resource
null if no such
resource existsmembers(),
IVirtualResource#isPhantom()public IVirtualResource findMember(org.eclipse.core.runtime.IPath path)
null if no such resource exists.
The supplied path may be absolute or relative; in either case, it is
interpreted as relative to this resource. Trailing separators and the path's
device are ignored. If the path is empty this container is returned.
path - the path of the desired resource
null if no such
resource exists
public IVirtualResource findMember(org.eclipse.core.runtime.IPath path,
int searchFlags)
null if there is no such resource.
The supplied path may be absolute or relative; in either case, it is
interpreted as relative to this resource. Trailing separators and the path's
device are ignored.
If the path is empty this container is returned.
path - the path of the desired resource
null if no such
resource exists#members(boolean),
IVirtualResource#isPhantom()public IVirtualFile getFile(org.eclipse.core.runtime.IPath path)
This is a resource handle operation; neither the resource nor the result need exist in the workspace. The validation check on the resource name/path is not done when the resource handle is constructed; rather, it is done automatically as the resource is created.
The supplied path may be absolute or relative; in either case, it is interpreted as relative to this resource and is appended to this container's full path to form the full path of the resultant resource. A trailing separator is ignored. The path of the resulting resource must have at least two segments.
path - the path of the member file
getFolder(IPath)public IVirtualFolder getFolder(org.eclipse.core.runtime.IPath path)
This is a resource handle operation; neither the resource nor the result need exist in the workspace. The validation check on the resource name/path is not done when the resource handle is constructed; rather, it is done automatically as the resource is created.
The supplied path may be absolute or relative; in either case, it is interpreted as relative to this resource and is appended to this container's full path to form the full path of the resultant resource. A trailing separator is ignored. The path of the resulting resource must have at least two segments.
path - the path of the member folder
getFile(IPath)public IVirtualFile getFile(java.lang.String name)
This is a resource handle operation; neither the resource nor the result need exist in the workspace. The validation check on the resource name/path is not done when the resource handle is constructed; rather, it is done automatically as the resource is created.
name - the string name of the member file
getFolder(String)public IVirtualFolder getFolder(java.lang.String name)
This is a resource handle operation; neither the container nor the result need exist in the workspace. The validation check on the resource name/path is not done when the resource handle is constructed; rather, it is done automatically as the resource is created.
name - the string name of the member folder
getFile(String)
public IVirtualResource[] members()
throws org.eclipse.core.runtime.CoreException
This is a convenience method, fully equivalent to members(IVirtualResource.NONE).
Team-private member resources are not included in the result.
Note that the members of a project or folder are the files and folders immediately contained within it. The members of the workspace root are the projects in the workspace.
org.eclipse.core.runtime.CoreException - if this request fails. Reasons include:
findMember(IPath),
IVirtualResource.isAccessible()
public IVirtualResource[] members(int memberFlags)
throws org.eclipse.core.runtime.CoreException
If the INCLUDE_PHANTOMS flag is not specified in the member
flags (recommended), only member resources that exist will be returned.
If the INCLUDE_PHANTOMS flag is specified,
the result will also include any phantom member resources the
workspace is keeping track of.
If the INCLUDE_TEAM_PRIVATE_MEMBERS flag is specified
in the member flags, team private members will be included along with
the others. If the INCLUDE_TEAM_PRIVATE_MEMBERS flag
is not specified (recommended), the result will omit any team private
member resources.
If the EXCLUDE_DERIVED flag is not specified, derived
resources are included. If the EXCLUDE_DERIVED flag is
specified in the member flags, derived resources are not included.
memberFlags - bit-wise or of member flag constants
(INCLUDE_PHANTOMS, INCLUDE_TEAM_PRIVATE_MEMBERS
and EXCLUDE_DERIVED) indicating which members are of interest
org.eclipse.core.runtime.CoreException - if this request fails. Reasons include:
INCLUDE_PHANTOMS flag is not specified and
this resource does not exist.INCLUDE_PHANTOMS flag is not specified and
this resource is a project that is not open.IVirtualResource.exists()public IVirtualResource[] getResources(java.lang.String aResourceType)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||