|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IPackageFragmentRoot
A package fragment root (or source folder root) contains a set of source folders (package fragments).
It corresponds to an underlying resource which is either folder. All descendant folders represent
package fragments. For a given child folder representing a package fragment,
the corresponding package name is composed of the folder names between the folder
for this root and the child folder representing the package, separated by '.'.
Package fragment roots need to be opened before they can be navigated or manipulated.
The children are of type IPackageFragment
, and are in no particular order.
This interface is not intended to be implemented by clients.
Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Field Summary | |
---|---|
static java.lang.String |
DEFAULT_PACKAGEROOT_PATH
Empty root path |
static int |
DESTINATION_PROJECT_INCLUDEPATH
Update model flag constant (bit mask value 8) indicating that the operation is to update the includepath of the destination project. |
static int |
K_BINARY
Kind constant for a binary path root. |
static int |
K_SOURCE
Kind constant for a source path root. |
static int |
NO_RESOURCE_MODIFICATION
Update model flag constant (bit mask value 1) indicating that the operation is to not copy/move/delete the package fragment root resource. |
static int |
ORIGINATING_PROJECT_INCLUDEPATH
Update model flag constant (bit mask value 2) indicating that the operation is to update the includepath of the originating project. |
static int |
OTHER_REFERRING_PROJECTS_INCLUDEPATH
Update model flag constant (bit mask value 4) indicating that the operation is to update the includepath of all referring projects except the originating project. |
static int |
REPLACE
Update model flag constant (bit mask value 16) indicating that the operation is to replace the resource and the destination project's includepath entry. |
Fields inherited from interface org.eclipse.wst.jsdt.core.IJavaScriptElement |
---|
CLASS_FILE, FIELD, IMPORT_CONTAINER, IMPORT_DECLARATION, INITIALIZER, JAVASCRIPT_MODEL, JAVASCRIPT_PROJECT, JAVASCRIPT_UNIT, LOCAL_VARIABLE, METHOD, PACKAGE_DECLARATION, PACKAGE_FRAGMENT, PACKAGE_FRAGMENT_ROOT, TYPE, TYPE_PARAMETER |
Method Summary | |
---|---|
void |
attachSource(IPath sourcePath,
IPath rootPath,
IProgressMonitor monitor)
|
void |
copy(IPath destination,
int updateResourceFlags,
int updateModelFlags,
IIncludePathEntry sibling,
IProgressMonitor monitor)
Copies the resource of this package fragment root to the destination path as specified by IResource.copy(IPath, int, IProgressMonitor)
but excluding nested source folders. |
IPackageFragment |
createPackageFragment(java.lang.String name,
boolean force,
IProgressMonitor monitor)
Creates and returns a package fragment in this root with the given dot-separated package name. |
void |
delete(int updateResourceFlags,
int updateModelFlags,
IProgressMonitor monitor)
Deletes the resource of this package fragment root as specified by IResource.delete(int, IProgressMonitor) but excluding nested
source folders. |
IIncludePathAttribute[] |
getIncludepathAttributes()
|
int |
getKind()
Returns this package fragment root's kind encoded as an integer. |
java.lang.Object[] |
getNonJavaScriptResources()
Returns an array of non-JavaScript resources contained in this package fragment root. |
IPackageFragment |
getPackageFragment(java.lang.String packageName)
Returns the package fragment with the given package name. |
IIncludePathEntry |
getRawIncludepathEntry()
Returns the first raw includepath entry that corresponds to this package fragment root. |
IIncludePathEntry |
getResolvedIncludepathEntry()
|
IPath |
getSourceAttachmentPath()
Returns the absolute path to the source archive attached to this package fragment root's binary archive. |
IPath |
getSourceAttachmentRootPath()
Returns the path within this package fragment root's source archive. |
boolean |
isArchive()
Returns whether this package fragment root's underlying resource is a binary archive (a JAR or zip file). |
boolean |
isExternal()
Returns whether this package fragment root is external to the workbench (that is, a local file), and has no underlying resource. |
boolean |
isLanguageRuntime()
|
boolean |
isLibrary()
|
void |
move(IPath destination,
int updateResourceFlags,
int updateModelFlags,
IIncludePathEntry sibling,
IProgressMonitor monitor)
Moves the resource of this package fragment root to the destination path as specified by IResource.move(IPath,int,IProgressMonitor)
but excluding nested source folders. |
Methods inherited from interface org.eclipse.wst.jsdt.core.IParent |
---|
getChildren, hasChildren |
Methods inherited from interface org.eclipse.wst.jsdt.core.IJavaScriptElement |
---|
exists, getAncestor, getAttachedJavadoc, getCommonSuperType, getCorrespondingResource, getDisplayName, getElementName, getElementType, getHandleIdentifier, getHostPath, getJavaScriptModel, getJavaScriptProject, getOpenable, getParent, getPath, getPrimaryElement, getResource, getSchedulingRule, getUnderlyingResource, isReadOnly, isStructureKnown, isVirtual |
Methods inherited from interface org.eclipse.wst.jsdt.core.ILookupScope |
---|
newNameLookup, newNameLookup, newSearchableNameEnvironment, newSearchableNameEnvironment |
Methods inherited from interface org.eclipse.wst.jsdt.core.IOpenable |
---|
close, findRecommendedLineSeparator, getBuffer, hasUnsavedChanges, isConsistent, isOpen, makeConsistent, open, save |
Field Detail |
---|
static final int K_SOURCE
static final int K_BINARY
static final java.lang.String DEFAULT_PACKAGEROOT_PATH
static final int NO_RESOURCE_MODIFICATION
static final int ORIGINATING_PROJECT_INCLUDEPATH
static final int OTHER_REFERRING_PROJECTS_INCLUDEPATH
static final int DESTINATION_PROJECT_INCLUDEPATH
static final int REPLACE
Method Detail |
---|
void attachSource(IPath sourcePath, IPath rootPath, IProgressMonitor monitor) throws JavaScriptModelException
JavaScriptModelException
void copy(IPath destination, int updateResourceFlags, int updateModelFlags, IIncludePathEntry sibling, IProgressMonitor monitor) throws JavaScriptModelException
IResource.copy(IPath, int, IProgressMonitor)
but excluding nested source folders.
If NO_RESOURCE_MODIFICATION
is specified in
updateModelFlags
or if this package fragment root is external,
this operation doesn't copy the resource. updateResourceFlags
is then ignored.
If DESTINATION_PROJECT_INCLUDEPATH
is specified in
updateModelFlags
, updates the includepath of the
destination's project (if it is a JavaScript project). If a non-null
sibling is specified, a copy of this root's includepath entry is inserted before the
sibling on the destination project's raw includepath. If null
is
specified, the includepath entry is added at the end of the raw includepath.
If REPLACE
is specified in updateModelFlags
,
overwrites the resource at the destination path if any.
If the same includepath entry already exists on the destination project's raw
includepath, then the sibling is ignored and the new includepath entry replaces the
existing one.
If no flags is specified in updateModelFlags
(using
IResource.NONE
), the default behavior applies: the
resource is copied (if this package fragment root is not external) and the
includepath is not updated.
destination
- the destination pathupdateResourceFlags
- bit-wise or of update resource flag constants
(IResource.FORCE
and IResource.SHALLOW
)updateModelFlags
- bit-wise or of update resource flag constants
(DESTINATION_PROJECT_INCLUDEPATH
and
NO_RESOURCE_MODIFICATION
)sibling
- the includepath entry before which a copy of the includepath
entry should be inserted or null
if the includepath entry should
be inserted at the endmonitor
- a progress monitor
JavaScriptModelException
- if this root could not be copied. Reasons
include:
CoreException
occurred while copying the
resource or updating a includepathupdateModelFlags
has been specified as DESTINATION_PROJECT_INCLUDEPATH
(INVALID_DESTINATION)updateModelFlags
has not been specified as REPLACE
org.eclipse.core.resources.IResource#copy(IPath, boolean, IProgressMonitor)
IPackageFragment createPackageFragment(java.lang.String name, boolean force, IProgressMonitor monitor) throws JavaScriptModelException
force
flag, see IFolder.create
.
name
- the given dot-separated package nameforce
- a flag controlling how to deal with resources that
are not in sync with the local file systemmonitor
- the given progress monitor
JavaScriptModelException
- if the element could not be created. Reasons include:
CoreException
occurred while creating an underlying resource
org.eclipse.core.resources.IFolder#create(boolean, boolean, IProgressMonitor)
void delete(int updateResourceFlags, int updateModelFlags, IProgressMonitor monitor) throws JavaScriptModelException
IResource.delete(int, IProgressMonitor)
but excluding nested
source folders.
If NO_RESOURCE_MODIFICATION
is specified in
updateModelFlags
or if this package fragment root is external,
this operation doesn't delete the resource. updateResourceFlags
is then ignored.
If ORIGINATING_PROJECT_INCLUDEPATH
is specified in
updateModelFlags
, update the raw includepath of this package
fragment root's project by removing the corresponding includepath entry.
If OTHER_REFERRING_PROJECTS_INCLUDEPATH
is specified in
updateModelFlags
, update the raw includepaths of all other JavaScript
projects referring to this root's resource by removing the corresponding includepath
entries.
If no flags is specified in updateModelFlags
(using
IResource.NONE
), the default behavior applies: the
resource is deleted (if this package fragment root is not external) and no
includepaths are updated.
updateResourceFlags
- bit-wise or of update resource flag constants
(IResource.FORCE
and IResource.KEEP_HISTORY
)updateModelFlags
- bit-wise or of update resource flag constants
(ORIGINATING_PROJECT_INCLUDEPATH
,
OTHER_REFERRING_PROJECTS_INCLUDEPATH
and
NO_RESOURCE_MODIFICATION
)monitor
- a progress monitor
JavaScriptModelException
- if this root could not be deleted. Reasons
include:
CoreException
occurred while deleting the resource
or updating a includepath
org.eclipse.core.resources.IResource#delete(boolean, IProgressMonitor)
int getKind() throws JavaScriptModelException
JavaScript-like extensions
,
or .class
files, but not both.
If the underlying folder or archive contains other kinds of files, they are ignored.
In particular, .class
files are ignored under a source package fragment root,
and source files are ignored under a binary package fragment root.
JavaScriptModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resource.K_SOURCE
,
K_BINARY
java.lang.Object[] getNonJavaScriptResources() throws JavaScriptModelException
Non-JavaScript resources includes other files and folders located in the same directories as the compilation units or class files under this package fragment root. Resources excluded from this package fragment root by virtue of inclusion/exclusion patterns on the corresponding source includepath entry are considered non-JavaScript resources and will appear in the result (possibly in a folder). Thus when a nested source folder is excluded, it will appear in the non-JavaScript resources of the outer folder.
IFile
s,
IFolder
s, or IStorage
s if the
package fragment root is in archive) contained in this package
fragment root
JavaScriptModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resource.IIncludePathEntry.getInclusionPatterns()
,
IIncludePathEntry.getExclusionPatterns()
IPackageFragment getPackageFragment(java.lang.String packageName)
packageName
- the given package name
IIncludePathEntry getRawIncludepathEntry() throws JavaScriptModelException
JavaScriptModelException
- if this element does not exist or if an
exception occurs while accessing its corresponding resource.IPath getSourceAttachmentPath() throws JavaScriptModelException
null
if this package fragment root's binary archive
has no corresponding source archive, or if this package fragment root
is not a binary archive
JavaScriptModelException
- if this operation failsIPath getSourceAttachmentRootPath() throws JavaScriptModelException
null
if this package fragment root's binary archive
has no corresponding source archive, or if this package fragment root
is not a binary archive
JavaScriptModelException
- if this operation failsboolean isArchive()
This is a handle-only method.
boolean isLanguageRuntime()
boolean isExternal()
This is a handle-only method.
void move(IPath destination, int updateResourceFlags, int updateModelFlags, IIncludePathEntry sibling, IProgressMonitor monitor) throws JavaScriptModelException
IResource.move(IPath,int,IProgressMonitor)
but excluding nested source folders.
If NO_RESOURCE_MODIFICATION
is specified in
updateModelFlags
or if this package fragment root is external,
this operation doesn't move the resource. updateResourceFlags
is then ignored.
If DESTINATION_PROJECT_INCLUDEPATH
is specified in
updateModelFlags
, updates the includepath of the
destination's project (if it is a JavaScript project). If a non-null
sibling is specified, a copy of this root's includepath entry is inserted before the
sibling on the destination project's raw includepath. If null
is
specified, the includepath entry is added at the end of the raw includepath.
If ORIGINATING_PROJECT_INCLUDEPATH
is specified in
updateModelFlags
, update the raw includepath of this package
fragment root's project by removing the corresponding includepath entry.
If OTHER_REFERRING_PROJECTS_INCLUDEPATH
is specified in
updateModelFlags
, update the raw includepaths of all other JavaScript
projects referring to this root's resource by removing the corresponding includepath
entries.
If REPLACE
is specified in updateModelFlags
,
overwrites the resource at the destination path if any.
If the same includepath entry already exists on the destination project's raw
includepath, then the sibling is ignored and the new includepath entry replaces the
existing one.
If no flags is specified in updateModelFlags
(using
IResource.NONE
), the default behavior applies: the
resource is moved (if this package fragment root is not external) and no
includepaths are updated.
destination
- the destination pathupdateResourceFlags
- bit-wise or of update flag constants
(IResource.FORCE
, IResource.KEEP_HISTORY
and IResource.SHALLOW
)updateModelFlags
- bit-wise or of update resource flag constants
(DESTINATION_PROJECT_INCLUDEPATH
,
ORIGINATING_PROJECT_INCLUDEPATH
,
OTHER_REFERRING_PROJECTS_INCLUDEPATH
and
NO_RESOURCE_MODIFICATION
)sibling
- the includepath entry before which a copy of the includepath
entry should be inserted or null
if the includepath entry should
be inserted at the endmonitor
- a progress monitor
JavaScriptModelException
- if this root could not be moved. Reasons
include:
CoreException
occurred while copying the
resource or updating a includepathupdateModelFlags
has been specified as DESTINATION_PROJECT_INCLUDEPATH
(INVALID_DESTINATION)updateModelFlags
has not been specified as REPLACE
org.eclipse.core.resources.IResource#move(IPath, boolean, IProgressMonitor)
IIncludePathAttribute[] getIncludepathAttributes()
IIncludePathEntry getResolvedIncludepathEntry() throws JavaScriptModelException
JavaScriptModelException
boolean isLibrary()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |