|
||||||||||
| 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.internal.resources.Resource
org.eclipse.core.internal.resources.Container
public abstract class Container
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.core.resources.IContainer |
|---|
EXCLUDE_DERIVED, INCLUDE_HIDDEN, INCLUDE_PHANTOMS, INCLUDE_TEAM_PRIVATE_MEMBERS |
| Fields inherited from interface org.eclipse.core.resources.IResource |
|---|
ALLOW_MISSING_LOCAL, ALWAYS_DELETE_PROJECT_CONTENT, AVOID_NATURE_CONFIG, BACKGROUND_REFRESH, CHECK_ANCESTORS, DEPTH_INFINITE, DEPTH_ONE, DEPTH_ZERO, DERIVED, FILE, FOLDER, FORCE, HIDDEN, KEEP_HISTORY, NEVER_DELETE_PROJECT_CONTENT, NONE, NULL_STAMP, PROJECT, REPLACE, ROOT, SHALLOW, TEAM_PRIVATE |
| Method Summary | |
|---|---|
void |
convertToPhantom()
Converts this resource and all its children into phantoms by modifying their resource infos in-place. |
boolean |
exists(org.eclipse.core.runtime.IPath childPath)
Returns whether a resource of some type with the given path exists relative to this resource. |
IFile[] |
findDeletedMembersWithHistory(int depth,
org.eclipse.core.runtime.IProgressMonitor monitor)
Returns a list of recently deleted files inside this container that have one or more saved states in the local history. |
IResource |
findMember(org.eclipse.core.runtime.IPath childPath)
Finds and returns the member resource identified by the given path in this container, or null if no such resource exists. |
IResource |
findMember(org.eclipse.core.runtime.IPath childPath,
boolean phantom)
Finds and returns the member resource identified by the given path in this container, or null if there is no such resource. |
IResource |
findMember(java.lang.String name)
Finds and returns the member resource (project, folder, or file) with the given name in this container, or null if no such
resource exists. |
IResource |
findMember(java.lang.String name,
boolean phantom)
Finds and returns the member resource (project, folder, or file) with the given name in this container, or null if
there is no such resource. |
java.lang.String |
getDefaultCharset()
Returns the default charset for resources in this container. |
IFile |
getFile(org.eclipse.core.runtime.IPath childPath)
Returns a handle to the file identified by the given path in this container. |
IFile |
getFile(java.lang.String name)
|
IFolder |
getFolder(org.eclipse.core.runtime.IPath childPath)
Returns a handle to the folder identified by the given path in this container. |
IFolder |
getFolder(java.lang.String name)
|
boolean |
isLocal(int flags,
int depth)
Deprecated. |
IResource[] |
members()
Returns a list of existing member resources (projects, folders and files) in this resource, in no particular order. |
IResource[] |
members(boolean phantom)
Returns a list of all member resources (projects, folders and files) in this resource, in no particular order. |
IResource[] |
members(int memberFlags)
Returns a list of all member resources (projects, folders and files) in this resource, in no particular order. |
void |
setDefaultCharset(java.lang.String charset)
Deprecated. Replaced by setDefaultCharset(String, IProgressMonitor) which
is a workspace operation and reports changes in resource deltas. |
void |
setDefaultCharset(java.lang.String newCharset,
org.eclipse.core.runtime.IProgressMonitor monitor)
Sets the default charset for this container. |
| Methods inherited from class org.eclipse.core.runtime.PlatformObject |
|---|
getAdapter |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.core.resources.IContainer |
|---|
getDefaultCharset |
| Methods inherited from interface org.eclipse.core.runtime.IAdaptable |
|---|
getAdapter |
| Methods inherited from interface org.eclipse.core.runtime.jobs.ISchedulingRule |
|---|
contains, isConflicting |
| Method Detail |
|---|
public void convertToPhantom()
throws org.eclipse.core.runtime.CoreException
convertToPhantom in class Resourceorg.eclipse.core.runtime.CoreExceptionpublic boolean exists(org.eclipse.core.runtime.IPath childPath)
IContainer
exists in interface IContainerchildPath - the path of the resource
true if a resource of some type with the given path
exists relative to this resource, and false otherwiseIResource.exists()public IResource findMember(java.lang.String name)
IContainernull if no such
resource exists.
N.B. Unlike the methods which traffic strictly in resource handles, this method infers the resulting resource's type from the resource existing at the calculated path in the workspace.
findMember in interface IContainername - the string name of the member resource
null if no such
resource exists
public IResource findMember(java.lang.String name,
boolean phantom)
IContainernull 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.
N.B. Unlike the methods which traffic strictly in resource handles, this method infers the resulting resource's type from the existing resource (or phantom) in the workspace.
findMember in interface IContainername - the string name of the member resourcephantom - true if phantom resources are
of interest; false if phantom resources are not of
interest
null if no such
resource existsIContainer.members(),
IResource.isPhantom()public IResource findMember(org.eclipse.core.runtime.IPath childPath)
IContainernull 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. Parent
references in the supplied path are discarded if they go above the workspace
root.
Note that no attempt is made to exclude team-private member resources
as with members.
N.B. Unlike the methods which traffic strictly in resource handles, this method infers the resulting resource's type from the resource existing at the calculated path in the workspace.
findMember in interface IContainerchildPath - the path of the desired resource
null if no such
resource exists
public IResource findMember(org.eclipse.core.runtime.IPath childPath,
boolean phantom)
IContainernull 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.
Parent references in the supplied path are discarded if they go above the
workspace root.
If the includePhantoms argument is false,
only a resource that exists at the given path will be returned.
If the includePhantoms argument is true,
the method also returns a resource if the workspace is keeping track of
a phantom member resource at the given path.
Note that no attempt is made to exclude team-private member resources
as with members.
N.B. Unlike the methods which traffic strictly in resource handles, this method infers the resulting resource's type from the existing resource (or phantom) at the calculated path in the workspace.
findMember in interface IContainerchildPath - the path of the desired resourcephantom - true if phantom resources are
of interest; false if phantom resources are not of
interest
null if no such
resource existsIContainer.members(boolean),
IResource.isPhantom()public IFile getFile(java.lang.String name)
public IFile getFile(org.eclipse.core.runtime.IPath childPath)
IContainerThis 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.
getFile in interface IContainerchildPath - the path of the member file
IContainer.getFolder(IPath)public IFolder getFolder(java.lang.String name)
public IFolder getFolder(org.eclipse.core.runtime.IPath childPath)
IContainerThis 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.
getFolder in interface IContainerchildPath - the path of the member folder
IContainer.getFile(IPath)
public boolean isLocal(int flags,
int depth)
Resource
isLocal in class Resource
public IResource[] members()
throws org.eclipse.core.runtime.CoreException
IContainer
This is a convenience method, fully equivalent to members(IResource.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.
members in interface IContainerorg.eclipse.core.runtime.CoreException - if this request fails. Reasons include:
IContainer.findMember(IPath),
IResource.isAccessible()
public IResource[] members(boolean phantom)
throws org.eclipse.core.runtime.CoreException
IContainerThis is a convenience method, fully equivalent to:
members(includePhantoms ? INCLUDE_PHANTOMS : IResource.NONE);Team-private member resources are not included in the result.
members in interface IContainerphantom - true if phantom resources are
of interest; false if phantom resources are not of
interest
org.eclipse.core.runtime.CoreException - if this request fails. Reasons include:
includePhantoms is false and
this resource does not exist.includePhantoms is false and
this resource is a project that is not open.IContainer.members(int),
IResource.exists(),
IResource.isPhantom()
public IResource[] members(int memberFlags)
throws org.eclipse.core.runtime.CoreException
IContainer
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 IContainer.INCLUDE_HIDDEN flag is specified in the member flags, hidden
members will be included along with the others. If the IContainer.INCLUDE_HIDDEN flag
is not specified (recommended), the result will omit any hidden
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.
members in interface IContainermemberFlags - bit-wise or of member flag constants
(IContainer.INCLUDE_PHANTOMS, IContainer.INCLUDE_TEAM_PRIVATE_MEMBERS,
IContainer.INCLUDE_HIDDEN and IContainer.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.IResource.exists()
public java.lang.String getDefaultCharset()
throws org.eclipse.core.runtime.CoreException
IContainerThis is a convenience method, fully equivalent to:
getDefaultCharset(true);
Note that this method does not check whether the result is a supported
charset name. Callers should be prepared to handle
UnsupportedEncodingException where this charset is used.
getDefaultCharset in interface IContainerorg.eclipse.core.runtime.CoreException - if this method failsIContainer.getDefaultCharset(boolean),
IFile.getCharset()
public IFile[] findDeletedMembersWithHistory(int depth,
org.eclipse.core.runtime.IProgressMonitor monitor)
IContainerWhen applied to an existing project resource, this method returns recently deleted files with saved states in that project. Note that local history is maintained with each individual project, and gets discarded when a project is deleted from the workspace. If applied to a deleted project, this method returns the empty list.
When applied to the workspace root resource (depth infinity), this method returns all recently deleted files with saved states in all existing projects.
When applied to a folder (or project) resource (depth one), this method returns all recently deleted member files with saved states.
When applied to a folder resource (depth zero), this method returns an empty list unless there was a recently deleted file with saved states at the same path as the folder.
This method is long-running; progress and cancellation are provided by the given progress monitor.
findDeletedMembersWithHistory in interface IContainerdepth - depth limit: one of DEPTH_ZERO, DEPTH_ONE
or DEPTH_INFINITEmonitor - a progress monitor, or null if progress
reporting and cancellation are not desired
IFile.getHistory(IProgressMonitor)
public void setDefaultCharset(java.lang.String charset)
throws org.eclipse.core.runtime.CoreException
setDefaultCharset(String, IProgressMonitor) which
is a workspace operation and reports changes in resource deltas.
setDefaultCharset in interface IContainercharset - a charset string, or null
org.eclipse.core.runtime.CoreException - if this method fails Reasons include:
IContainer.setDefaultCharset(String)
public void setDefaultCharset(java.lang.String newCharset,
org.eclipse.core.runtime.IProgressMonitor monitor)
throws org.eclipse.core.runtime.CoreException
IContainernull
will remove the default charset setting for this resource.
This method changes resources; these changes will be reported in a subsequent resource change event, including an indication that the encoding of affected resources has been changed.
This method is long-running; progress and cancellation are provided by the given progress monitor.
setDefaultCharset in interface IContainernewCharset - a charset string, or nullmonitor - a progress monitor, or null if progress
reporting is not desired
org.eclipse.core.runtime.CoreException - if this method fails Reasons include:
IResourceChangeEvent for more details.IContainer.getDefaultCharset(),
IResourceRuleFactory.charsetRule(IResource)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||